From e989379535ae4f9c1edeea62633b4e7a5b5395b9 Mon Sep 17 00:00:00 2001 From: Maximilian Date: Wed, 26 Nov 2014 16:57:25 +0100 Subject: [PATCH] Refactored system tray settings in generalform --- src/widget/form/settings/generalform.cpp | 12 +- src/widget/form/settings/generalsettings.ui | 180 +++++++++++--------- 2 files changed, 114 insertions(+), 78 deletions(-) diff --git a/src/widget/form/settings/generalform.cpp b/src/widget/form/settings/generalform.cpp index fc4b5ed20..d1a31a2ec 100644 --- a/src/widget/form/settings/generalform.cpp +++ b/src/widget/form/settings/generalform.cpp @@ -45,18 +45,26 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) : bodyUI->checkUpdates->setVisible(AUTOUPDATE_ENABLED); bodyUI->checkUpdates->setChecked(Settings::getInstance().getCheckUpdates()); - bodyUI->trayLayout->addStretch(); + bodyUI->trayBehavior->addStretch(); bodyUI->cbEnableIPv6->setChecked(Settings::getInstance().getEnableIPv6()); for (int i = 0; i < langs.size(); i++) bodyUI->transComboBox->insertItem(i, langs[i]); + bodyUI->transComboBox->setCurrentIndex(locales.indexOf(Settings::getInstance().getTranslation())); bodyUI->cbMakeToxPortable->setChecked(Settings::getInstance().getMakeToxPortable()); - bodyUI->showSystemTray->setChecked(Settings::getInstance().getShowSystemTray()); + + bool showSystemTray = Settings::getInstance().getShowSystemTray(); + + bodyUI->showSystemTray->setChecked(showSystemTray); bodyUI->startInTray->setChecked(Settings::getInstance().getAutostartInTray()); + bodyUI->startInTray->setEnabled(showSystemTray); bodyUI->closeToTray->setChecked(Settings::getInstance().getCloseToTray()); + bodyUI->closeToTray->setEnabled(showSystemTray); bodyUI->minimizeToTray->setChecked(Settings::getInstance().getMinimizeToTray()); + bodyUI->minimizeToTray->setEnabled(showSystemTray); bodyUI->trayShowsUserStatus->setChecked(Settings::getInstance().getTrayShowsUserStatus()); + bodyUI->trayShowsUserStatus->setEnabled(showSystemTray); bodyUI->statusChanges->setChecked(Settings::getInstance().getStatusChangeNotificationEnabled()); bodyUI->useEmoticons->setChecked(Settings::getInstance().getUseEmoticons()); bodyUI->autoacceptFiles->setChecked(Settings::getInstance().getAutoSaveEnabled()); diff --git a/src/widget/form/settings/generalsettings.ui b/src/widget/form/settings/generalsettings.ui index 0bf981d69..79dc5712f 100644 --- a/src/widget/form/settings/generalsettings.ui +++ b/src/widget/form/settings/generalsettings.ui @@ -39,8 +39,8 @@ 0 0 - 524 - 726 + 509 + 849 @@ -94,66 +94,78 @@ - - - - - Show system tray icon - - - - - - - - 0 - 0 - - - - Start in tray - - - - - - - - 0 - 0 - - - - Close to tray - - - - - - - - 0 - 0 - - - - Minimize to tray - - - - - - - - - - 0 - 0 - - - - Tray icon displays user status + + + System tray integration + + + QFormLayout::AllNonFixedFieldsGrow + + + + + Show system tray icon + + + + + + + + + + 0 + 0 + + + + Start in tray + + + + + + + + 0 + 0 + + + + Close to tray + + + + + + + + 0 + 0 + + + + Minimize to tray + + + + + + + + + + 0 + 0 + + + + Tray icon displays user status + + + + @@ -210,9 +222,6 @@ Set to 0 to disable - - true - minutes @@ -222,6 +231,9 @@ 2147483647 + + true + @@ -551,12 +563,12 @@ setEnabled(bool) - 125 - 122 + 105 + 144 - 207 - 124 + 119 + 177 @@ -567,12 +579,12 @@ setEnabled(bool) - 66 - 119 + 205 + 146 - 346 - 116 + 224 + 178 @@ -583,12 +595,28 @@ setEnabled(bool) - 83 - 121 + 180 + 144 - 476 - 120 + 359 + 178 + + + + + showSystemTray + toggled(bool) + trayShowsUserStatus + setEnabled(bool) + + + 148 + 143 + + + 158 + 205