Skip to content

Commit

Permalink
Fix config dialog state
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 committed Jan 29, 2017
1 parent 2683e15 commit 4d66afd
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/gui/configdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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());
}

/**
Expand All @@ -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());
}

/**
Expand Down

0 comments on commit 4d66afd

Please sign in to comment.