mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:46:03 +00:00
UI: Options: Fix closing after only startup-mode saved.
This commit is contained in:
parent
390950efdc
commit
1214581e67
@ -107,19 +107,19 @@ void OptionsController::save(bool closeOnSuccess)
|
||||
{
|
||||
emit aboutToSave();
|
||||
|
||||
if (!conf()->anyEdited()) {
|
||||
const bool isAnyEdited = conf()->anyEdited();
|
||||
if (isAnyEdited) {
|
||||
if (!confManager()->saveConf(*conf()))
|
||||
return;
|
||||
|
||||
confManager()->applySavedConf(conf());
|
||||
} else {
|
||||
emitEdited(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!confManager()->saveConf(*conf()))
|
||||
return;
|
||||
|
||||
confManager()->applySavedConf(conf());
|
||||
|
||||
if (closeOnSuccess) {
|
||||
closeWindow();
|
||||
} else {
|
||||
} else if (isAnyEdited) {
|
||||
confManager()->initConfToEdit();
|
||||
resetEdited();
|
||||
}
|
||||
|
@ -222,8 +222,11 @@ QLayout *OptionsPage::setupStartModeLayout()
|
||||
{
|
||||
m_labelStartMode = ControlUtil::createLabel();
|
||||
|
||||
m_comboStartMode = ControlUtil::createComboBox(
|
||||
QStringList(), [&](int /*index*/) { ctrl()->emitEdited(); });
|
||||
m_comboStartMode = ControlUtil::createComboBox(QStringList(), [&](int index) {
|
||||
if (m_currentStartupMode != index) {
|
||||
ctrl()->emitEdited();
|
||||
}
|
||||
});
|
||||
m_comboStartMode->setFixedWidth(200);
|
||||
|
||||
return ControlUtil::createRowLayout(m_labelStartMode, m_comboStartMode);
|
||||
|
Loading…
Reference in New Issue
Block a user