From 87622615e5adc5b96f404b3255aa6af5a90043ee Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 29 Jun 2016 10:09:42 +0200 Subject: gui/options: fix cancel button The "struct opts" dtor doesn't run at dialog close time so invoke "reload" on the bundle explicitly. --- gui/options-dialog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gui/options-dialog.cpp') diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp index 49df4309..212c6078 100644 --- a/gui/options-dialog.cpp +++ b/gui/options-dialog.cpp @@ -29,9 +29,7 @@ static QString kopts_to_string(const key_opts& kopts) return kopts.keycode; } -OptionsDialog::OptionsDialog(main_settings& main, - std::function pause_keybindings) : - main(main), +OptionsDialog::OptionsDialog(std::function pause_keybindings) : pause_keybindings(pause_keybindings) { ui.setupUi(this); @@ -133,7 +131,8 @@ void OptionsDialog::bind_key(key_opts& kopts, QLabel* label) delete l; } -void OptionsDialog::doOK() { +void OptionsDialog::doOK() +{ main.b->save(); ui.game_detector->save(); close(); @@ -142,6 +141,7 @@ void OptionsDialog::doOK() { void OptionsDialog::doCancel() { + main.b->reload(); ui.game_detector->revert(); close(); } -- cgit v1.2.3