summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/shortcut-dialog.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-12-06 18:49:54 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-12-06 18:49:54 +0100
commit58f7f332bcae5bbb13d6ef0c6ec351c53a39852e (patch)
tree12f39ef1b4247b048939cf20ecd49fb095a8e923 /facetracknoir/shortcut-dialog.cpp
parent0f67a9e324bd2d4def5fa3e27ff0e0d4e5115a58 (diff)
move shortcut dialog to ui module
Diffstat (limited to 'facetracknoir/shortcut-dialog.cpp')
-rw-r--r--facetracknoir/shortcut-dialog.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/facetracknoir/shortcut-dialog.cpp b/facetracknoir/shortcut-dialog.cpp
new file mode 100644
index 00000000..f2934c15
--- /dev/null
+++ b/facetracknoir/shortcut-dialog.cpp
@@ -0,0 +1,43 @@
+#include "shortcut-dialog.hpp"
+
+KeyboardShortcutDialog::KeyboardShortcutDialog()
+{
+ ui.setupUi( this );
+
+ connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
+ connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));
+
+ for ( int i = 0; i < global_key_sequences.size(); i++) {
+ ui.cbxCenterKey->addItem(global_key_sequences.at(i));
+ ui.cbxToggleKey->addItem(global_key_sequences.at(i));
+ ui.cbxZeroKey->addItem(global_key_sequences.at(i));
+ }
+
+ tie_setting(s.center.key_index, ui.cbxCenterKey);
+ tie_setting(s.center.alt, ui.chkCenterAlt);
+ tie_setting(s.center.shift, ui.chkCenterShift);
+ tie_setting(s.center.ctrl, ui.chkCenterCtrl);
+
+ tie_setting(s.toggle.key_index, ui.cbxToggleKey);
+ tie_setting(s.toggle.alt, ui.chkToggleAlt);
+ tie_setting(s.toggle.shift, ui.chkToggleShift);
+ tie_setting(s.toggle.ctrl, ui.chkToggleCtrl);
+
+ tie_setting(s.zero.key_index, ui.cbxZeroKey);
+ tie_setting(s.zero.alt, ui.chkZeroAlt);
+ tie_setting(s.zero.shift, ui.chkZeroShift);
+ tie_setting(s.zero.ctrl, ui.chkZeroCtrl);
+
+ tie_setting(s.s_main.tray_enabled, ui.trayp);
+}
+
+void KeyboardShortcutDialog::doOK() {
+ s.b->save();
+ this->close();
+ emit reload();
+}
+
+void KeyboardShortcutDialog::doCancel() {
+ s.b->reload();
+ close();
+}