summaryrefslogtreecommitdiffhomepage
path: root/gui/options-dialog.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-06-29 10:09:42 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-06-29 13:18:22 +0200
commit87622615e5adc5b96f404b3255aa6af5a90043ee (patch)
tree9231116ead1dd109b2700422b1ca640a9a3dbed9 /gui/options-dialog.cpp
parent68e5a04f438fafd984ac0bf0424fa75294a8dc06 (diff)
gui/options: fix cancel button
The "struct opts" dtor doesn't run at dialog close time so invoke "reload" on the bundle explicitly.
Diffstat (limited to 'gui/options-dialog.cpp')
-rw-r--r--gui/options-dialog.cpp8
1 files changed, 4 insertions, 4 deletions
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<void(bool)> pause_keybindings) :
- main(main),
+OptionsDialog::OptionsDialog(std::function<void(bool)> 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();
}