From 4d66afd5f872f55612d8d297ed3d251d1b855e03 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Sun, 29 Jan 2017 16:00:04 +0100 Subject: [PATCH] Fix config dialog state --- src/gui/configdialog.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/gui/configdialog.cpp b/src/gui/configdialog.cpp index b073e30..874189a 100644 --- a/src/gui/configdialog.cpp +++ b/src/gui/configdialog.cpp @@ -37,9 +37,7 @@ ConfigDialog::ConfigDialog(QWidget* _parent, Controller* _ctrl) : // hotkeys bool useHotkeys = m_settings->param(UM::CONF::use_hotkeys).toBool(); - ui->hotkeyRefresh->setDisabled(!useHotkeys); - ui->hotkeyShowHide->setDisabled(!useHotkeys); - ui->hotkeyStartPause->setDisabled(!useHotkeys); + on_optionUseHotkeys_toggled(useHotkeys); ui->hotkeyRefresh->setHotkey( m_settings->hotkey(UM::CONF::HOTKEY::refresh)); ui->hotkeyShowHide->setHotkey( m_settings->hotkey(UM::CONF::HOTKEY::showhide)); @@ -95,10 +93,8 @@ ConfigDialog::ConfigDialog(QWidget* _parent, Controller* _ctrl) : // lock boolean lockEnabled = m_settings->param(UM::CONF::lock_enabled).toBool(); - ui->optionLockPassword->setDisabled(!lockEnabled); - ui->currentPassword->setDisabled( !lockEnabled); - ui->optionLockStartup->setDisabled( !lockEnabled); - ui->optionLockMinimize->setDisabled(!lockEnabled); + on_optionLockEnabled_toggled(lockEnabled); + ui->currentPassword->setDisabled(!lockEnabled); ui->optionLockEnabled->setChecked( lockEnabled); ui->optionLockStartup->setChecked( m_settings->param(UM::CONF::lock_startup).toBool()); @@ -302,7 +298,7 @@ void ConfigDialog::on_optionUseHotkeys_toggled(bool _checked) ui->hotkeyShowHide->setDisabled(!_checked); ui->hotkeyStartPause->setDisabled(!_checked); ui->hotkeyDelay->setDisabled(!_checked); - ui->hotkeyLockUnlock->setDisabled(!_checked); + ui->hotkeyLockUnlock->setDisabled(!_checked || !ui->optionLockEnabled->isChecked()); } /** @@ -314,6 +310,7 @@ void ConfigDialog::on_optionLockEnabled_toggled(bool _checked) ui->optionLockPassword->setDisabled(!_checked); ui->optionLockStartup->setDisabled(!_checked); ui->optionLockMinimize->setDisabled(!_checked); + ui->hotkeyLockUnlock->setDisabled(!_checked || !ui->optionUseHotkeys->isChecked()); } /**