Gui: ensure consistency of "show Tray Icon" and "close to tray" preferences

This commit is contained in:
Jean-Francois Dockes 2018-04-11 08:40:46 +02:00
parent 200979abf9
commit 68e6b9f8d0

View File

@ -138,6 +138,10 @@ void UIPrefsDialog::setFromPrefs()
keepSortCB->setChecked(prefs.keepSort);
showTrayIconCB->setChecked(prefs.showTrayIcon);
if (!prefs.showTrayIcon) {
prefs.closeToTray = false;
}
closeToTrayCB->setEnabled(showTrayIconCB->checkState());
closeToTrayCB->setChecked(prefs.closeToTray);
showTempFileWarningCB->setChecked(prefs.showTempFileWarning == -1);
previewHtmlCB->setChecked(prefs.previewHtml);
@ -574,6 +578,9 @@ static bool samedir(const string& dir1, const string& dir2)
void UIPrefsDialog::on_showTrayIconCB_clicked()
{
if (!showTrayIconCB->checkState()) {
closeToTrayCB->setChecked(false);
}
closeToTrayCB->setEnabled(showTrayIconCB->checkState());
}