From 58f7f332bcae5bbb13d6ef0c6ec351c53a39852e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 6 Dec 2014 18:49:54 +0100 Subject: move shortcut dialog to ui module --- opentrack/keyboard.ui | 300 ------------------------------------------------ opentrack/shortcuts.cpp | 41 ------- opentrack/shortcuts.h | 16 +-- 3 files changed, 1 insertion(+), 356 deletions(-) delete mode 100644 opentrack/keyboard.ui (limited to 'opentrack') diff --git a/opentrack/keyboard.ui b/opentrack/keyboard.ui deleted file mode 100644 index 903bb20f..00000000 --- a/opentrack/keyboard.ui +++ /dev/null @@ -1,300 +0,0 @@ - - - UICKeyboardShortcutDialog - - - - 0 - 0 - 461 - 174 - - - - - 0 - 0 - - - - Keyboard shortcuts - - - - images/facetracknoir.pngimages/facetracknoir.png - - - Qt::LeftToRight - - - false - - - - - - QFrame::StyledPanel - - - QFrame::Plain - - - - - - - 0 - 0 - - - - Zero - - - false - - - - - - - - 50 - 16777215 - - - - Alt - - - - - - - - 50 - 16777215 - - - - Ctrl - - - - - - - - 0 - 0 - - - - Keyboard - - - Qt::AlignCenter - - - false - - - - - - - - 0 - 0 - - - - Center - - - false - - - - - - - - 50 - 16777215 - - - - Shift - - - - - - - - 50 - 16777215 - - - - Ctrl - - - - - - - - 50 - 16777215 - - - - Alt - - - - - - - - 90 - 0 - - - - Select Number - - - QComboBox::InsertAlphabetically - - - - - - - - 50 - 16777215 - - - - Alt - - - - - - - - 90 - 0 - - - - Select Number - - - QComboBox::InsertAlphabetically - - - - - - - - 0 - 0 - - - - Toggle - - - false - - - - - - - - 50 - 16777215 - - - - Shift - - - - - - - - 50 - 16777215 - - - - Ctrl - - - - - - - - 50 - 16777215 - - - - Shift - - - - - - - - 90 - 0 - - - - Select Number - - - QComboBox::InsertAlphabetically - - - - - - - - - - Minimize to tray - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - startEngineClicked() - stopEngineClicked() - cameraSettingsClicked() - - diff --git a/opentrack/shortcuts.cpp b/opentrack/shortcuts.cpp index c9e9ce41..e81b6bb0 100644 --- a/opentrack/shortcuts.cpp +++ b/opentrack/shortcuts.cpp @@ -1,47 +1,6 @@ #include "shortcuts.h" #include -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(); -} #if defined(_WIN32) #include diff --git a/opentrack/shortcuts.h b/opentrack/shortcuts.h index 7f5f9f1f..6989ea29 100644 --- a/opentrack/shortcuts.h +++ b/opentrack/shortcuts.h @@ -13,7 +13,6 @@ #include "opentrack/plugin-support.h" #include "opentrack/options.hpp" #include "opentrack/main-settings.hpp" -#include "ui_keyboard.h" using namespace options; @@ -129,17 +128,4 @@ signals: void zero(); }; -class KeyboardShortcutDialog: public QWidget -{ - Q_OBJECT -signals: - void reload(); -public: - KeyboardShortcutDialog(); -private: - Ui::UICKeyboardShortcutDialog ui; - Shortcuts::settings s; -private slots: - void doOK(); - void doCancel(); -}; + -- cgit v1.2.3