mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Only one instance of the settings dialog should be open at once
This commit is contained in:
parent
5614322a08
commit
0b2b6a0dc7
|
@ -181,9 +181,7 @@ void Notebook::resizeEvent(QResizeEvent *)
|
|||
|
||||
void Notebook::settingsButtonClicked()
|
||||
{
|
||||
SettingsDialog *a = new SettingsDialog();
|
||||
|
||||
a->show();
|
||||
SettingsDialog::showDialog();
|
||||
}
|
||||
|
||||
void Notebook::usersButtonClicked()
|
||||
|
|
|
@ -33,6 +33,7 @@ private:
|
|||
bool _mouseDown = false;
|
||||
QPoint _mousePos;
|
||||
};
|
||||
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "widgets/settingsdialog.h"
|
||||
#include "twitch/twitchaccount.h"
|
||||
#include "accountmanager.h"
|
||||
#include "twitch/twitchaccount.h"
|
||||
#include "widgets/settingsdialogtab.h"
|
||||
#include "windowmanager.h"
|
||||
|
||||
|
@ -299,6 +299,16 @@ void SettingsDialog::select(SettingsDialogTab *tab)
|
|||
_selectedTab = tab;
|
||||
}
|
||||
|
||||
void SettingsDialog::showDialog()
|
||||
{
|
||||
static SettingsDialog *instance = new SettingsDialog();
|
||||
|
||||
instance->show();
|
||||
instance->activateWindow();
|
||||
instance->raise();
|
||||
instance->setFocus();
|
||||
}
|
||||
|
||||
/// Widget creation helpers
|
||||
QCheckBox *SettingsDialog::createCheckbox(const QString &title, Setting<bool> &setting)
|
||||
{
|
||||
|
|
|
@ -26,6 +26,8 @@ public:
|
|||
|
||||
void select(SettingsDialogTab *tab);
|
||||
|
||||
static void showDialog();
|
||||
|
||||
private:
|
||||
SettingsSnapshot _snapshot;
|
||||
|
||||
|
|
Loading…
Reference in a new issue