Skip to content

Commit 1d6ee23

Browse files
committed
Preserve pending settings when reopening or exiting
Reload configuration only when creating the Settings dialog. Flush deferred changes before normal application shutdown.
1 parent 7790c8b commit 1d6ee23

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/alertwindow.cpp‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,13 +348,11 @@ void AlertWindow::animateToContentHeight() {
348348
}
349349

350350
void AlertWindow::showSettings() {
351-
m_config->reloadFromDiskPreservingWindowPosition();
352-
353351
if (!m_settingsDialog) {
352+
m_config->reloadFromDiskPreservingWindowPosition();
354353
m_settingsDialog = new SettingsDialog(m_config, this);
355354
m_settingsDialog->setAttribute(Qt::WA_DeleteOnClose, true);
356355
}
357-
m_settingsDialog->refreshFromConfig();
358356
m_settingsDialog->show();
359357
m_settingsDialog->raise();
360358
m_settingsDialog->activateWindow();

‎src/main.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ int main(int argc, char **argv) {
4646
parser.process(app);
4747

4848
Configuration config;
49+
QObject::connect(&app, &QCoreApplication::aboutToQuit,
50+
&config, &Configuration::endDeferredSave);
4951
ProcessMonitor monitor;
5052
monitor.setIntervalMs(parser.isSet(intervalOpt) ? parser.value(intervalOpt).toInt() : config.refreshInterval());
5153
monitor.setTreeThresholdPercent(parser.isSet(thresholdOpt) ? parser.value(thresholdOpt).toDouble() : config.treeThresholdPercent());

0 commit comments

Comments
 (0)