From fb691fb6c36b5e21170ba13a5d228e8fcb5e190b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 25 Feb 2017 14:07:55 +0100 Subject: gui/options-dialog: prevent escape key closing on Linux The escape key closed the dialog but prevented save/cancel hooks from being run. Now we get the hooks running twice but it's better than not at all. --- gui/options-dialog.cpp | 7 +++++++ gui/options-dialog.hpp | 1 + 2 files changed, 8 insertions(+) (limited to 'gui') diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp index b1dfc472..42b5cc52 100644 --- a/gui/options-dialog.cpp +++ b/gui/options-dialog.cpp @@ -200,3 +200,10 @@ void OptionsDialog::doCancel() emit closing(); } +void OptionsDialog::done(int res) +{ + if (res == QDialog::Accepted) + doOK(); + else + doCancel(); +} diff --git a/gui/options-dialog.hpp b/gui/options-dialog.hpp index 8c62b278..e9359b6d 100644 --- a/gui/options-dialog.hpp +++ b/gui/options-dialog.hpp @@ -23,6 +23,7 @@ private: private slots: void doOK(); void doCancel(); + void done(int res) override; void bind_key(key_opts &kopts, QLabel* label); void set_disable_translation_state(bool value); }; -- cgit v1.2.3