summaryrefslogtreecommitdiffhomepage
path: root/opentrack
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 /opentrack
parent0f67a9e324bd2d4def5fa3e27ff0e0d4e5115a58 (diff)
move shortcut dialog to ui module
Diffstat (limited to 'opentrack')
-rw-r--r--opentrack/keyboard.ui300
-rw-r--r--opentrack/shortcuts.cpp41
-rw-r--r--opentrack/shortcuts.h16
3 files changed, 1 insertions, 356 deletions
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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>UICKeyboardShortcutDialog</class>
- <widget class="QWidget" name="UICKeyboardShortcutDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>461</width>
- <height>174</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="windowTitle">
- <string>Keyboard shortcuts</string>
- </property>
- <property name="windowIcon">
- <iconset>
- <normaloff>images/facetracknoir.png</normaloff>images/facetracknoir.png</iconset>
- </property>
- <property name="layoutDirection">
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="autoFillBackground">
- <bool>false</bool>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QFrame" name="frame">
- <property name="frameShape">
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Plain</enum>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="3" column="0">
- <widget class="QLabel" name="textLabel2_6">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Zero</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="3" column="3">
- <widget class="QCheckBox" name="chkZeroAlt">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Alt</string>
- </property>
- </widget>
- </item>
- <item row="3" column="2">
- <widget class="QCheckBox" name="chkZeroCtrl">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Ctrl</string>
- </property>
- </widget>
- </item>
- <item row="0" column="5">
- <widget class="QLabel" name="textLabel2_4">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Keyboard</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignCenter</set>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="textLabel2_3">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Center</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QCheckBox" name="chkCenterShift">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Shift</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QCheckBox" name="chkCenterCtrl">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Ctrl</string>
- </property>
- </widget>
- </item>
- <item row="2" column="3">
- <widget class="QCheckBox" name="chkToggleAlt">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Alt</string>
- </property>
- </widget>
- </item>
- <item row="2" column="5">
- <widget class="QComboBox" name="cbxToggleKey">
- <property name="minimumSize">
- <size>
- <width>90</width>
- <height>0</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Select Number</string>
- </property>
- <property name="insertPolicy">
- <enum>QComboBox::InsertAlphabetically</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <widget class="QCheckBox" name="chkCenterAlt">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Alt</string>
- </property>
- </widget>
- </item>
- <item row="1" column="5">
- <widget class="QComboBox" name="cbxCenterKey">
- <property name="minimumSize">
- <size>
- <width>90</width>
- <height>0</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Select Number</string>
- </property>
- <property name="insertPolicy">
- <enum>QComboBox::InsertAlphabetically</enum>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="textLabel2_5">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Toggle</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QCheckBox" name="chkToggleShift">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Shift</string>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QCheckBox" name="chkToggleCtrl">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Ctrl</string>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QCheckBox" name="chkZeroShift">
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Shift</string>
- </property>
- </widget>
- </item>
- <item row="3" column="5">
- <widget class="QComboBox" name="cbxZeroKey">
- <property name="minimumSize">
- <size>
- <width>90</width>
- <height>0</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Select Number</string>
- </property>
- <property name="insertPolicy">
- <enum>QComboBox::InsertAlphabetically</enum>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="trayp">
- <property name="text">
- <string>Minimize to tray</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
- <slots>
- <slot>startEngineClicked()</slot>
- <slot>stopEngineClicked()</slot>
- <slot>cameraSettingsClicked()</slot>
- </slots>
-</ui>
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 <QMutexLocker>
-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 <windows.h>
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();
-};
+