diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/options-dialog.cpp | 8 | ||||
-rw-r--r-- | gui/options-dialog.hpp | 4 | ||||
-rw-r--r-- | gui/ui.cpp | 2 |
3 files changed, 7 insertions, 7 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(); } diff --git a/gui/options-dialog.hpp b/gui/options-dialog.hpp index eee9d090..6b04aa09 100644 --- a/gui/options-dialog.hpp +++ b/gui/options-dialog.hpp @@ -12,9 +12,9 @@ class OptionsDialog: public QWidget signals: void reload(); public: - OptionsDialog(main_settings& main, std::function<void(bool)> pause_keybindings); + OptionsDialog(std::function<void(bool)> pause_keybindings); private: - main_settings& main; + main_settings main; std::function<void(bool)> pause_keybindings; Ui::UI_Settings ui; void closeEvent(QCloseEvent *) override { doCancel(); } @@ -492,7 +492,7 @@ bool mk_window(mem<t>* place, Args&&... params) void MainWindow::show_options_dialog() { - if (mk_window(&options_widget, s, [&](bool flag) -> void { set_keys_enabled(!flag); })) + if (mk_window(&options_widget, [&](bool flag) -> void { set_keys_enabled(!flag); })) { connect(options_widget.get(), SIGNAL(reload()), this, SLOT(reload_options())); } |