summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-02-25 14:07:55 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-02-25 14:19:59 +0100
commitfb691fb6c36b5e21170ba13a5d228e8fcb5e190b (patch)
treec29625a2746ea736841a85cd2bee29118609f846
parent35a00c84e56749aab323bfb664cbaeccc984c168 (diff)
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.
-rw-r--r--gui/options-dialog.cpp7
-rw-r--r--gui/options-dialog.hpp1
2 files changed, 8 insertions, 0 deletions
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);
};