Improve restart requests

* Fixes #4959
* Ask to restart when changing languages in application settings.
This commit is contained in:
Jonathan White 2020-07-14 23:55:23 -04:00
parent 2fe74c2947
commit 4a917d171d
2 changed files with 19 additions and 7 deletions

View file

@ -1679,17 +1679,20 @@ void MainWindow::initViewMenu()
}
}
connect(themeActions, &QActionGroup::triggered, this, [this](QAction* action) {
if (action->data() != config()->get(Config::GUI_ApplicationTheme)) {
config()->set(Config::GUI_ApplicationTheme, action->data());
connect(themeActions, &QActionGroup::triggered, this, [this, theme](QAction* action) {
config()->set(Config::GUI_ApplicationTheme, action->data());
if (action->data() != theme) {
restartApp(tr("You must restart the application to apply this setting. Would you like to restart now?"));
}
});
m_ui->actionCompactMode->setChecked(config()->get(Config::GUI_CompactMode).toBool());
connect(m_ui->actionCompactMode, &QAction::toggled, this, [this](bool checked) {
bool compact = config()->get(Config::GUI_CompactMode).toBool();
m_ui->actionCompactMode->setChecked(compact);
connect(m_ui->actionCompactMode, &QAction::toggled, this, [this, compact](bool checked) {
config()->set(Config::GUI_CompactMode, checked);
restartApp(tr("You must restart the application to apply this setting. Would you like to restart now?"));
if (checked != compact) {
restartApp(tr("You must restart the application to apply this setting. Would you like to restart now?"));
}
});
m_ui->actionShowToolbar->setChecked(!config()->get(Config::GUI_HideToolbar).toBool());