diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/CMakeLists.txt | 22 | ||||
-rw-r--r-- | gui/correlation-calibrator.ui | 4 | ||||
-rw-r--r-- | gui/images/english.png | bin | 283 -> 259 bytes | |||
-rw-r--r-- | gui/images/settings16.png | bin | 711 -> 1136 bytes | |||
-rw-r--r-- | gui/init.cpp | 301 | ||||
-rw-r--r-- | gui/init.hpp | 5 | ||||
-rw-r--r-- | gui/keyboard.cpp | 53 | ||||
-rw-r--r-- | gui/keyboard.h | 16 | ||||
-rw-r--r-- | gui/lang/de_DE.ts | 428 | ||||
-rw-r--r-- | gui/lang/nl_NL.ts | 118 | ||||
-rw-r--r-- | gui/lang/ru_RU.ts | 125 | ||||
-rw-r--r-- | gui/lang/stub.ts | 124 | ||||
-rw-r--r-- | gui/lang/zh_CN.ts | 269 | ||||
-rw-r--r-- | gui/mapping-dialog.cpp | 86 | ||||
-rw-r--r-- | gui/mapping-dialog.hpp | 5 | ||||
-rw-r--r-- | gui/mapping-dialog.ui | 105 | ||||
-rw-r--r-- | gui/options-dialog.cpp (renamed from gui/settings.cpp) | 253 | ||||
-rw-r--r-- | gui/options-dialog.hpp | 57 | ||||
-rw-r--r-- | gui/options-dialog.ui | 2364 | ||||
-rw-r--r-- | gui/process_detector.cpp | 100 | ||||
-rw-r--r-- | gui/process_detector.h | 28 | ||||
-rw-r--r-- | gui/process_widget.ui | 13 | ||||
-rw-r--r-- | gui/settings-dialog.ui | 2202 | ||||
-rw-r--r-- | gui/settings.hpp | 31 |
24 files changed, 4036 insertions, 2673 deletions
diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 954fa67a..8c57221a 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -1,21 +1,25 @@ otr_module(user-interface BIN) -target_link_libraries(opentrack-user-interface +target_link_libraries(${self} opentrack-migration opentrack-logic opentrack-spline opentrack-pose-widget - opentrack-version ) +# for process detector if(APPLE) - # for process detector - target_link_libraries(opentrack-user-interface proc) + target_link_libraries(${self} proc) +elseif(LINUX) + otr_pkgconfig_(has-libproc2 ${self} libproc2) + if(has-libproc2) + target_compile_definitions(${self} PRIVATE -DOTR_HAS_LIBPROC2) + else() + otr_pkgconfig(${self} libprocps) + endif() endif() -if(LINUX) - target_link_libraries(opentrack-user-interface dl) - # for process detector - target_link_libraries(opentrack-user-interface procps) +if(NOT APPLE AND NOT WIN32) + target_compile_definitions(${self} PRIVATE -DOTR_X11_THREADS) + otr_pkgconfig(${self} x11) endif() - diff --git a/gui/correlation-calibrator.ui b/gui/correlation-calibrator.ui index 0c33d8b4..02fdf1d2 100644 --- a/gui/correlation-calibrator.ui +++ b/gui/correlation-calibrator.ui @@ -11,7 +11,7 @@ </rect> </property> <property name="windowTitle"> - <string>Form</string> + <string notr="true">correlation-calibrator</string> </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> @@ -40,7 +40,7 @@ Press "clear calibration" to remove any calibration data pertaining to <enum>Qt::ScrollBarAlwaysOff</enum> </property> <property name="sizeAdjustPolicy"> - <enum>QAbstractScrollArea::AdjustToContentsOnFirstShow</enum> + <enum>QAbstractScrollArea::AdjustToContents</enum> </property> <property name="autoScroll"> <bool>true</bool> diff --git a/gui/images/english.png b/gui/images/english.png Binary files differindex 187aabf9..87d9f7d7 100644 --- a/gui/images/english.png +++ b/gui/images/english.png diff --git a/gui/images/settings16.png b/gui/images/settings16.png Binary files differindex 3b31623b..fa2e4a11 100644 --- a/gui/images/settings16.png +++ b/gui/images/settings16.png diff --git a/gui/init.cpp b/gui/init.cpp index 42c33c2f..b666b4a9 100644 --- a/gui/init.cpp +++ b/gui/init.cpp @@ -1,5 +1,3 @@ -#include "init.hpp" - /* Copyright (c) 2013-2017 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any @@ -7,14 +5,12 @@ * copyright notice and this permission notice appear in all copies. */ -#if defined(Q_CREATOR_RUN) -# pragma clang diagnostic ignored "-Wmain" -#endif - +#include "init.hpp" #include "migration/migration.hpp" #include "options/options.hpp" using namespace options; #include "compat/library-path.hpp" +#include "compat/arch.hpp" #include <memory> #include <cstdlib> @@ -25,132 +21,240 @@ using namespace options; #include <QStyleFactory> #include <QLocale> #include <QTranslator> -#include <QApplication> #include <QDir> #include <QFile> #include <QFileDialog> #include <QString> -#include <QSysInfo> +#include <QOperatingSystemVersion> +#include <QMutex> #include <QDebug> -#if /* denormal control */ \ - /* GNU */ defined __x86_64__ || defined __SSE2__ || \ - /* MSVC */ defined _M_AMD64 || (defined _M_IX86_FP && _M_IX86_FP >= 2) -# include <xmmintrin.h> -# include <pmmintrin.h> -# include <cfloat> +#include <cfloat> +#include <cfenv> -#define OTR_HAS_DENORM_CONTROL -void set_fp_mask() +#ifdef __MINGW32__ +extern "C" __declspec(dllimport) unsigned __cdecl _controlfp(unsigned, unsigned); +#endif + +static void set_fp_mask() { - _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); +#if defined OTR_ARCH_DENORM_DAZ _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON); - _MM_SET_ROUNDING_MODE(_MM_ROUND_NEAREST); +#elif defined OTR_ARCH_DENORM_FTZ + _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); +#endif + +#ifdef OTR_ARCH_FPU_MASK _MM_SET_EXCEPTION_MASK(_MM_MASK_MASK); -} #endif -void set_qt_style() +#ifdef __APPLE__ +#if defined __i386__ || defined __x86_64__ + fesetenv(FE_DFL_DISABLE_SSE_DENORMS_ENV); +#endif +#endif + +#ifdef _WIN32 +# ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wreserved-id-macro" +# endif +# ifndef _DN_FLUSH +# define _DN_FLUSH 0x01000000 +# endif +# ifndef _MCW_DN +# define _MCW_DN 0x03000000 +# endif +# ifdef __clang__ +# pragma clang diagnostic pop +# endif + _controlfp(_DN_FLUSH, _MCW_DN); +#endif +} + +#ifdef OTR_X11_THREADS +#include <X11/Xlib.h> +static void enable_x11_threads() { -#if defined _WIN32 - if (QSysInfo::WindowsVersion == QSysInfo::WV_XP) - return; + (void)XInitThreads(); +} #endif +static void set_qt_style() +{ #if defined _WIN32 || defined __APPLE__ // our layouts on OSX make some control wrongly sized -sh 20160908 { - const char* const preferred[] { "fusion", "windowsvista", "macintosh" }; + const char* const preferred[] { +#ifdef __APPLE__ + "macintosh", "fusion", "windowsvista", "windows", +#else + "fusion", "windowsvista", "windows", "windowsxp", +#endif + }; for (const char* style_name : preferred) - { - QStyle* s = QStyleFactory::create(style_name); - if (s) + if (QStyle* s = QStyleFactory::create(style_name); s != nullptr) { QApplication::setStyle(s); break; } - } } #endif } +#include <string> + #ifdef _WIN32 +# include <windows.h> +# include <malloc.h> +#else +# include <alloca.h> +#endif -void qdebug_to_console(QtMsgType, const QMessageLogContext& ctx, const QString &msg) +static void qdebug_to_console(QtMsgType loglevel, const QMessageLogContext& ctx, const QString &msg) { - const unsigned short* const str_ = msg.utf16(); - auto str = reinterpret_cast<const wchar_t* const>(str_); - static_assert(sizeof(*str_) == sizeof(*str), ""); - - std::fflush(stderr); - if (ctx.function) - std::fprintf(stderr, "[%s:%d%s]: %ls\n", ctx.file, ctx.line, ctx.function, str); - else if (ctx.file) - std::fprintf(stderr, "[%s:%d]: %ls\n", ctx.file, ctx.line, str); + const char* level; + + switch (loglevel) + { + default: + case QtDebugMsg: level = "DEBUG"; break; + case QtWarningMsg: level = "WARN"; break; + case QtCriticalMsg: level = "CRIT"; break; + case QtFatalMsg: level = "FATAL"; break; + case QtInfoMsg: level = "INFO"; break; + } + +#ifdef _WIN32 + static_assert(sizeof(wchar_t) == sizeof(decltype(*msg.utf16()))); + + if (IsDebuggerPresent()) + { + static QMutex lock; + QMutexLocker l(&lock); + + const wchar_t* const bytes = (const wchar_t*)msg.utf16(); + + OutputDebugStringW(bytes); + OutputDebugStringW(L"\n"); + } else - std::fprintf(stderr, "%ls\n", str); - std::fflush(stderr); +#endif + { +#if defined _WIN32 + const wchar_t* const bytes = (const wchar_t*)msg.utf16(); +#else + unsigned len = (unsigned)msg.size()+1; + wchar_t* const bytes = (wchar_t*)alloca(len * sizeof(wchar_t)); + bytes[len-1] = 0; + (void)msg.toWCharArray(bytes); +#endif + if (ctx.file) + std::fprintf(stderr, "%s [%s:%d]: %ls\n", level, ctx.file, ctx.line, bytes); + else + std::fprintf(stderr, "%s %ls\n", level, bytes); + std::fflush(stderr); + } } -void add_win32_path() +#ifdef _WIN32 + +static void apply_dark_windows_theme_if_needed() { - // see https://software.intel.com/en-us/articles/limitation-to-the-length-of-the-system-path-variable - static char env_path[4096] { '\0', }; + // On Windows apply dark theme if requested by user settings + QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", QSettings::NativeFormat); + if (settings.value("AppsUseLightTheme") == 0) { + qApp->setStyle(QStyleFactory::create("Dark")); + QPalette darkPalette; + QColor darkColor = QColor(45, 45, 45); + QColor disabledColor = QColor(127, 127, 127); + darkPalette.setColor(QPalette::Window, darkColor); + darkPalette.setColor(QPalette::WindowText, Qt::white); + darkPalette.setColor(QPalette::Base, QColor(18, 18, 18)); + darkPalette.setColor(QPalette::AlternateBase, darkColor); + darkPalette.setColor(QPalette::ToolTipBase, Qt::white); + darkPalette.setColor(QPalette::ToolTipText, Qt::white); + darkPalette.setColor(QPalette::Text, Qt::white); + darkPalette.setColor(QPalette::Disabled, QPalette::Text, disabledColor); + darkPalette.setColor(QPalette::Button, darkColor); + darkPalette.setColor(QPalette::ButtonText, Qt::white); + darkPalette.setColor(QPalette::Disabled, QPalette::ButtonText, disabledColor); + darkPalette.setColor(QPalette::BrightText, Qt::red); + darkPalette.setColor(QPalette::Link, QColor(42, 130, 218)); + + darkPalette.setColor(QPalette::Highlight, QColor(42, 130, 218)); + darkPalette.setColor(QPalette::HighlightedText, Qt::black); + darkPalette.setColor(QPalette::Disabled, QPalette::HighlightedText, disabledColor); + + qApp->setPalette(darkPalette); + + qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }"); + } +} + +static void add_win32_path() +{ + // see https://web.archive.org/web/20180924055536/https://software.intel.com/en-us/articles/limitation-to-the-length-of-the-system-path-variable { QString lib_path = OPENTRACK_BASE_PATH; lib_path.replace("/", "\\"); - const QByteArray lib_path_ = QFile::encodeName(lib_path); - QString mod_path = OPENTRACK_BASE_PATH + OPENTRACK_LIBRARY_PATH; mod_path.replace("/", "\\"); - const QByteArray mod_path_ = QFile::encodeName(mod_path); - - const char* contents[] { - "PATH=", - lib_path_.constData(), - ";", - mod_path_.constData(), - ";", - getenv("PATH"), - }; - bool ok = true; + const QString orig_path = qgetenv("PATH"); - for (const char* ptr : contents) - { - if (ptr) - strcat_s(env_path, sizeof(env_path), ptr); + QString env_path; env_path.reserve(4096); - if (!ptr || ptr[0] == '\0' || env_path[0] == '\0') - { - qDebug() << "bad path element" - << (ptr == nullptr ? "<null>" : ptr); - ok = false; - break; - } - } +#if 0 + qDebug() << "orig" << orig_path; + qDebug() << "libpath" << lib_path; + qDebug() << "modpath" << mod_path; +#endif - if (ok) + if (lib_path.isEmpty()) + qDebug() << "env: empty lib_path!"; + else { - const int error = _putenv(env_path); - - if (error) - qDebug() << "can't _putenv win32 path"; + if (!QFile(lib_path).exists()) + qDebug() << "env: lib_path doesn't exist, this shouldn't happen!"; + env_path += lib_path; + env_path += ';'; } + if (mod_path.isEmpty()) + qDebug() << "env: can't add mod_path to env PATH"; else - qDebug() << "can't set win32 path"; + { + if (!QFile(mod_path).exists()) + qDebug() << "env: mod_path doesn't exist, did you install it correctly?"; + env_path += mod_path; + env_path += ';'; + } + + if (orig_path.isEmpty()) + qDebug() << "env: empty PATH"; + else + env_path += orig_path; + +#if 0 + qDebug() << "data" << env_path.constData(); +#endif + + // better length limit than putenv() and SetEnvironmentVariableA + bool ret = SetEnvironmentVariableW(L"PATH", (const wchar_t*)env_path.constData()); + + if (!ret) + qDebug() << "_putenv() failed with" << (void*)GetLastError(); } } -#include <windows.h> - -void attach_parent_console() +static void attach_parent_console() { - std::fflush(stdin); - std::fflush(stderr); + if (GetConsoleWindow() != nullptr) + return; - (void)qInstallMessageHandler(qdebug_to_console); + fflush(stdin); + fflush(stderr); if (AttachConsole(ATTACH_PARENT_PROCESS)) { @@ -159,7 +263,7 @@ void attach_parent_console() _wfreopen(L"CON", L"r", stdin); freopen("CON", "w", stdout); freopen("CON", "w", stderr); - freopen("CON", "w", stderr); + freopen("CON", "r", stdin); // skip prompt in cmd.exe window fprintf(stderr, "\n"); @@ -169,35 +273,47 @@ void attach_parent_console() #endif -int run_window(QApplication& app, std::unique_ptr<QWidget> main_window) +static int run_window(std::unique_ptr<QWidget> main_window) { if (!main_window->isEnabled()) { - qDebug() << "exit before window created"; + qDebug() << "opentrack: exit before window created"; return 2; } - app.setQuitOnLastWindowClosed(true); - int status = app.exec(); + QApplication::setQuitOnLastWindowClosed(true); + int status = QApplication::exec(); return status; } -int otr_main(int argc, char** argv, std::function<QWidget*()> make_main_window) +int otr_main(int argc, char** argv, std::function<std::unique_ptr<QWidget>()> const& make_main_window) { -#if defined OTR_HAS_DENORM_CONTROL +#ifdef _WIN32 + (void)setvbuf(stderr, nullptr, _IONBF, 0); +#else + (void)setvbuf(stderr, nullptr, _IOLBF, 256); +#endif + set_fp_mask(); + +#ifdef OTR_X11_THREADS + enable_x11_threads(); #endif QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - QCoreApplication::setAttribute(Qt::AA_X11InitThreads, true); + QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QApplication app(argc, argv); #ifdef _WIN32 - add_win32_path(); attach_parent_console(); #endif + (void)qInstallMessageHandler(qdebug_to_console); +#ifdef _WIN32 + apply_dark_windows_theme_if_needed(); + add_win32_path(); +#endif QDir::setCurrent(OPENTRACK_BASE_PATH); @@ -213,7 +329,9 @@ int otr_main(int argc, char** argv, std::function<QWidget*()> make_main_window) qDebug() << "locale:" << forced_locale; } - const bool no_i18n = group::with_global_settings_object([](QSettings& s) { + using namespace options::globals; + + const bool no_i18n = with_global_settings_object([](QSettings& s) { return s.value("disable-translation", false).toBool(); }); @@ -224,7 +342,7 @@ int otr_main(int argc, char** argv, std::function<QWidget*()> make_main_window) } } - int ret = run_window(app, std::unique_ptr<QWidget>(make_main_window())); + int ret = run_window(make_main_window()); #if 0 // msvc crashes in Qt plugin system's dtor @@ -236,4 +354,3 @@ int otr_main(int argc, char** argv, std::function<QWidget*()> make_main_window) return ret; } - diff --git a/gui/init.hpp b/gui/init.hpp index 1142ff24..28ff55c7 100644 --- a/gui/init.hpp +++ b/gui/init.hpp @@ -3,11 +3,10 @@ #include "export.hpp" #include <functional> +#include <memory> #include <QWidget> -int OTR_GUI_EXPORT otr_main(int argc, char** argv, std::function<QWidget*()> make_main_window); - -// XXX TODO need split MainWindow into mixins each implementing part of the functionality +OTR_GUI_EXPORT int otr_main(int argc, char** argv, std::function<std::unique_ptr<QWidget>()> const& make_main_window); template<typename F> auto run_application(int argc, char** argv, F&& fun) diff --git a/gui/keyboard.cpp b/gui/keyboard.cpp index 4987d9c0..90849bab 100644 --- a/gui/keyboard.cpp +++ b/gui/keyboard.cpp @@ -1,32 +1,43 @@ +#undef NDEBUG +#include <cassert> + #include "keyboard.h" #include <QDebug> -keyboard_listener::keyboard_listener(QWidget* parent) : - QDialog(parent) -#if defined _WIN32 - , token([this](const Key& k) { - if(k.guid != "") - { - int mods = 0; - if (k.alt) mods |= Qt::AltModifier; - if (k.shift) mods |= Qt::ShiftModifier; - if (k.ctrl) mods |= Qt::ControlModifier; - joystick_button_pressed(k.guid, k.keycode | mods, k.held); - } - else - { - Qt::KeyboardModifiers m; - QKeySequence k_; - if (win_key::to_qt(k, k_, m)) - key_pressed(static_cast<QVariant>(k_).toInt() | m); - } - }) -// token initializer ends, real ctor body begins +#ifdef _WIN32 + +void keyboard_listener::receive_key(const Key& k) +{ + if(!k.guid.isEmpty()) + { + int mods = 0; + if (k.alt) mods |= Qt::AltModifier; + if (k.shift) mods |= Qt::ShiftModifier; + if (k.ctrl) mods |= Qt::ControlModifier; + + emit joystick_button_pressed(k.guid, k.keycode | mods, k.held); + } + else + { + Qt::KeyboardModifiers m; + QKeySequence k_; + + if (win_key::to_qt(k, k_, m)) + for (unsigned i = 0; i < (unsigned)k_.count(); i++) + emit key_pressed(QKeySequence(int(m) | k_[i])); + } +} + #endif + +keyboard_listener::keyboard_listener(QWidget* parent) : QDialog(parent) { ui.setupUi(this); setFocusPolicy(Qt::StrongFocus); +#ifdef _WIN32 + (void)token; +#endif } #if !defined _WIN32 diff --git a/gui/keyboard.h b/gui/keyboard.h index c17a7bad..ea35d372 100644 --- a/gui/keyboard.h +++ b/gui/keyboard.h @@ -17,20 +17,24 @@ #include "ui_keyboard_listener.h" #include <QDialog> -#include <QKeyEvent> +#include <QtEvents> class OTR_GUI_EXPORT keyboard_listener : public QDialog { Q_OBJECT - Ui_keyboard_listener ui; + #ifdef _WIN32 - KeybindingWorker::Token token; + void receive_key(const Key& k); + + KeybindingWorker::Token token{[this](const Key& k) {receive_key(k);}}; +#else + void keyPressEvent(QKeyEvent* event) override; #endif + + Ui_keyboard_listener ui; + public: keyboard_listener(QWidget* parent = nullptr); -#ifndef _WIN32 - void keyPressEvent(QKeyEvent* event) override; -#endif signals: void key_pressed(QKeySequence k); void joystick_button_pressed(QString guid, int idx, bool held); diff --git a/gui/lang/de_DE.ts b/gui/lang/de_DE.ts new file mode 100644 index 00000000..8d2dbcae --- /dev/null +++ b/gui/lang/de_DE.ts @@ -0,0 +1,428 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1" language="de_DE"> +<context> + <name>BrowseButton</name> + <message> + <source>Set executable name</source> + <translation>Namen der ausführbaren Datei setzen</translation> + </message> + <message> + <source>Executable (*.exe);;All Files (*)</source> + <translation>Ausführbare Dateien (*.exe);;Alle Dateien (*)</translation> + </message> +</context> +<context> + <name>Form</name> + <message> + <source>Press "calibrate" in given row to calibrate that axis. Follow instructions in the next window. +Press "clear calibration" to remove any calibration data pertaining to that axis of position change or rotation.</source> + <translation>Klicke „Kalibrieren“ in den angegebenen Zeilen, um die jeweilige Achse zu kalibieren. Folge den Anweisungen im nächsten Fenster. +Klicke „Kalibrierung löschen“, um jegliche Kalibrierungsdaten der zugehörigen Positions- oder Rotationsachse zu löschen.</translation> + </message> + <message> + <source>X</source> + <translation>X</translation> + </message> + <message> + <source>Y</source> + <translation>Y</translation> + </message> + <message> + <source>Z</source> + <translation>Z</translation> + </message> + <message> + <source>Yaw</source> + <translation>Gieren</translation> + </message> + <message> + <source>Pitch</source> + <translation>Nicken</translation> + </message> + <message> + <source>Roll</source> + <translation>Rollen</translation> + </message> + <message> + <source>Calibrate</source> + <translation>Kalibrieren</translation> + </message> + <message> + <source>Clear calibration</source> + <translation>Kalibrierung löschen</translation> + </message> + <message> + <source>1</source> + <translation>1</translation> + </message> +</context> +<context> + <name>keyboard_listener</name> + <message> + <source>Dialog</source> + <translation>Dialog</translation> + </message> + <message> + <source>Press a key or close this window to remove the keybinding.</source> + <translation>Drücke eine Taste oder schließe das Fenster, um die Kurztaste zu löschen.</translation> + </message> +</context> +<context> + <name>mapping_dialog</name> + <message> + <source>Mapping properties</source> + <translation>Abbildungsparameter</translation> + </message> + <message> + <source>Yaw</source> + <translation>Gieren</translation> + </message> + <message> + <source>Max input</source> + <translation>Maximale Eingabe</translation> + </message> + <message> + <source>Asymmetric mapping below</source> + <translation>Assymmetrische Abbildung unterhalb</translation> + </message> + <message> + <source>Pitch</source> + <translation>Nicken</translation> + </message> + <message> + <source>Max output</source> + <translation>Maximale Ausgabe</translation> + </message> + <message> + <source>180°</source> + <translation>180°</translation> + </message> + <message> + <source>90°</source> + <translation>90°</translation> + </message> + <message> + <source>Roll</source> + <translation>Rollen</translation> + </message> + <message> + <source>X</source> + <translation>X</translation> + </message> + <message> + <source>Y</source> + <translation>Y</translation> + </message> + <message> + <source>Z</source> + <translation>Z</translation> + </message> + <message> + <source>%1°</source> + <translation>%1°</translation> + </message> + <message> + <source>%1 cm</source> + <translation>%1 cm</translation> + </message> +</context> +<context> + <name>options_dialog</name> + <message> + <source>Options</source> + <translation>Optionen</translation> + </message> + <message> + <source>Shortcuts</source> + <translation>Kurztasten</translation> + </message> + <message> + <source>Global shortcuts</source> + <translation>Globale Kurztasten</translation> + </message> + <message> + <source>Use current tracker pose as looking perfectly forward.</source> + <translation>Benutze aktuelle Tracker-Pose als perfekt nach vorn gerichtet.</translation> + </message> + <message> + <source>Center</source> + <translation>Zentrieren</translation> + </message> + <message> + <source>Bind</source> + <translation>Belegen</translation> + </message> + <message> + <source>Start tracking</source> + <translation>Tracking starten</translation> + </message> + <message> + <source>Stop tracking</source> + <translation>Tracking stoppen</translation> + </message> + <message> + <source>Keep looking forward until next zero keypress.</source> + <translation>Weiter vorwärts schauen bis zum nächsten Drücken der Nullen-Taste.</translation> + </message> + <message> + <source>Zero</source> + <translation>Nullen</translation> + </message> + <message> + <source>Freeze the position returned by the tracker while this mode is active.</source> + <translation>Position des Trackers einfrieren, solange dieser Modus aktiv ist.</translation> + </message> + <message> + <source>Toggle</source> + <translation>Umschalten</translation> + </message> + <message> + <source>Zero while held</source> + <translation>Nullen während gedrückt</translation> + </message> + <message> + <source>Restart tracking</source> + <translation>Tracking neu starten</translation> + </message> + <message> + <source>Toggle while held</source> + <translation>Umschalten während gedrückt</translation> + </message> + <message> + <source>Toggle tracking</source> + <translation>Tracking umschalten</translation> + </message> + <message> + <source>Disable user interface localization</source> + <translation>Übersetzungen der Benutzeroberfläche abschalten</translation> + </message> + <message> + <source>Centering method</source> + <translation>Zentriermethode</translation> + </message> + <message> + <source>Center at startup</source> + <translation>Zentrieren beim Start</translation> + </message> + <message> + <source>Disabled</source> + <translation>Abgeschaltet</translation> + </message> + <message> + <source>Point</source> + <translation>Punkt</translation> + </message> + <message> + <source>Wireless VR 360</source> + <translation>Wireless VR 360</translation> + </message> + <message> + <source>Roll compensated</source> + <translation>rollkompensiert</translation> + </message> + <message> + <source>Minimize to tray</source> + <translation>In den Systemabschnitt minimieren</translation> + </message> + <message> + <source>Enable tray</source> + <translation>Benachrichtigungssymbol aktivieren</translation> + </message> + <message> + <source>Minimize to tray on startup when enabled</source> + <translation>Wenn aktiviert, beim Start in den Systemabschnitt minimieren</translation> + </message> + <message> + <source>Output</source> + <translation>Ausgabe</translation> + </message> + <message> + <source>Axis assignment</source> + <translation>Achsen-Zuweisung</translation> + </message> + <message> + <source>Pitch</source> + <translation>Nicken</translation> + </message> + <message> + <source>X</source> + <translation>X</translation> + </message> + <message> + <source>Y</source> + <translation>Y</translation> + </message> + <message> + <source>Z</source> + <translation>Z</translation> + </message> + <message> + <source>Yaw</source> + <translation>Gieren</translation> + </message> + <message> + <source>Roll</source> + <translation>Rollen</translation> + </message> + <message> + <source>Relative translation only</source> + <translation>Nur relative Übersetzung</translation> + </message> + <message> + <source>Source</source> + <translation>Quelle</translation> + </message> + <message> + <source>Pre-invert</source> + <translation>Vor-Invertieren</translation> + </message> + <message> + <source>Destination</source> + <translation>Ziel</translation> + </message> + <message> + <source>Post-invert</source> + <translation>Nach-Invertieren</translation> + </message> + <message> + <source>Custom center pose</source> + <translation>Benutzerdefinierte Mittelpunkt-Pose</translation> + </message> + <message> + <source>Alter the centered position sent to games. Useful if the default position is too much downward or upward.</source> + <translation>Verändere die zentrierte Position, die an Spiele gesendet wird. Nützlich, falls die Standard-Position zu weit unten oder oben ist.</translation> + </message> + <message> + <source>°</source> + <translation>°</translation> + </message> + <message> + <source> cm</source> + <translation> cm</translation> + </message> + <message> + <source>CSV Data Logging</source> + <translation>CSV-Datenausgabe</translation> + </message> + <message> + <source>Enable - You will be asked for a filename whenever tracking starts</source> + <translation>Einschalten - Der Dateiname wird jedesmal abgefragt, wenn das Tracking startet</translation> + </message> + <message> + <source>Relative translation</source> + <translation>Relative Übersetzung</translation> + </message> + <message> + <source>With relative mode on, translation is applied after rotation. For example, rotating +180 degrees yaw and moving backwards results in moving forward as a result of that rotation.</source> + <translation>Wenn die relative Modus aktiv ist, wird die Übersetzung nach der Rotation angewendet. Zum Beispiel wird dadurch beim Gieren um 180° mit Rückwärtsbewegung in eine Vorwärtsbewegung umgewandelt.</translation> + </message> + <message> + <source>Mode</source> + <translation>Modus</translation> + </message> + <message> + <source>Enabled</source> + <translation>Eingeschaltet</translation> + </message> + <message> + <source>Enabled when not aiming</source> + <translation>Eingeschaltet, während nicht gezielt wird</translation> + </message> + <message> + <source>Disable for Y</source> + <translation>Für Y abschalten</translation> + </message> + <message> + <source>Disable for X</source> + <translation>Für X abschalten</translation> + </message> + <message> + <source>Disable effect by roll</source> + <translation>Effekt durch Rollen abschalten</translation> + </message> + <message> + <source>Disable for Z (for zoom on Z axis)</source> + <translation>Für Z abschalten (für Zoom auf der Z-Achse)</translation> + </message> + <message> + <source>Disable effect by pitch</source> + <translation>Effekt durch Nicken abschalten</translation> + </message> + <message> + <source>Disable effect by yaw</source> + <translation>Effekt durch Gieren abschalten</translation> + </message> + <message> + <source>Neck displacement</source> + <translation>Nacken-Versatz</translation> + </message> + <message> + <source>Eyes will be offset from the pivot of rotation, assumed to be the neck. It also works with relative translation disabled.</source> + <translation>Die Augen werden gegenüber des Drehpunktes versetzt sein, unter Annahme, sie seien der Nacken. Dies funktioniert auch dann, wenn die relative Übersetzung abgeschaltet ist.</translation> + </message> + <message> + <source>Enable</source> + <translation>Einschalten</translation> + </message> + <message> + <source>Forward from center of rotation</source> + <translation>Vom Drehpunkt nach vorn verschieben</translation> + </message> + <message> + <source>Game detection</source> + <translation>Spiel-Erkennung</translation> + </message> + <message> + <source>Start tracking automatically when a game starts with selected profile, and stop when the game exits.</source> + <translation>Tracking beim Spielstart automatisch mit dem ausgewählten Profil starten, und stoppen, wenn das Spiel beendet wird.</translation> + </message> + <message> + <source>Mouse %1</source> + <translation>Maus %1</translation> + </message> + <message> + <source>Joy button %1</source> + <translation>Joystick-Knopf %1</translation> + </message> + <message> + <source>None</source> + <translation>Nichts</translation> + </message> + <message> + <source>Tracker</source> + <translation>Tracker</translation> + </message> + <message> + <source>Filter</source> + <translation>Filter</translation> + </message> +</context> +<context> + <name>process_detector</name> + <message> + <source>Game detector</source> + <translation>Spiel-Erkennung</translation> + </message> + <message> + <source>Start profiles from game executable names in this list</source> + <translation>Profile anhand der ausführbaren Dateien dieser Liste starten</translation> + </message> + <message> + <source>Executable</source> + <translation>Ausführbare Datei</translation> + </message> + <message> + <source>Profile</source> + <translation>Profil</translation> + </message> + <message> + <source>+</source> + <translation>Hinzufügen</translation> + </message> + <message> + <source>-</source> + <translation>Entfernen</translation> + </message> +</context> +</TS> diff --git a/gui/lang/nl_NL.ts b/gui/lang/nl_NL.ts index b49ba1a5..1b9d8fe9 100644 --- a/gui/lang/nl_NL.ts +++ b/gui/lang/nl_NL.ts @@ -13,6 +13,50 @@ </message> </context> <context> + <name>Form</name> + <message> + <source>Press "calibrate" in given row to calibrate that axis. Follow instructions in the next window. +Press "clear calibration" to remove any calibration data pertaining to that axis of position change or rotation.</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>X</source> + <translation type="unfinished">X</translation> + </message> + <message> + <source>Y</source> + <translation type="unfinished">Y</translation> + </message> + <message> + <source>Z</source> + <translation type="unfinished">Z</translation> + </message> + <message> + <source>Yaw</source> + <translation type="unfinished">Yaw</translation> + </message> + <message> + <source>Pitch</source> + <translation type="unfinished">Pitch</translation> + </message> + <message> + <source>Roll</source> + <translation type="unfinished">Rollen</translation> + </message> + <message> + <source>Calibrate</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Clear calibration</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>1</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>keyboard_listener</name> <message> <source>Dialog</source> @@ -77,6 +121,10 @@ <source>%1°</source> <translation type="unfinished"></translation> </message> + <message> + <source>%1 cm</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>options_dialog</name> @@ -93,10 +141,6 @@ <translation>Algehele sneltoetsen</translation> </message> <message> - <source><html><head/><body><p><span style=" font-weight:600;">Center</span> - use current pose as looking perfectly forward.<br/><span style=" font-weight:600;">Toggle</span> - keep looking at same spot until next toggle keypress.<br/><span style=" font-weight:600;">Zero</span> - keep looking forward until next zero keypress.<br/></p></body></html></source> - <translation><html><head/><body><p><span style=" font-weight:600;">Centreren</span> - gebruik de huidige kijkrichting als ijkpunt voor het centreren.<br/><span style=" font-weight:600;">Wisselen</span> - kijkrichting blijft op dezelfde plek staan, totdat de ingestelde knop opnieuw wordt ingedrukt.<br/><span style=" font-weight:600;">Zero</span> - Kijkrichting blijft recht vooruit, totdat er op de ingestelde toets gedrukt wordt.<br/></p></body></html></translation> - </message> - <message> <source>Bind</source> <translation>Koppelen</translation> </message> @@ -237,27 +281,15 @@ <translation>Effect uitschakelen bij rol</translation> </message> <message> - <source>Output remap</source> - <translation>Uitvoer aanpassen</translation> - </message> - <message> - <source>Assign input axis to output axis.</source> - <translation>Ingangs-as toewijzen aan uitgangs-as.</translation> - </message> - <message> <source>X</source> <translation>X</translation> </message> <message> - <source>Invert</source> - <translation>Omkeren</translation> - </message> - <message> <source>Y</source> <translation>Y</translation> </message> <message> - <source>Never translate the application interface</source> + <source>Disable user interface localization</source> <translation>De applicatie nooit vertaald weergeven</translation> </message> <message> @@ -312,6 +344,58 @@ <source>None</source> <translation type="unfinished">Geen</translation> </message> + <message> + <source>Centering method</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Point</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Wireless VR 360</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Roll compensated</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Freeze the position returned by the tracker while this mode is active.</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Tracker</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Filter</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Mouse %1</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Use current tracker pose as looking perfectly forward.</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Keep looking forward until next zero keypress.</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Axis assignment</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Pre-invert</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Post-invert</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>process_detector</name> diff --git a/gui/lang/ru_RU.ts b/gui/lang/ru_RU.ts index feb4a302..5b3fcc03 100644 --- a/gui/lang/ru_RU.ts +++ b/gui/lang/ru_RU.ts @@ -13,6 +13,50 @@ </message> </context> <context> + <name>Form</name> + <message> + <source>Press "calibrate" in given row to calibrate that axis. Follow instructions in the next window. +Press "clear calibration" to remove any calibration data pertaining to that axis of position change or rotation.</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>X</source> + <translation type="unfinished">X</translation> + </message> + <message> + <source>Y</source> + <translation type="unfinished">Y</translation> + </message> + <message> + <source>Z</source> + <translation type="unfinished">Z</translation> + </message> + <message> + <source>Yaw</source> + <translation type="unfinished">Yaw</translation> + </message> + <message> + <source>Pitch</source> + <translation type="unfinished">Pitch</translation> + </message> + <message> + <source>Roll</source> + <translation type="unfinished">Roll</translation> + </message> + <message> + <source>Calibrate</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Clear calibration</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>1</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>keyboard_listener</name> <message> <source>Dialog</source> @@ -77,6 +121,10 @@ <source>%1°</source> <translation></translation> </message> + <message> + <source>%1 cm</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>options_dialog</name> @@ -93,11 +141,6 @@ <translation>Глобальные горячие клавиши</translation> </message> <message> - <source><html><head/><body><p><span style=" font-weight:600;">Center</span> - use current pose as looking perfectly forward.<br/><span style=" font-weight:600;">Toggle</span> - keep looking at same spot until next toggle keypress.<br/><span style=" font-weight:600;">Zero</span> - keep looking forward until next zero keypress.<br/></p></body></html></source> - <translatorcomment>использовать текущую позу как позу вперед</translatorcomment> - <translation><html><head/><body><p><span style=" font-weight:600;">Центрирование</span> - использовать текущую позу в качестве центра.<br/><span style=" font-weight:600;">Фиксация обзора</span> - фиксация обзора до следующего нажатия клавиши.<br/><span style=" font-weight:600;">Центр</span> - фиксирует взгляд в нулевой точке до следующего нажатия клавиши.<br/></p></body></html></translation> - </message> - <message> <source>Bind</source> <translation>Назначить</translation> </message> @@ -142,10 +185,6 @@ <translation>Центрирование при запуске</translation> </message> <message> - <source>Never translate the application interface</source> - <translation></translation> - </message> - <message> <source>Minimize to tray</source> <translation>Настройка трея</translation> </message> @@ -228,22 +267,10 @@ <translation>Смещение точки взгляда относительно оси вращения. Работает вместе с относительным сдвигом</translation> </message> <message> - <source>Output remap</source> - <translation>Переназначение осей</translation> - </message> - <message> - <source>Assign input axis to output axis.</source> - <translation>Сопоставление исходных и игровых осей.</translation> - </message> - <message> <source>X</source> <translation>X</translation> </message> <message> - <source>Invert</source> - <translation>Инвертировать</translation> - </message> - <message> <source>Y</source> <translation>Y</translation> </message> @@ -315,6 +342,62 @@ <source>None</source> <translation>Не назначена</translation> </message> + <message> + <source>Centering method</source> + <translation>Метод центровки</translation> + </message> + <message> + <source>Point</source> + <translation>Точечная</translation> + </message> + <message> + <source>Wireless VR 360</source> + <translation>Беспроводная VR 360</translation> + </message> + <message> + <source>Roll compensated</source> + <translation>Roll компенсированная</translation> + </message> + <message> + <source>Freeze the position returned by the tracker while this mode is active.</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Disable user interface localization</source> + <translation>Использовать английский интерфейс</translation> + </message> + <message> + <source>Tracker</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Filter</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Mouse %1</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Use current tracker pose as looking perfectly forward.</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Keep looking forward until next zero keypress.</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Axis assignment</source> + <translation>Переназначение осей</translation> + </message> + <message> + <source>Pre-invert</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Post-invert</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>process_detector</name> diff --git a/gui/lang/stub.ts b/gui/lang/stub.ts index e559bc28..ee96d3be 100644 --- a/gui/lang/stub.ts +++ b/gui/lang/stub.ts @@ -13,6 +13,50 @@ </message> </context> <context> + <name>Form</name> + <message> + <source>Press "calibrate" in given row to calibrate that axis. Follow instructions in the next window. +Press "clear calibration" to remove any calibration data pertaining to that axis of position change or rotation.</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>X</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Y</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Z</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Yaw</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Pitch</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Roll</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Calibrate</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Clear calibration</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>1</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>keyboard_listener</name> <message> <source>Dialog</source> @@ -77,6 +121,10 @@ <source>%1°</source> <translation type="unfinished"></translation> </message> + <message> + <source>%1 cm</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>options_dialog</name> @@ -93,10 +141,6 @@ <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-weight:600;">Center</span> - use current pose as looking perfectly forward.<br/><span style=" font-weight:600;">Toggle</span> - keep looking at same spot until next toggle keypress.<br/><span style=" font-weight:600;">Zero</span> - keep looking forward until next zero keypress.<br/></p></body></html></source> - <translation type="unfinished"></translation> - </message> - <message> <source>Bind</source> <translation type="unfinished"></translation> </message> @@ -141,10 +185,6 @@ <translation type="unfinished"></translation> </message> <message> - <source>Never translate the application interface</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Minimize to tray</source> <translation type="unfinished"></translation> </message> @@ -245,22 +285,10 @@ <translation type="unfinished"></translation> </message> <message> - <source>Output remap</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Assign input axis to output axis.</source> - <translation type="unfinished"></translation> - </message> - <message> <source>X</source> <translation type="unfinished"></translation> </message> <message> - <source>Invert</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Y</source> <translation type="unfinished"></translation> </message> @@ -312,6 +340,62 @@ <source>None</source> <translation type="unfinished"></translation> </message> + <message> + <source>Centering method</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Point</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Wireless VR 360</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Roll compensated</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Freeze the position returned by the tracker while this mode is active.</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Disable user interface localization</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Tracker</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Filter</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Mouse %1</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Use current tracker pose as looking perfectly forward.</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Keep looking forward until next zero keypress.</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Axis assignment</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Pre-invert</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Post-invert</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>process_detector</name> diff --git a/gui/lang/zh_CN.ts b/gui/lang/zh_CN.ts index d910a860..4914f7e1 100644 --- a/gui/lang/zh_CN.ts +++ b/gui/lang/zh_CN.ts @@ -5,76 +5,125 @@ <name>BrowseButton</name> <message> <source>Set executable name</source> - <translation type="unfinished"></translation> + <translation>选择可执行文件</translation> </message> <message> <source>Executable (*.exe);;All Files (*)</source> - <translation type="unfinished"></translation> + <translation>可执行文件 (*.exe);;所有文件 (*)</translation> + </message> +</context> +<context> + <name>Form</name> + <message> + <source>Press "calibrate" in given row to calibrate that axis. Follow instructions in the next window. +Press "clear calibration" to remove any calibration data pertaining to that axis of position change or rotation.</source> + <translation>按 "校准" in given row to calibrate that axis. 按照下一个窗口的指示继续. +按 "清除校准" to remove any calibration data pertaining to that axis of position change or rotation.</translation> + </message> + <message> + <source>X</source> + <translation></translation> + </message> + <message> + <source>Y</source> + <translation></translation> + </message> + <message> + <source>Z</source> + <translation></translation> + </message> + <message> + <source>Yaw</source> + <translation>航向</translation> + </message> + <message> + <source>Pitch</source> + <translation>仰俯</translation> + </message> + <message> + <source>Roll</source> + <translation>横滚</translation> + </message> + <message> + <source>Calibrate</source> + <translation>校准</translation> + </message> + <message> + <source>Clear calibration</source> + <translation>清除校准</translation> + </message> + <message> + <source>1</source> + <translation></translation> </message> </context> <context> <name>keyboard_listener</name> <message> <source>Dialog</source> - <translation type="unfinished"></translation> + <translation>按键绑定对话框</translation> </message> <message> <source>Press a key or close this window to remove the keybinding.</source> - <translation type="unfinished"></translation> + <translation>按键绑定,或者关闭窗口消除绑定。</translation> </message> </context> <context> <name>mapping_dialog</name> <message> <source>Mapping properties</source> - <translation type="unfinished"></translation> + <translation>映射属性</translation> </message> <message> <source>Yaw</source> - <translation type="unfinished"></translation> + <translation>航向</translation> </message> <message> <source>Max input</source> - <translation type="unfinished"></translation> + <translation>最大输入</translation> </message> <message> <source>Asymmetric mapping below</source> - <translation type="unfinished"></translation> + <translation>非对称映射</translation> </message> <message> <source>Pitch</source> - <translation type="unfinished"></translation> + <translation>仰俯</translation> </message> <message> <source>Max output</source> - <translation type="unfinished"></translation> + <translation>最大输出</translation> </message> <message> <source>180°</source> - <translation type="unfinished"></translation> + <translation></translation> </message> <message> <source>90°</source> - <translation type="unfinished"></translation> + <translation></translation> </message> <message> <source>Roll</source> - <translation type="unfinished"></translation> + <translation>横滚</translation> </message> <message> <source>X</source> - <translation type="unfinished"></translation> + <translation></translation> </message> <message> <source>Y</source> - <translation type="unfinished"></translation> + <translation></translation> </message> <message> <source>Z</source> - <translation type="unfinished"></translation> + <translation></translation> </message> <message> <source>%1°</source> + <translation></translation> + </message> + <message> + <source>%1 cm</source> <translation type="unfinished"></translation> </message> </context> @@ -82,234 +131,270 @@ <name>options_dialog</name> <message> <source>Options</source> - <translation type="unfinished"></translation> + <translation>选项</translation> </message> <message> <source>Shortcuts</source> - <translation type="unfinished"></translation> + <translation>快捷键</translation> </message> <message> <source>Global shortcuts</source> - <translation type="unfinished"></translation> - </message> - <message> - <source><html><head/><body><p><span style=" font-weight:600;">Center</span> - use current pose as looking perfectly forward.<br/><span style=" font-weight:600;">Toggle</span> - keep looking at same spot until next toggle keypress.<br/><span style=" font-weight:600;">Zero</span> - keep looking forward until next zero keypress.<br/></p></body></html></source> - <translation type="unfinished"></translation> + <translation>全局快捷键</translation> </message> <message> <source>Center</source> - <translation type="unfinished"></translation> + <translation>回中位置</translation> </message> <message> <source>Bind</source> - <translation type="unfinished"></translation> + <translation>绑定</translation> </message> <message> <source>Start tracking</source> - <translation type="unfinished">开始跟踪</translation> + <translation>开始跟踪</translation> </message> <message> <source>Stop tracking</source> - <translation type="unfinished">停止跟踪</translation> + <translation>停止跟踪</translation> </message> <message> <source>Zero</source> - <translation>初始位置</translation> + <translation>归零位置</translation> </message> <message> <source>Toggle</source> - <translation type="unfinished"></translation> + <translation>盯着看</translation> </message> <message> <source>Zero while held</source> - <translation type="unfinished"></translation> + <translation>长按归零</translation> </message> <message> <source>Restart tracking</source> - <translation type="unfinished"></translation> + <translation>重新开始跟踪</translation> </message> <message> <source>Toggle while held</source> - <translation type="unfinished"></translation> + <translation>长按盯着看</translation> </message> <message> <source>Toggle tracking</source> - <translation type="unfinished"></translation> + <translation>开关跟踪</translation> </message> <message> <source>Center at startup</source> - <translation type="unfinished"></translation> + <translation>启动时回中</translation> </message> <message> - <source>Never translate the application interface</source> - <translation type="unfinished"></translation> + <source>Disable user interface localization</source> + <translation>关闭翻译界面</translation> </message> <message> <source>Minimize to tray</source> - <translation type="unfinished"></translation> + <translation>最小化到任务栏</translation> </message> <message> <source>Enable tray</source> - <translation type="unfinished"></translation> + <translation>开启任务栏图标</translation> </message> <message> <source>Minimize to tray on startup when enabled</source> - <translation type="unfinished"></translation> + <translation>启动时最小化到任务栏</translation> </message> <message> <source>Output</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Output remap</source> - <translation type="unfinished"></translation> + <translation>输出</translation> </message> <message> <source>X</source> - <translation type="unfinished"></translation> + <translation></translation> </message> <message> <source>Y</source> - <translation type="unfinished"></translation> + <translation></translation> </message> <message> <source>Z</source> - <translation type="unfinished"></translation> + <translation></translation> </message> <message> <source>Yaw</source> - <translation type="unfinished"></translation> + <translation>航向</translation> </message> <message> <source>Pitch</source> - <translation type="unfinished"></translation> + <translation>仰俯</translation> </message> <message> <source>Roll</source> - <translation type="unfinished"></translation> + <translation>横滚</translation> </message> <message> <source>Disabled</source> - <translation type="unfinished"></translation> + <translation>不启用</translation> </message> <message> <source>Relative translation only</source> - <translation type="unfinished"></translation> + <translation>相对位移</translation> </message> <message> <source>Source</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Invert</source> - <translation type="unfinished"></translation> + <translation>源头</translation> </message> <message> <source>Destination</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Assign input axis to output axis.</source> - <translation type="unfinished"></translation> + <translation>目标</translation> </message> <message> <source>Custom center pose</source> - <translation type="unfinished"></translation> + <translation>定制回中姿态</translation> </message> <message> <source>Alter the centered position sent to games. Useful if the default position is too much downward or upward.</source> - <translation type="unfinished"></translation> + <translation>改变发送到游戏的回中位置. 对于默认位置有明显偏移的很有用.</translation> </message> <message> <source>°</source> - <translation type="unfinished"></translation> + <translation></translation> </message> <message> <source> cm</source> - <translation type="unfinished"></translation> + <translation></translation> </message> <message> <source>CSV Data Logging</source> - <translation type="unfinished"></translation> + <translation>CSV数据记录</translation> </message> <message> <source>Enable - You will be asked for a filename whenever tracking starts</source> - <translation type="unfinished"></translation> + <translation>启用 - 当跟踪开始时会被要求输入文件名</translation> </message> <message> <source>Relative translation</source> - <translation type="unfinished"></translation> + <translation>相对位移</translation> </message> <message> <source>With relative mode on, translation is applied after rotation. For example, rotating +180 degrees yaw and moving backwards results in moving forward as a result of that rotation.</source> - <translation type="unfinished"></translation> + <translation>相对位移开启时,位移会被后考虑.例如,航向旋转+180度,然后后退的结果是,直接向前移动.</translation> </message> <message> <source>Mode</source> - <translation type="unfinished"></translation> + <translation>模式</translation> </message> <message> <source>Enabled</source> - <translation type="unfinished"></translation> + <translation>启用</translation> </message> <message> <source>Enabled when not aiming</source> - <translation type="unfinished"></translation> + <translation>没有朝向它时启用</translation> </message> <message> <source>Disable for Y</source> - <translation type="unfinished"></translation> + <translation>Y轴不启用</translation> </message> <message> <source>Disable for X</source> - <translation type="unfinished"></translation> + <translation>X轴不启用</translation> </message> <message> <source>Disable effect by roll</source> - <translation type="unfinished"></translation> + <translation>横滚时,不启用</translation> </message> <message> <source>Disable for Z (for zoom on Z axis)</source> - <translation type="unfinished"></translation> + <translation>Z轴不启用(用于Z轴放大)</translation> </message> <message> <source>Disable effect by pitch</source> - <translation type="unfinished"></translation> + <translation>仰俯不启用</translation> </message> <message> <source>Disable effect by yaw</source> - <translation type="unfinished"></translation> + <translation>航向不启用</translation> </message> <message> <source>Neck displacement</source> - <translation type="unfinished"></translation> + <translation>脖子的偏移</translation> </message> <message> <source>Eyes will be offset from the pivot of rotation, assumed to be the neck. It also works with relative translation disabled.</source> - <translation type="unfinished"></translation> + <translation>眼睛的移动支点其实是脖子。本功能在相对位移功能不开启的情况下也生效。</translation> </message> <message> <source>Enable</source> - <translation type="unfinished"></translation> + <translation>启用</translation> </message> <message> <source>Forward from center of rotation</source> - <translation type="unfinished"></translation> + <translation>向前偏移</translation> </message> <message> <source>Game detection</source> - <translation type="unfinished"></translation> + <translation>游戏侦测</translation> </message> <message> <source>Start tracking automatically when a game starts with selected profile, and stop when the game exits.</source> - <translation type="unfinished"></translation> + <translation>当游戏开始运行时自动开始跟踪,游戏退出时停止跟踪。</translation> </message> <message> <source>Joy button %1</source> - <translation type="unfinished"></translation> + <translation>游戏手柄按钮 %1</translation> </message> <message> <source>None</source> + <translation>空</translation> + </message> + <message> + <source>Centering method</source> + <translation>回中方法</translation> + </message> + <message> + <source>Point</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Wireless VR 360</source> + <translation type="unfinished">无线 VR 360</translation> + </message> + <message> + <source>Roll compensated</source> + <translation>滚转补偿</translation> + </message> + <message> + <source>Freeze the position returned by the tracker while this mode is active.</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Tracker</source> + <translation>输入</translation> + </message> + <message> + <source>Filter</source> + <translation>过滤器</translation> + </message> + <message> + <source>Mouse %1</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Use current tracker pose as looking perfectly forward.</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Keep looking forward until next zero keypress.</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Axis assignment</source> + <translation>输出重新映射</translation> + </message> + <message> + <source>Pre-invert</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Post-invert</source> <translation type="unfinished"></translation> </message> </context> @@ -317,27 +402,27 @@ <name>process_detector</name> <message> <source>Game detector</source> - <translation type="unfinished"></translation> + <translation>游戏侦测</translation> </message> <message> <source>Start profiles from game executable names in this list</source> - <translation type="unfinished"></translation> + <translation>运行以下列表可执行文件时启用对应的配置文件</translation> </message> <message> <source>Executable</source> - <translation type="unfinished"></translation> + <translation>可执行文件</translation> </message> <message> <source>Profile</source> - <translation type="unfinished"></translation> + <translation>配置</translation> </message> <message> <source>+</source> - <translation type="unfinished"></translation> + <translation></translation> </message> <message> <source>-</source> - <translation type="unfinished"></translation> + <translation></translation> </message> </context> </TS> diff --git a/gui/mapping-dialog.cpp b/gui/mapping-dialog.cpp index d4f8a1d4..cdbf532e 100644 --- a/gui/mapping-dialog.cpp +++ b/gui/mapping-dialog.cpp @@ -10,6 +10,10 @@ #include "logic/main-settings.hpp" #include "spline/spline-widget.hpp" +#include <QtEvents> + +using namespace options; + mapping_dialog::mapping_dialog(Mappings& m) : m(m), widgets{} { ui.setupUi(this); @@ -24,21 +28,13 @@ mapping_dialog::mapping_dialog(Mappings& m) : m(m), widgets{} }; { - QColor bg = palette().background().color(); + QColor bg = palette().window().color(); QString tmp; tmp.reserve(32); - tmp += QStringLiteral(".QWidget { background-color: #"); - - for (int i : { bg.red(), bg.green(), bg.blue() }) - { - if (i < 0xf0) - tmp += '0'; - tmp += QString::number(i, 16); - } - - tmp += "; }"; + tmp += QStringLiteral(".QWidget { background-color: rgb(%1, %2, %3); } ") + .arg(bg.red()).arg(bg.green()).arg(bg.blue()); for (QWidget* w : pages) w->setStyleSheet(tmp); @@ -63,6 +59,10 @@ mapping_dialog::mapping_dialog(Mappings& m) : m(m), widgets{} tie_setting(s.a_y.clamp_x_, ui.max_y_translation); tie_setting(s.a_z.clamp_x_, ui.max_z_translation); + tie_setting(s.a_x.clamp_y_, ui.max_x_out); + tie_setting(s.a_y.clamp_y_, ui.max_y_out); + tie_setting(s.a_z.clamp_y_, ui.max_z_out); + tie_setting(s.a_pitch.clamp_y_, ui.max_pitch_output); } @@ -90,20 +90,22 @@ void mapping_dialog::load() { nullptr, Yaw, nullptr, false } }; - ui.max_pitch_output->setItemData(0, int(axis_opts::o_r180)); - ui.max_pitch_output->setItemData(1, int(axis_opts::o_r90)); - using a = axis_opts::max_clamp; + ui.max_pitch_output->setItemData(0, int(a::o_r180)); + ui.max_pitch_output->setItemData(1, int(a::o_r90)); + for (QComboBox* x : { ui.max_yaw_rotation, ui.max_pitch_rotation, ui.max_roll_rotation }) for (a y : { a::r180, a::r90, a::r60, a::r45, a::r30, a::r25, a::r20, a::r15, a::r10 }) x->addItem(tr("%1°").arg(y), y); for (QComboBox* x : { ui.max_x_translation, ui.max_y_translation, ui.max_z_translation }) - for (a y : { a::t30, a::t20, a::t15, a::t10, a::t100 }) - x->addItem(QStringLiteral("%1 cm").arg(int(y)), y); + for (a y : { a::t30, a::t20, a::t15, a::t10, a::t75, a::t100, a::t150, a::t300, a::t600 }) + x->addItem(tr("%1 cm").arg(int(y)), y); - // XXX TODO add tie_setting overload for spline_widget!!! -sh 20171020 + for (QComboBox* x : { ui.max_x_out, ui.max_y_out, ui.max_z_out }) + for (a y : { a::o_t75, a::o_t100, a::o_t150, a::o_t300, a::o_t600 }) + x->addItem(tr("%1 cm").arg(abs(int(y))), y); for (int i = 0; qfcs[i].qfc; i++) { @@ -116,55 +118,57 @@ void mapping_dialog::load() if (altp) { connect(&axis.opts.altp, - base_value::value_changed<bool>(), - this, - [&](bool f) {qfc.setEnabled(f); qfc.force_redraw();}); + value_::value_changed<bool>(), + this, [&](bool f) { qfc.setEnabled(f); }); qfc.setEnabled(axis.opts.altp); - qfc.force_redraw(); } - const int idx = qfcs[i].axis; - - using c = axis_opts::max_clamp; - - auto update_xstep = [idx, &conf, &qfc](int clamp_x) { + auto update_xstep = [&qfc](int clamp_x) { int value; - if (clamp_x <= c::r20) + if (clamp_x <= a::r30) value = 1; - else if (clamp_x <= c::r30) + else if (clamp_x <= a::r45) value = 5; - else + else if (clamp_x <= a::t150) value = 10; + else if (clamp_x <= a::t300) + value = 25; + else + value = 50; qfc.set_x_step(value); }; - auto update_ystep = [idx, &conf, &qfc](int clamp_y) { + auto update_ystep = [&qfc](int clamp_y) { int value; switch (clamp_y) { default: - case c::o_r180: - value = 15; break; - case c::o_r90: + case a::o_r180: + value = 20; break; + case a::o_r90: value = 10; break; - case c::o_t75: + case a::o_t75: value = 5; break; + case a::o_t100: + case a::o_t150: + value = 10; break; + case a::o_t300: + value = 50; break; + case a::o_t600: + value = 100; break; } qfc.set_y_step(value); }; - if (idx >= Yaw) - qfc.set_snap(.5, 1); - else - qfc.set_snap(.5, 1); + qfc.set_snap(.5, 1); - connect(&axis.opts.clamp_x_, base_value::value_changed<int>(), &qfc, update_xstep); - connect(&axis.opts.clamp_y_, base_value::value_changed<int>(), &qfc, update_ystep); + connect(&axis.opts.clamp_x_, value_::value_changed<int>(), &qfc, update_xstep); + connect(&axis.opts.clamp_y_, value_::value_changed<int>(), &qfc, update_ystep); // force signal to avoid duplicating the slot's logic - qfc.setConfig(&conf); + qfc.set_config(&conf); update_xstep(axis.opts.clamp_x_); update_ystep(axis.opts.clamp_y_); diff --git a/gui/mapping-dialog.hpp b/gui/mapping-dialog.hpp index 23edb696..3758e7c7 100644 --- a/gui/mapping-dialog.hpp +++ b/gui/mapping-dialog.hpp @@ -8,9 +8,7 @@ #include <QWidget> #include <QDialog> -#include <QShowEvent> -#include <QCloseEvent> -#include <QCheckBox> +#include <QtEvents> class OTR_GUI_EXPORT mapping_dialog final : public QDialog { @@ -18,6 +16,7 @@ class OTR_GUI_EXPORT mapping_dialog final : public QDialog public: mapping_dialog(Mappings& m); void refresh_tab(); + inline bool embeddable() noexcept { return false; } private: Ui::mapping_dialog ui; Mappings& m; diff --git a/gui/mapping-dialog.ui b/gui/mapping-dialog.ui index 0f0aa7c0..545b5ae5 100644 --- a/gui/mapping-dialog.ui +++ b/gui/mapping-dialog.ui @@ -46,6 +46,12 @@ <string>Yaw</string> </attribute> <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="leftMargin"> + <number>12</number> + </property> + <property name="rightMargin"> + <number>12</number> + </property> <item> <widget class="QFrame" name="frame"> <property name="sizePolicy"> @@ -120,6 +126,12 @@ <string>Pitch</string> </attribute> <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="leftMargin"> + <number>12</number> + </property> + <property name="rightMargin"> + <number>12</number> + </property> <item> <widget class="QFrame" name="frame_2"> <property name="sizePolicy"> @@ -215,6 +227,12 @@ <string>Roll</string> </attribute> <layout class="QVBoxLayout" name="verticalLayout_4"> + <property name="leftMargin"> + <number>12</number> + </property> + <property name="rightMargin"> + <number>12</number> + </property> <item> <widget class="QFrame" name="frame_3"> <property name="sizePolicy"> @@ -293,6 +311,12 @@ <string>X</string> </attribute> <layout class="QVBoxLayout" name="verticalLayout_5"> + <property name="leftMargin"> + <number>12</number> + </property> + <property name="rightMargin"> + <number>12</number> + </property> <item> <widget class="QFrame" name="frame444"> <property name="sizePolicy"> @@ -328,6 +352,29 @@ </property> </widget> </item> + <item> + <widget class="QLabel" name="label4out"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Max output</string> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="max_x_out"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> </layout> </widget> </item> @@ -367,6 +414,12 @@ <string>Y</string> </attribute> <layout class="QVBoxLayout" name="verticalLayout_6"> + <property name="leftMargin"> + <number>12</number> + </property> + <property name="rightMargin"> + <number>12</number> + </property> <item> <widget class="QFrame" name="frame555"> <property name="sizePolicy"> @@ -402,6 +455,29 @@ </property> </widget> </item> + <item> + <widget class="QLabel" name="label5out"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Max output</string> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="max_y_out"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> </layout> </widget> </item> @@ -441,6 +517,12 @@ <string>Z</string> </attribute> <layout class="QVBoxLayout" name="verticalLayout_7"> + <property name="leftMargin"> + <number>12</number> + </property> + <property name="rightMargin"> + <number>12</number> + </property> <item> <widget class="QFrame" name="frame666"> <property name="sizePolicy"> @@ -476,6 +558,29 @@ </property> </widget> </item> + <item> + <widget class="QLabel" name="label6out"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Max output</string> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="max_z_out"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> </layout> </widget> </item> diff --git a/gui/settings.cpp b/gui/options-dialog.cpp index fc7cde19..76c3313a 100644 --- a/gui/settings.cpp +++ b/gui/options-dialog.cpp @@ -6,19 +6,23 @@ * notice appear in all copies. */ -#include "settings.hpp" +#include "options-dialog.hpp" #include "keyboard.h" #include "compat/library-path.hpp" + +#include <utility> + #include <QPushButton> #include <QLayout> #include <QDialog> #include <QFileDialog> using namespace options; +using namespace options::globals; QString options_dialog::kopts_to_string(const key_opts& kopts) { - if (static_cast<QString>(kopts.guid) != "") + if (!kopts.guid->isEmpty()) { const int btn = kopts.button & ~Qt::KeyboardModifierMask; const int mods = kopts.button & Qt::KeyboardModifierMask; @@ -26,42 +30,59 @@ QString options_dialog::kopts_to_string(const key_opts& kopts) if (mods & Qt::ControlModifier) mm += "Control+"; if (mods & Qt::AltModifier) mm += "Alt+"; if (mods & Qt::ShiftModifier) mm += "Shift+"; - return mm + tr("Joy button %1").arg(QString::number(btn)); + const auto& str = kopts.guid == QStringLiteral("mouse") + ? tr("Mouse %1") + : tr("Joy button %1"); + return mm + str.arg(QString::number(btn)); } - if (static_cast<QString>(kopts.keycode) == "") + if (kopts.keycode->isEmpty()) return tr("None"); return kopts.keycode; } void options_dialog::set_disable_translation_state(bool value) { - group::with_global_settings_object([&](QSettings& s) + with_global_settings_object([&](QSettings& s) { s.setValue("disable-translation", value); + mark_global_ini_modified(); }); } -options_dialog::options_dialog(std::function<void(bool)> pause_keybindings) : - pause_keybindings(pause_keybindings) +options_dialog::options_dialog(std::unique_ptr<ITrackerDialog>& tracker_dialog_, + std::unique_ptr<IProtocolDialog>& proto_dialog_, + std::unique_ptr<IFilterDialog>& filter_dialog_, + std::function<void(bool)> pause_keybindings) : + pause_keybindings(std::move(pause_keybindings)) { ui.setupUi(this); - connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); - connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); + connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &options_dialog::doOK); + connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &options_dialog::close); tie_setting(main.tray_enabled, ui.trayp); tie_setting(main.tray_start, ui.tray_start); tie_setting(main.center_at_startup, ui.center_at_startup); + const centering_state centering_modes[] = { + center_disabled, + center_point, + center_vr360, + center_roll_compensated, + }; + for (int k = 0; k < 4; k++) + ui.cbox_centering->setItemData(k, centering_modes[k]); + tie_setting(main.centering_mode, ui.cbox_centering); + const reltrans_state reltrans_modes[] = { reltrans_disabled, reltrans_enabled, reltrans_non_center, }; - for (unsigned k = 0; k < 3; k++) - ui.reltrans_mode->setItemData(k, int(reltrans_modes[k])); + for (int k = 0; k < 3; k++) + ui.reltrans_mode->setItemData(k, reltrans_modes[k]); tie_setting(main.reltrans_mode, ui.reltrans_mode); @@ -82,12 +103,19 @@ options_dialog::options_dialog(std::function<void(bool)> pause_keybindings) : tie_setting(main.a_pitch.zero, ui.pos_ry); tie_setting(main.a_roll.zero, ui.pos_rz); - tie_setting(main.a_yaw.invert, ui.invert_yaw); - tie_setting(main.a_pitch.invert, ui.invert_pitch); - tie_setting(main.a_roll.invert, ui.invert_roll); - tie_setting(main.a_x.invert, ui.invert_x); - tie_setting(main.a_y.invert, ui.invert_y); - tie_setting(main.a_z.invert, ui.invert_z); + tie_setting(main.a_yaw.invert_pre, ui.invert_yaw_pre); + tie_setting(main.a_pitch.invert_pre, ui.invert_pitch_pre); + tie_setting(main.a_roll.invert_pre, ui.invert_roll_pre); + tie_setting(main.a_x.invert_pre, ui.invert_x_pre); + tie_setting(main.a_y.invert_pre, ui.invert_y_pre); + tie_setting(main.a_z.invert_pre, ui.invert_z_pre); + + tie_setting(main.a_yaw.invert_post, ui.invert_yaw_post); + tie_setting(main.a_pitch.invert_post, ui.invert_pitch_post); + tie_setting(main.a_roll.invert_post, ui.invert_roll_post); + tie_setting(main.a_x.invert_post, ui.invert_x_post); + tie_setting(main.a_y.invert_post, ui.invert_y_post); + tie_setting(main.a_z.invert_post, ui.invert_z_post); tie_setting(main.a_yaw.src, ui.src_yaw); tie_setting(main.a_pitch.src, ui.src_pitch); @@ -102,7 +130,7 @@ options_dialog::options_dialog(std::function<void(bool)> pause_keybindings) : tie_setting(main.neck_enable, ui.neck_enable); - const bool is_translation_disabled = group::with_global_settings_object([] (QSettings& s) { + const bool is_translation_disabled = with_global_settings_object([] (QSettings& s) { return s.value("disable-translation", false).toBool(); }); ui.disable_translation->setChecked(is_translation_disabled); @@ -147,25 +175,36 @@ options_dialog::options_dialog(std::function<void(bool)> pause_keybindings) : tmp val = val_; val.label->setText(kopts_to_string(val.opt)); connect(&val.opt.keycode, - static_cast<void (base_value::*)(const QString&) const>(&base_value::valueChanged), + static_cast<void (value_::*)(const QString&) const>(&value_::valueChanged), val.label, [=](const QString&) { val.label->setText(kopts_to_string(val.opt)); }); { - connect(val.button, &QPushButton::clicked, this, [=]() { bind_key(val.opt, val.label); }); + connect(val.button, &QPushButton::clicked, this, [=, this] { bind_key(val.opt, val.label); }); } } -} -void options_dialog::closeEvent(QCloseEvent *) -{ - done(result()); + auto add_module_tab = [this] (auto& place, auto&& dlg, const QString& label) { + if (dlg && dlg->embeddable()) + { + using BaseDialog = plugin_api::detail::BaseDialog; + + dlg->set_buttons_visible(false); + place = dlg.release(); + ui.tabWidget->addTab(place, label); + QObject::connect(place, &BaseDialog::closing, this, &QDialog::close); + } + }; + + add_module_tab(tracker_dialog, tracker_dialog_, tr("Tracker")); + add_module_tab(proto_dialog, proto_dialog_, tr("Output")); + add_module_tab(filter_dialog, filter_dialog_, tr("Filter")); } void options_dialog::bind_key(key_opts& kopts, QLabel* label) { kopts.button = -1; - kopts.guid = ""; - kopts.keycode = ""; + kopts.guid = {}; + kopts.keycode = {}; auto k = new keyboard_listener; k->setWindowModality(Qt::ApplicationModal); k->deleteLater(); @@ -176,7 +215,7 @@ void options_dialog::bind_key(key_opts& kopts, QLabel* label) [&](const QKeySequence& s) { kopts.keycode = s.toString(QKeySequence::PortableText); - kopts.guid = ""; + kopts.guid = {}; kopts.button = -1; k->close(); }); @@ -187,12 +226,12 @@ void options_dialog::bind_key(key_opts& kopts, QLabel* label) if (!held) { kopts.guid = guid; - kopts.keycode = ""; + kopts.keycode = {}; kopts.button = idx; k->close(); } }); - connect(main.b.get(), &options::detail::bundle::reloading, k, &QDialog::close); + connect(&*main.b, &options::detail::bundle::reloading, k, &QDialog::close); pause_keybindings(true); k->exec(); pause_keybindings(false); @@ -204,8 +243,8 @@ void options_dialog::bind_key(key_opts& kopts, QLabel* label) ); if (is_crap) { - kopts.keycode = QStringLiteral(""); - kopts.guid = QStringLiteral(""); + kopts.keycode = {}; + kopts.guid = {}; kopts.button = -1; label->setText(tr("None")); } @@ -213,40 +252,152 @@ void options_dialog::bind_key(key_opts& kopts, QLabel* label) label->setText(kopts_to_string(kopts)); } -void options_dialog::doOK() +void options_dialog::switch_to_tracker_tab() +{ + if (tracker_dialog) + ui.tabWidget->setCurrentWidget(tracker_dialog); + else + eval_once(qDebug() << "options: asked for tracker tab widget with old-style widget dialog!"); +} + +void options_dialog::switch_to_proto_tab() { - if (isHidden()) // close() can return true twice in a row it seems - return; - hide(); - if (!close()) // dialog was closed already - return; + if (proto_dialog) + ui.tabWidget->setCurrentWidget(proto_dialog); + else + eval_once(qDebug() << "options: asked for proto tab widget with old-style widget dialog!"); +} +void options_dialog::switch_to_filter_tab() +{ + if (filter_dialog) + ui.tabWidget->setCurrentWidget(filter_dialog); + else + eval_once(qDebug() << "options: asked for filter tab widget with old-style widget dialog!"); +} + +void options_dialog::tracker_module_changed() +{ + if (tracker_dialog) + { + unregister_tracker(); + reload(); + delete tracker_dialog; + tracker_dialog = nullptr; + } +} + +void options_dialog::proto_module_changed() +{ + if (proto_dialog) + { + unregister_protocol(); + reload(); + delete proto_dialog; + proto_dialog = nullptr; + } +} + +void options_dialog::filter_module_changed() +{ + if (filter_dialog) + { + unregister_filter(); + reload(); + delete filter_dialog; + filter_dialog = nullptr; + } +} + +void options_dialog::register_tracker(ITracker* t) +{ + if (tracker_dialog) + tracker_dialog->register_tracker(t); +} + +void options_dialog::unregister_tracker() +{ + if (tracker_dialog) + tracker_dialog->unregister_tracker(); +} + +void options_dialog::register_protocol(IProtocol* p) +{ + if (proto_dialog) + proto_dialog->register_protocol(p); +} + +void options_dialog::unregister_protocol() +{ + if (proto_dialog) + proto_dialog->unregister_protocol(); +} + +void options_dialog::register_filter(IFilter* f) +{ + if (filter_dialog) + filter_dialog->register_filter(f); +} + +void options_dialog::unregister_filter() +{ + if (filter_dialog) + filter_dialog->unregister_filter(); +} + +using module_list = std::initializer_list<plugin_api::detail::BaseDialog*>; + +void options_dialog::save() +{ main.b->save(); ui.game_detector->save(); set_disable_translation_state(ui.disable_translation->isChecked()); - emit closing(); + + for (auto* dlg : module_list{ tracker_dialog, proto_dialog, filter_dialog }) + if (dlg) + dlg->save(); } -void options_dialog::doCancel() +void options_dialog::reload() { - if (isHidden()) // close() can return true twice in a row it seems - return; - hide(); - if (!close()) // dialog was closed already - return; + ui.game_detector->revert(); main.b->reload(); - ui.game_detector->revert(); - emit closing(); + for (auto* dlg : module_list{ tracker_dialog, proto_dialog, filter_dialog }) + if (dlg) + dlg->reload(); +} + +void options_dialog::doOK() +{ + if (isVisible()) + { + save(); + close(); + } } -void options_dialog::done(int res) +void options_dialog::doCancel() { if (isVisible()) { - if (res == QDialog::Accepted) - doOK(); - else - doCancel(); + reload(); + close(); } } + +void options_dialog::closeEvent(QCloseEvent *) +{ + reload(); + emit closing(); +} + +options_dialog::~options_dialog() +{ + if (tracker_dialog) + tracker_dialog->unregister_tracker(); + if (proto_dialog) + proto_dialog->unregister_protocol(); + if (filter_dialog) + filter_dialog->unregister_filter(); +} diff --git a/gui/options-dialog.hpp b/gui/options-dialog.hpp new file mode 100644 index 00000000..2e5586a5 --- /dev/null +++ b/gui/options-dialog.hpp @@ -0,0 +1,57 @@ +#pragma once + +#include "export.hpp" + +#include "gui/ui_options-dialog.h" +#include "logic/shortcuts.h" + +#include <functional> + +#include <QObject> +#include <QDialog> +#include <QWidget> + +class OTR_GUI_EXPORT options_dialog final : public QDialog +{ + Q_OBJECT +signals: + void closing(); +public: + options_dialog(std::unique_ptr<ITrackerDialog>& tracker_dialog_, + std::unique_ptr<IProtocolDialog>& proto_dialog_, + std::unique_ptr<IFilterDialog>& filter_dialog_, + std::function<void(bool)> pause_keybindings); + ~options_dialog() override; + inline bool embeddable() noexcept { return false; } + void switch_to_tracker_tab(); + void switch_to_proto_tab(); + void switch_to_filter_tab(); + void tracker_module_changed(); + void proto_module_changed(); + void filter_module_changed(); + void register_tracker(ITracker* t); + void unregister_tracker(); + void register_protocol(IProtocol* p); + void unregister_protocol(); + void register_filter(IFilter* f); + void unregister_filter(); + void save(); + void reload(); +private: + void closeEvent(QCloseEvent*) override; + static QString kopts_to_string(const key_opts& opts); + + main_settings main; + std::function<void(bool)> pause_keybindings; + Ui::options_dialog ui; + + ITrackerDialog* tracker_dialog = nullptr; + IProtocolDialog* proto_dialog = nullptr; + IFilterDialog* filter_dialog = nullptr; + +private slots: + void doOK(); + void doCancel(); + void bind_key(key_opts &kopts, QLabel* label); + void set_disable_translation_state(bool value); +}; diff --git a/gui/options-dialog.ui b/gui/options-dialog.ui new file mode 100644 index 00000000..9e2c0042 --- /dev/null +++ b/gui/options-dialog.ui @@ -0,0 +1,2364 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>options_dialog</class> + <widget class="QWidget" name="options_dialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>529</width> + <height>533</height> + </rect> + </property> + <property name="windowTitle"> + <string>Options</string> + </property> + <property name="windowIcon"> + <iconset> + <normaloff>images/opentrack.png</normaloff>images/opentrack.png</iconset> + </property> + <layout class="QVBoxLayout" name="verticalLayout_5"> + <property name="topMargin"> + <number>5</number> + </property> + <item> + <widget class="QTabWidget" name="tabWidget"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="currentIndex"> + <number>0</number> + </property> + <property name="usesScrollButtons"> + <bool>false</bool> + </property> + <widget class="QWidget" name="tab"> + <attribute name="title"> + <string>Shortcuts</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout"> + <item alignment="Qt::AlignTop"> + <widget class="QGroupBox" name="groupBox"> + <property name="title"> + <string>Global shortcuts</string> + </property> + <layout class="QGridLayout" name="gridLayout_8"> + <property name="leftMargin"> + <number>16</number> + </property> + <item row="1" column="1"> + <widget class="QLabel" name="toggle_text"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="_textLabel2_3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="cursor"> + <cursorShape>WhatsThisCursor</cursorShape> + </property> + <property name="toolTip"> + <string>Use current tracker pose as looking perfectly forward.</string> + </property> + <property name="text"> + <string>Center</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="7" column="4"> + <widget class="QPushButton" name="bind_toggle_tracking_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="8" column="3"> + <widget class="QLabel" name="restart_tracking_text_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="8" column="4"> + <widget class="QPushButton" name="bind_restart_tracking_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="_textLabel2_7"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="cursor"> + <cursorShape>WhatsThisCursor</cursorShape> + </property> + <property name="text"> + <string>Start tracking</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="6" column="2"> + <widget class="QPushButton" name="bind_stop"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="7" column="1"> + <widget class="QLabel" name="toggle_tracking_text"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLabel" name="center_text"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="6" column="0"> + <widget class="QLabel" name="_textLabel2_8"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="cursor"> + <cursorShape>WhatsThisCursor</cursorShape> + </property> + <property name="text"> + <string>Stop tracking</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QLabel" name="zero_text"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="_textLabel2_6"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="cursor"> + <cursorShape>WhatsThisCursor</cursorShape> + </property> + <property name="toolTip"> + <string>Keep looking forward until next zero keypress.</string> + </property> + <property name="text"> + <string>Zero</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="_textLabel2_5"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="cursor"> + <cursorShape>WhatsThisCursor</cursorShape> + </property> + <property name="toolTip"> + <string>Freeze the position returned by the tracker while this mode is active.</string> + </property> + <property name="text"> + <string>Toggle</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="_label_28"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="cursor"> + <cursorShape>WhatsThisCursor</cursorShape> + </property> + <property name="text"> + <string>Zero while held</string> + </property> + </widget> + </item> + <item row="0" column="2"> + <widget class="QPushButton" name="bind_center"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLabel" name="toggle_held_text"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QLabel" name="zero_held_text"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="2" column="2"> + <widget class="QPushButton" name="bind_toggle_held"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="4" column="2"> + <widget class="QPushButton" name="bind_zero_held"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="8" column="0"> + <widget class="QLabel" name="_textLabel2_10"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="cursor"> + <cursorShape>WhatsThisCursor</cursorShape> + </property> + <property name="text"> + <string>Restart tracking</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="8" column="1"> + <widget class="QLabel" name="restart_tracking_text"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="_label_27"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="cursor"> + <cursorShape>WhatsThisCursor</cursorShape> + </property> + <property name="text"> + <string>Toggle while held</string> + </property> + </widget> + </item> + <item row="8" column="2"> + <widget class="QPushButton" name="bind_restart_tracking"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="7" column="2"> + <widget class="QPushButton" name="bind_toggle_tracking"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="7" column="0"> + <widget class="QLabel" name="_textLabel2_9"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="cursor"> + <cursorShape>WhatsThisCursor</cursorShape> + </property> + <property name="text"> + <string>Toggle tracking</string> + </property> + <property name="wordWrap"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="5" column="2"> + <widget class="QPushButton" name="bind_start"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="1" column="2"> + <widget class="QPushButton" name="bind_toggle"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="QLabel" name="start_tracking_text"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="6" column="1"> + <widget class="QLabel" name="stop_tracking_text"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="1" column="3"> + <widget class="QLabel" name="toggle_text_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="1" column="4"> + <widget class="QPushButton" name="bind_toggle_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="0" column="3"> + <widget class="QLabel" name="center_text_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="0" column="4"> + <widget class="QPushButton" name="bind_center_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="2" column="4"> + <widget class="QPushButton" name="bind_toggle_held_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="3" column="2"> + <widget class="QPushButton" name="bind_zero"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="2" column="3"> + <widget class="QLabel" name="toggle_held_text_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="3" column="4"> + <widget class="QPushButton" name="bind_zero_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="4" column="3"> + <widget class="QLabel" name="zero_held_text_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="5" column="3"> + <widget class="QLabel" name="start_tracking_text_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="3" column="3"> + <widget class="QLabel" name="zero_text_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="4" column="4"> + <widget class="QPushButton" name="bind_zero_held_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="6" column="3"> + <widget class="QLabel" name="stop_tracking_text_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="7" column="3"> + <widget class="QLabel" name="toggle_tracking_text_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="6" column="4"> + <widget class="QPushButton" name="bind_stop_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + <item row="5" column="4"> + <widget class="QPushButton" name="bind_start_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Bind</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QFrame" name="frame_5"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Sunken</enum> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="1" column="0"> + <widget class="QCheckBox" name="disable_translation"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Disable user interface localization</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLabel" name="label_18"> + <property name="text"> + <string>Centering method</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QCheckBox" name="center_at_startup"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Center at startup</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLabel" name="label_29"> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="opentrack-res.qrc">:/images/english.png</pixmap> + </property> + </widget> + </item> + <item row="0" column="2"> + <widget class="QComboBox" name="cbox_centering"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>4</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="currentIndex"> + <number>3</number> + </property> + <item> + <property name="text"> + <string>Disabled</string> + </property> + </item> + <item> + <property name="text"> + <string>Point</string> + </property> + </item> + <item> + <property name="text"> + <string>Wireless VR 360</string> + </property> + </item> + <item> + <property name="text"> + <string>Roll compensated</string> + </property> + </item> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_11"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Minimize to tray</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="bottomMargin"> + <number>9</number> + </property> + <item> + <widget class="QCheckBox" name="trayp"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Enable tray</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="tray_start"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Minimize to tray on startup when enabled</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>1</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <widget class="QWidget" name="tab_4"> + <attribute name="title"> + <string>Output</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_4"> + <item> + <widget class="QGroupBox" name="groupBox_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Axis assignment</string> + </property> + <layout class="QGridLayout" name="gridLayout_5"> + <property name="horizontalSpacing"> + <number>12</number> + </property> + <property name="verticalSpacing"> + <number>9</number> + </property> + <item row="4" column="0"> + <widget class="QLabel" name="label_8"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>254</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Pitch</string> + </property> + </widget> + </item> + <item row="7" column="1"> + <widget class="QComboBox" name="src_y"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <item> + <property name="text"> + <string>X</string> + </property> + </item> + <item> + <property name="text"> + <string>Y</string> + </property> + </item> + <item> + <property name="text"> + <string>Z</string> + </property> + </item> + <item> + <property name="text"> + <string>Yaw</string> + </property> + </item> + <item> + <property name="text"> + <string>Pitch</string> + </property> + </item> + <item> + <property name="text"> + <string>Roll</string> + </property> + </item> + <item> + <property name="text"> + <string>Disabled</string> + </property> + </item> + <item> + <property name="text"> + <string>Relative translation only</string> + </property> + </item> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLabel" name="label_13"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>254</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Source</string> + </property> + </widget> + </item> + <item row="0" column="2"> + <widget class="QLabel" name="label_14"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>254</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Pre-invert</string> + </property> + </widget> + </item> + <item row="6" column="0"> + <widget class="QLabel" name="label_10"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>254</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>X</string> + </property> + </widget> + </item> + <item row="3" column="2"> + <widget class="QCheckBox" name="invert_yaw_pre"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="5" column="2"> + <widget class="QCheckBox" name="invert_roll_pre"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QComboBox" name="src_yaw"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <item> + <property name="text"> + <string>X</string> + </property> + </item> + <item> + <property name="text"> + <string>Y</string> + </property> + </item> + <item> + <property name="text"> + <string>Z</string> + </property> + </item> + <item> + <property name="text"> + <string>Yaw</string> + </property> + </item> + <item> + <property name="text"> + <string>Pitch</string> + </property> + </item> + <item> + <property name="text"> + <string>Roll</string> + </property> + </item> + <item> + <property name="text"> + <string>Disabled</string> + </property> + </item> + </widget> + </item> + <item row="6" column="2"> + <widget class="QCheckBox" name="invert_x_pre"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="3" column="3"> + <widget class="QCheckBox" name="invert_yaw_post"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QComboBox" name="src_pitch"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <item> + <property name="text"> + <string>X</string> + </property> + </item> + <item> + <property name="text"> + <string>Y</string> + </property> + </item> + <item> + <property name="text"> + <string>Z</string> + </property> + </item> + <item> + <property name="text"> + <string>Yaw</string> + </property> + </item> + <item> + <property name="text"> + <string>Pitch</string> + </property> + </item> + <item> + <property name="text"> + <string>Roll</string> + </property> + </item> + <item> + <property name="text"> + <string>Disabled</string> + </property> + </item> + </widget> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="label_9"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>254</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Roll</string> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="label_15"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>254</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Destination</string> + </property> + </widget> + </item> + <item row="4" column="2"> + <widget class="QCheckBox" name="invert_pitch_pre"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="6" column="1"> + <widget class="QComboBox" name="src_x"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <item> + <property name="text"> + <string>X</string> + </property> + </item> + <item> + <property name="text"> + <string>Y</string> + </property> + </item> + <item> + <property name="text"> + <string>Z</string> + </property> + </item> + <item> + <property name="text"> + <string>Yaw</string> + </property> + </item> + <item> + <property name="text"> + <string>Pitch</string> + </property> + </item> + <item> + <property name="text"> + <string>Roll</string> + </property> + </item> + <item> + <property name="text"> + <string>Disabled</string> + </property> + </item> + <item> + <property name="text"> + <string>Relative translation only</string> + </property> + </item> + </widget> + </item> + <item row="7" column="0"> + <widget class="QLabel" name="label_11"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>254</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Y</string> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="QComboBox" name="src_roll"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <item> + <property name="text"> + <string>X</string> + </property> + </item> + <item> + <property name="text"> + <string>Y</string> + </property> + </item> + <item> + <property name="text"> + <string>Z</string> + </property> + </item> + <item> + <property name="text"> + <string>Yaw</string> + </property> + </item> + <item> + <property name="text"> + <string>Pitch</string> + </property> + </item> + <item> + <property name="text"> + <string>Roll</string> + </property> + </item> + <item> + <property name="text"> + <string>Disabled</string> + </property> + </item> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label_7"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>254</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Yaw</string> + </property> + </widget> + </item> + <item row="0" column="3"> + <widget class="QLabel" name="label_19"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>254</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Post-invert</string> + </property> + </widget> + </item> + <item row="8" column="0"> + <widget class="QLabel" name="label_12"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>254</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Z</string> + </property> + </widget> + </item> + <item row="8" column="2"> + <widget class="QCheckBox" name="invert_z_pre"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="8" column="1"> + <widget class="QComboBox" name="src_z"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <item> + <property name="text"> + <string>X</string> + </property> + </item> + <item> + <property name="text"> + <string>Y</string> + </property> + </item> + <item> + <property name="text"> + <string>Z</string> + </property> + </item> + <item> + <property name="text"> + <string>Yaw</string> + </property> + </item> + <item> + <property name="text"> + <string>Pitch</string> + </property> + </item> + <item> + <property name="text"> + <string>Roll</string> + </property> + </item> + <item> + <property name="text"> + <string>Disabled</string> + </property> + </item> + <item> + <property name="text"> + <string>Relative translation only</string> + </property> + </item> + </widget> + </item> + <item row="7" column="2"> + <widget class="QCheckBox" name="invert_y_pre"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="4" column="3"> + <widget class="QCheckBox" name="invert_pitch_post"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="5" column="3"> + <widget class="QCheckBox" name="invert_roll_post"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="6" column="3"> + <widget class="QCheckBox" name="invert_x_post"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="7" column="3"> + <widget class="QCheckBox" name="invert_y_post"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="8" column="3"> + <widget class="QCheckBox" name="invert_z_post"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>255</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + <zorder>label_15</zorder> + <zorder>label_13</zorder> + <zorder>label_14</zorder> + <zorder>src_yaw</zorder> + <zorder>invert_yaw_pre</zorder> + <zorder>label_7</zorder> + <zorder>src_pitch</zorder> + <zorder>label_8</zorder> + <zorder>invert_pitch_pre</zorder> + <zorder>label_9</zorder> + <zorder>src_roll</zorder> + <zorder>invert_roll_pre</zorder> + <zorder>label_10</zorder> + <zorder>src_x</zorder> + <zorder>invert_x_pre</zorder> + <zorder>label_11</zorder> + <zorder>src_y</zorder> + <zorder>invert_y_pre</zorder> + <zorder>label_12</zorder> + <zorder>src_z</zorder> + <zorder>invert_z_pre</zorder> + <zorder>label_19</zorder> + <zorder>invert_yaw_post</zorder> + <zorder>invert_pitch_post</zorder> + <zorder>invert_roll_post</zorder> + <zorder>invert_x_post</zorder> + <zorder>invert_y_post</zorder> + <zorder>invert_z_post</zorder> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_6"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Custom center pose</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <layout class="QVBoxLayout" name="verticalLayout_6"> + <item> + <widget class="QLabel" name="label_22"> + <property name="text"> + <string>Alter the centered position sent to games. Useful if the default position is too much downward or upward.</string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="margin"> + <number>2</number> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_7"> + <property name="styleSheet"> + <string notr="true">QGroupBox { + border: 0; +}</string> + </property> + <property name="title"> + <string/> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="flat"> + <bool>false</bool> + </property> + <property name="checkable"> + <bool>false</bool> + </property> + <layout class="QGridLayout" name="gridLayout_3"> + <item row="2" column="1"> + <widget class="QDoubleSpinBox" name="pos_rz"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="suffix"> + <string>°</string> + </property> + <property name="decimals"> + <number>2</number> + </property> + <property name="minimum"> + <double>-180.000000000000000</double> + </property> + <property name="maximum"> + <double>180.000000000000000</double> + </property> + </widget> + </item> + <item row="2" column="3"> + <widget class="QDoubleSpinBox" name="pos_tz"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="suffix"> + <string> cm</string> + </property> + <property name="decimals"> + <number>3</number> + </property> + <property name="minimum"> + <double>-500.000000000000000</double> + </property> + <property name="maximum"> + <double>500.000000000000000</double> + </property> + </widget> + </item> + <item row="0" column="2"> + <widget class="QLabel" name="label_4"> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="text"> + <string>X</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="0" column="3"> + <widget class="QDoubleSpinBox" name="pos_tx"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="suffix"> + <string> cm</string> + </property> + <property name="decimals"> + <number>3</number> + </property> + <property name="minimum"> + <double>-500.000000000000000</double> + </property> + <property name="maximum"> + <double>500.000000000000000</double> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Pitch</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="1" column="2"> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string>Y</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QDoubleSpinBox" name="pos_ry"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="suffix"> + <string>°</string> + </property> + <property name="decimals"> + <number>2</number> + </property> + <property name="minimum"> + <double>-180.000000000000000</double> + </property> + <property name="maximum"> + <double>180.000000000000000</double> + </property> + </widget> + </item> + <item row="2" column="2"> + <widget class="QLabel" name="label_6"> + <property name="text"> + <string>Z</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Roll</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="1" column="3"> + <widget class="QDoubleSpinBox" name="pos_ty"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="suffix"> + <string> cm</string> + </property> + <property name="decimals"> + <number>3</number> + </property> + <property name="minimum"> + <double>-500.000000000000000</double> + </property> + <property name="maximum"> + <double>500.000000000000000</double> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Yaw</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QDoubleSpinBox" name="pos_rx"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="suffix"> + <string>°</string> + </property> + <property name="decimals"> + <number>2</number> + </property> + <property name="minimum"> + <double>-180.000000000000000</double> + </property> + <property name="maximum"> + <double>180.000000000000000</double> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_10"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>50</height> + </size> + </property> + <property name="title"> + <string>CSV Data Logging</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_11"> + <item> + <widget class="QCheckBox" name="tracklogging_enabled"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>1</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Enable - You will be asked for a filename whenever tracking starts</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer_3"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>1</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <widget class="QWidget" name="tab_2"> + <attribute name="title"> + <string>Relative translation</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QGroupBox" name="groupBox_"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="title"> + <string>Relative translation</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <layout class="QVBoxLayout" name="verticalLayout_7"> + <item> + <widget class="QLabel" name="label_16"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>With relative mode on, translation is applied after rotation. For example, rotating +180 degrees yaw and moving backwards results in moving forward as a result of that rotation.</string> + </property> + <property name="alignment"> + <set>Qt::AlignJustify|Qt::AlignVCenter</set> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="margin"> + <number>2</number> + </property> + </widget> + </item> + <item> + <widget class="QWidget" name="widget" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="label_17"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>10</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Mode</string> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="reltrans_mode"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>4</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="currentIndex"> + <number>0</number> + </property> + <item> + <property name="text"> + <string>Disabled</string> + </property> + </item> + <item> + <property name="text"> + <string>Enabled</string> + </property> + </item> + <item> + <property name="text"> + <string>Enabled when not aiming</string> + </property> + </item> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QFrame" name="frame_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QGridLayout" name="gridLayout"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <item row="2" column="0"> + <widget class="QCheckBox" name="tcomp_ty_disable"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>3</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string>Disable for Y</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QCheckBox" name="tcomp_tx_disable"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>3</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string>Disable for X</string> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QCheckBox" name="tcomp_src_roll_disable"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Disable effect by roll</string> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QCheckBox" name="tcomp_tz_disable"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>3</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string>Disable for Z (for zoom on Z axis)</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QCheckBox" name="tcomp_src_pitch_disable"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Disable effect by pitch</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QCheckBox" name="tcomp_src_yaw_disable"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>2</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Disable effect by yaw</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_12"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Neck displacement</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <layout class="QVBoxLayout" name="verticalLayout_13"> + <property name="spacing"> + <number>7</number> + </property> + <item> + <widget class="QLabel" name="label_33"> + <property name="text"> + <string>Eyes will be offset from the pivot of rotation, assumed to be the neck. It also works with relative translation disabled.</string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="margin"> + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="QFrame" name="frame_4"> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <layout class="QGridLayout" name="gridLayout_9"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>9</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <item row="0" column="0"> + <widget class="QCheckBox" name="neck_enable"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="text"> + <string>Enable</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QSpinBox" name="neck_z"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>4</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="suffix"> + <string> cm</string> + </property> + <property name="minimum"> + <number>-100</number> + </property> + <property name="maximum"> + <number>100</number> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_32"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>15</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Forward from center of rotation</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <widget class="QWidget" name="tab_5"> + <attribute name="title"> + <string>Game detection</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_9"> + <item> + <widget class="QGroupBox" name="groupBox_1"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Game detection</string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <layout class="QVBoxLayout" name="verticalLayout_12"> + <item> + <widget class="QLabel" name="label_24"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Start tracking automatically when a game starts with selected profile, and stop when the game exits.</string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="process_detector" name="game_detector" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </widget> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>process_detector</class> + <extends>QWidget</extends> + <header>gui/process_detector.h</header> + </customwidget> + </customwidgets> + <tabstops> + <tabstop>tabWidget</tabstop> + <tabstop>bind_center</tabstop> + <tabstop>bind_toggle</tabstop> + <tabstop>bind_toggle_held</tabstop> + <tabstop>bind_zero</tabstop> + <tabstop>bind_zero_held</tabstop> + <tabstop>bind_start</tabstop> + <tabstop>bind_stop</tabstop> + <tabstop>bind_toggle_tracking</tabstop> + <tabstop>bind_restart_tracking</tabstop> + <tabstop>bind_center_2</tabstop> + <tabstop>bind_toggle_2</tabstop> + <tabstop>bind_toggle_held_2</tabstop> + <tabstop>bind_zero_2</tabstop> + <tabstop>bind_zero_held_2</tabstop> + <tabstop>bind_start_2</tabstop> + <tabstop>bind_stop_2</tabstop> + <tabstop>bind_toggle_tracking_2</tabstop> + <tabstop>bind_restart_tracking_2</tabstop> + <tabstop>center_at_startup</tabstop> + <tabstop>cbox_centering</tabstop> + <tabstop>disable_translation</tabstop> + <tabstop>trayp</tabstop> + <tabstop>tray_start</tabstop> + <tabstop>src_yaw</tabstop> + <tabstop>invert_yaw_pre</tabstop> + <tabstop>invert_yaw_post</tabstop> + <tabstop>src_pitch</tabstop> + <tabstop>invert_pitch_pre</tabstop> + <tabstop>invert_pitch_post</tabstop> + <tabstop>src_roll</tabstop> + <tabstop>invert_roll_pre</tabstop> + <tabstop>invert_roll_post</tabstop> + <tabstop>src_x</tabstop> + <tabstop>invert_x_pre</tabstop> + <tabstop>invert_x_post</tabstop> + <tabstop>src_y</tabstop> + <tabstop>invert_y_pre</tabstop> + <tabstop>invert_y_post</tabstop> + <tabstop>src_z</tabstop> + <tabstop>invert_z_pre</tabstop> + <tabstop>invert_z_post</tabstop> + <tabstop>pos_rx</tabstop> + <tabstop>pos_ry</tabstop> + <tabstop>pos_rz</tabstop> + <tabstop>pos_tx</tabstop> + <tabstop>pos_ty</tabstop> + <tabstop>pos_tz</tabstop> + <tabstop>tracklogging_enabled</tabstop> + <tabstop>reltrans_mode</tabstop> + <tabstop>tcomp_tx_disable</tabstop> + <tabstop>tcomp_ty_disable</tabstop> + <tabstop>tcomp_tz_disable</tabstop> + <tabstop>tcomp_src_yaw_disable</tabstop> + <tabstop>tcomp_src_pitch_disable</tabstop> + <tabstop>tcomp_src_roll_disable</tabstop> + <tabstop>neck_enable</tabstop> + <tabstop>neck_z</tabstop> + </tabstops> + <resources> + <include location="opentrack-res.qrc"/> + </resources> + <connections/> + <slots> + <slot>startEngineClicked()</slot> + <slot>stopEngineClicked()</slot> + <slot>cameraSettingsClicked()</slot> + </slots> +</ui> diff --git a/gui/process_detector.cpp b/gui/process_detector.cpp index b29df7fb..74e8caac 100644 --- a/gui/process_detector.cpp +++ b/gui/process_detector.cpp @@ -18,55 +18,70 @@ #include <QHash> #include <QPushButton> #include <QSettings> +#include <QtEvents> -static constexpr inline auto RECORD_SEPARATOR = QChar(char(0x1e)); // RS ^] -static constexpr inline auto UNIT_SEPARATOR = QChar(char(0x1f)); // US ^_ +static constexpr auto RECORD_SEPARATOR = QChar(char(0x1e)); // RS ^] +static constexpr auto UNIT_SEPARATOR = QChar(char(0x1f)); // US ^_ using namespace options; +using namespace options::globals; void proc_detector_settings::set_game_list(const QString &game_list) { - group::with_global_settings_object([&](QSettings& settings) { + with_global_settings_object([&](QSettings& settings) { settings.setValue("executable-list", game_list); + mark_global_ini_modified(); }); } QString proc_detector_settings::get_game_list() { - return group::with_global_settings_object([&](QSettings& settings) { + return with_global_settings_object([&](QSettings& settings) { return settings.value("executable-list").toString(); }); } bool proc_detector_settings::is_enabled() { - return group::with_global_settings_object([&](QSettings& settings) { + return with_global_settings_object([&](QSettings& settings) { return settings.value("executable-detector-enabled", false).toBool(); }); } void proc_detector_settings::set_is_enabled(bool enabled) { - group::with_global_settings_object([&](QSettings& settings) { + with_global_settings_object([&](QSettings& settings) { settings.setValue("executable-detector-enabled", enabled); + mark_global_ini_modified(); }); } +#ifdef __GNUG__ +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + QHash<QString, QString> proc_detector_settings::split_process_names() { - QHash<QString, QString> ret; QString str = get_game_list(); - QStringList pairs = str.split(RECORD_SEPARATOR, QString::SkipEmptyParts); - for (auto pair : pairs) + constexpr auto split_flag = +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + Qt::SkipEmptyParts; +#else + QString::SkipEmptyParts; +#endif + QStringList pairs = str.split(RECORD_SEPARATOR, split_flag); + QHash<QString, QString> ret; + ret.reserve(pairs.size() * 2); + for (auto const& pair : pairs) { - QList<QString> tmp = pair.split(UNIT_SEPARATOR); + QStringList tmp = pair.split(UNIT_SEPARATOR); if (tmp.count() != 2) continue; if (tmp[0].contains(UNIT_SEPARATOR) || tmp[0].contains(RECORD_SEPARATOR)) continue; if (tmp[1].contains(UNIT_SEPARATOR) || tmp[1].contains(RECORD_SEPARATOR)) continue; - if (tmp[0] == QLatin1String("") || tmp[1] == QLatin1String("")) + if (tmp[0].isEmpty() || tmp[1].isEmpty()) continue; ret[tmp[0]] = tmp[1]; } @@ -75,29 +90,27 @@ QHash<QString, QString> proc_detector_settings::split_process_names() void BrowseButton::browse() { - QFileDialog dialog(this); - dialog.setFileMode(QFileDialog::ExistingFile); - QString dir_path = QFileInfo(group::ini_pathname()).absolutePath(); - QString filename = dialog.getOpenFileName( - this, - tr("Set executable name"), - dir_path, - tr("Executable (*.exe);;All Files (*)")); + QString dir_path = QFileInfo(ini_pathname()).absolutePath(); + QString filename = QFileDialog::getOpenFileName( + this, + tr("Set executable name"), + dir_path, + tr("Executable (*.exe);;All Files (*)")); QDir::setCurrent(OPENTRACK_BASE_PATH); filename = QFileInfo(filename).fileName(); if (!filename.isNull()) twi->setText(filename); } -int process_detector::add_row(QString exe_name, QString profile) +int process_detector::add_row(QString const& exe_name, QString const& profile) { int i = ui.tableWidget->rowCount(); ui.tableWidget->insertRow(i); QComboBox* cb = new QComboBox(); cb->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum); - cb->addItem(""); - cb->addItems(group::ini_list()); + cb->addItems(ini_list()); + cb->setCurrentText(ini_filename()); ui.tableWidget->setCellWidget(i, 1, cb); QTableWidgetItem* twi = new QTableWidgetItem(exe_name); @@ -106,7 +119,7 @@ int process_detector::add_row(QString exe_name, QString profile) { BrowseButton* b = new BrowseButton(twi); b->setText("..."); - QObject::connect(b, SIGNAL(clicked()), b, SLOT(browse())); + QObject::connect(b, &BrowseButton::clicked, b, &BrowseButton::browse); ui.tableWidget->setCellWidget(i, 2, b); } @@ -115,13 +128,14 @@ int process_detector::add_row(QString exe_name, QString profile) return i; } -void process_detector::add_items() +void process_detector::load_rows() { + for (int k = ui.tableWidget->size().height() - 1; k >= 0; k--) + ui.tableWidget->removeRow(k); auto names = s.split_process_names(); - ui.tableWidget->clearContents(); auto keys = names.keys(); std::sort(keys.begin(), keys.end()); - for (auto n : keys) + for (auto const& n : keys) add_row(n, names[n]); } @@ -131,13 +145,10 @@ process_detector::process_detector(QWidget* parent) : QWidget(parent) connect(ui.add, SIGNAL(clicked()), this, SLOT(add())); connect(ui.remove, SIGNAL(clicked()), this, SLOT(remove())); - add_items(); + load_rows(); QResizeEvent e(ui.tableWidget->size(), ui.tableWidget->size()); ui.tableWidget->resizeEvent(&e); - - proc_detector_settings s; - ui.enabled->setChecked(s.is_enabled()); } @@ -148,7 +159,10 @@ void process_detector::save() for (int i = 0; i < ui.tableWidget->rowCount(); i++) { auto exe = ui.tableWidget->item(i, 0)->text(); - auto profile = reinterpret_cast<QComboBox*>(ui.tableWidget->cellWidget(i, 1))->currentText(); + auto widget = qobject_cast<QComboBox*>(ui.tableWidget->cellWidget(i, 1)); + if (!widget) + continue; + auto profile = widget->currentText(); str += RECORD_SEPARATOR + exe + UNIT_SEPARATOR + profile; } @@ -158,6 +172,8 @@ void process_detector::save() void process_detector::revert() { + load_rows(); + ui.enabled->setChecked(s.is_enabled()); } void process_detector::add() @@ -174,14 +190,14 @@ void process_detector::remove() bool process_detector_worker::should_stop() { - if (last_exe_name == "") + if (last_exe_name == QString()) return false; proc_detector_settings s; if (!s.is_enabled()) { - last_exe_name = ""; + last_exe_name = QString{}; return false; } @@ -190,17 +206,17 @@ bool process_detector_worker::should_stop() if (exe_list.contains(last_exe_name)) return false; - last_exe_name = ""; + last_exe_name = QString{}; return true; } -bool process_detector_worker::config_to_start(QString& str) +bool process_detector_worker::profile_to_start(QString& str) { proc_detector_settings s; if (!s.is_enabled()) { - last_exe_name = ""; + last_exe_name = QString{}; return false; } @@ -209,20 +225,18 @@ bool process_detector_worker::config_to_start(QString& str) // assuming manual stop by user button click. // don't automatically start again while the same process is running. - if (last_exe_name != "" && exe_list.contains(last_exe_name)) + if (!last_exe_name.isEmpty() && exe_list.contains(last_exe_name)) return false; // it's gone, we can start automatically again - last_exe_name = ""; + last_exe_name = QString(); - for (auto& name : exe_list) - { + for (auto&& name : exe_list) if (filenames.contains(name)) { - last_exe_name = name; str = filenames[name]; - return str != ""; + last_exe_name = name; + return str != QString{}; } - } return false; } diff --git a/gui/process_detector.h b/gui/process_detector.h index 393dafb3..b57d859a 100644 --- a/gui/process_detector.h +++ b/gui/process_detector.h @@ -10,22 +10,22 @@ #include "export.hpp" -#include <QObject> -#include <QWidget> -#include <QTableWidget> -#include <QResizeEvent> - #include "gui/ui_process_widget.h" #include "process-detector-fancy-table.hpp" #include "options/options.hpp" +#include <QObject> +#include <QString> +#include <QWidget> +#include <QTableWidget> + struct OTR_GUI_EXPORT proc_detector_settings { - QHash<QString, QString> split_process_names(); - QString get_game_list(); - void set_game_list(const QString& game_list); - bool is_enabled(); - void set_is_enabled(bool enabled); + static QHash<QString, QString> split_process_names(); + static QString get_game_list(); + static void set_game_list(const QString& game_list); + static bool is_enabled(); + static void set_is_enabled(bool enabled); }; class OTR_GUI_EXPORT process_detector final : public QWidget @@ -35,8 +35,8 @@ class OTR_GUI_EXPORT process_detector final : public QWidget Ui_process_detector ui; proc_detector_settings s; - int add_row(QString exe_name = "...", QString profile = ""); - void add_items(); + int add_row(const QString& exe_name = "...", const QString& profile = ""); + void load_rows(); public: process_detector(QWidget* parent = nullptr); public slots: @@ -61,10 +61,10 @@ public slots: class OTR_GUI_EXPORT process_detector_worker : QObject { Q_OBJECT - proc_detector_settings s; QString last_exe_name; + proc_detector_settings s; public: - bool config_to_start(QString& s); + [[nodiscard]] bool profile_to_start(QString& str); bool should_stop(); }; diff --git a/gui/process_widget.ui b/gui/process_widget.ui index 9e7b4973..005b0d9b 100644 --- a/gui/process_widget.ui +++ b/gui/process_widget.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>366</width> - <height>325</height> + <height>380</height> </rect> </property> <property name="windowTitle"> @@ -24,7 +24,7 @@ <item> <widget class="FancyTable" name="tableWidget"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -83,12 +83,15 @@ </property> <layout class="QHBoxLayout" name="horizontalLayout"> <property name="topMargin"> - <number>5</number> + <number>4</number> + </property> + <property name="bottomMargin"> + <number>4</number> </property> <item> <widget class="QPushButton" name="add"> <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -108,7 +111,7 @@ <item> <widget class="QPushButton" name="remove"> <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> diff --git a/gui/settings-dialog.ui b/gui/settings-dialog.ui deleted file mode 100644 index 6333692a..00000000 --- a/gui/settings-dialog.ui +++ /dev/null @@ -1,2202 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>options_dialog</class> - <widget class="QWidget" name="options_dialog"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>548</width> - <height>599</height> - </rect> - </property> - <property name="windowTitle"> - <string>Options</string> - </property> - <property name="windowIcon"> - <iconset> - <normaloff>images/opentrack.png</normaloff>images/opentrack.png</iconset> - </property> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <property name="topMargin"> - <number>5</number> - </property> - <item> - <widget class="QTabWidget" name="tabWidget"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="currentIndex"> - <number>0</number> - </property> - <property name="usesScrollButtons"> - <bool>false</bool> - </property> - <widget class="QWidget" name="tab"> - <attribute name="title"> - <string>Shortcuts</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QGroupBox" name="groupBox_8"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Global shortcuts</string> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - <layout class="QVBoxLayout" name="verticalLayout_8"> - <item> - <widget class="QLabel" name="label_23"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string><html><head/><body><p><span style=" font-weight:600;">Center</span> - use current pose as looking perfectly forward.<br/><span style=" font-weight:600;">Toggle</span> - keep looking at same spot until next toggle keypress.<br/><span style=" font-weight:600;">Zero</span> - keep looking forward until next zero keypress.<br/></p></body></html></string> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox"> - <property name="styleSheet"> - <string notr="true">QGroupBox { border: 0; }</string> - </property> - <layout class="QGridLayout" name="gridLayout_8"> - <item row="1" column="1"> - <widget class="QLabel" name="toggle_text"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="_textLabel2_3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <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="7" column="4"> - <widget class="QPushButton" name="bind_toggle_tracking_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="8" column="3"> - <widget class="QLabel" name="restart_tracking_text_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="8" column="4"> - <widget class="QPushButton" name="bind_restart_tracking_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="5" column="0"> - <widget class="QLabel" name="_textLabel2_7"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Start tracking</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="6" column="2"> - <widget class="QPushButton" name="bind_stop"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="7" column="1"> - <widget class="QLabel" name="toggle_tracking_text"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLabel" name="center_text"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="6" column="0"> - <widget class="QLabel" name="_textLabel2_8"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Stop tracking</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QLabel" name="zero_text"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="_textLabel2_6"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <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="1" column="0"> - <widget class="QLabel" name="_textLabel2_5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <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="4" column="0"> - <widget class="QLabel" name="_label_28"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Zero while held</string> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QPushButton" name="bind_center"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QLabel" name="toggle_held_text"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="4" column="1"> - <widget class="QLabel" name="zero_held_text"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="2" column="2"> - <widget class="QPushButton" name="bind_toggle_held"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="4" column="2"> - <widget class="QPushButton" name="bind_zero_held"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="8" column="0"> - <widget class="QLabel" name="_textLabel2_10"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Restart tracking</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="8" column="1"> - <widget class="QLabel" name="restart_tracking_text"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="_label_27"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Toggle while held</string> - </property> - </widget> - </item> - <item row="8" column="2"> - <widget class="QPushButton" name="bind_restart_tracking"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="7" column="2"> - <widget class="QPushButton" name="bind_toggle_tracking"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="7" column="0"> - <widget class="QLabel" name="_textLabel2_9"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Toggle tracking</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="5" column="2"> - <widget class="QPushButton" name="bind_start"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QPushButton" name="bind_toggle"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="5" column="1"> - <widget class="QLabel" name="start_tracking_text"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="6" column="1"> - <widget class="QLabel" name="stop_tracking_text"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="1" column="3"> - <widget class="QLabel" name="toggle_text_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="1" column="4"> - <widget class="QPushButton" name="bind_toggle_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="0" column="3"> - <widget class="QLabel" name="center_text_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="0" column="4"> - <widget class="QPushButton" name="bind_center_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="2" column="4"> - <widget class="QPushButton" name="bind_toggle_held_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="3" column="2"> - <widget class="QPushButton" name="bind_zero"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="2" column="3"> - <widget class="QLabel" name="toggle_held_text_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="3" column="4"> - <widget class="QPushButton" name="bind_zero_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="4" column="3"> - <widget class="QLabel" name="zero_held_text_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="5" column="3"> - <widget class="QLabel" name="start_tracking_text_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="3" column="3"> - <widget class="QLabel" name="zero_text_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="4" column="4"> - <widget class="QPushButton" name="bind_zero_held_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="6" column="3"> - <widget class="QLabel" name="stop_tracking_text_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="7" column="3"> - <widget class="QLabel" name="toggle_tracking_text_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="6" column="4"> - <widget class="QPushButton" name="bind_stop_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - <item row="5" column="4"> - <widget class="QPushButton" name="bind_start_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Bind</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QFrame" name="frame_5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Sunken</enum> - </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="0"> - <widget class="QCheckBox" name="center_at_startup"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Center at startup</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QCheckBox" name="disable_translation"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Never translate the application interface</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLabel" name="label_29"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="opentrack-res.qrc">:/images/english.png</pixmap> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_11"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Minimize to tray</string> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <property name="bottomMargin"> - <number>9</number> - </property> - <item> - <widget class="QCheckBox" name="trayp"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Enable tray</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="tray_start"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Minimize to tray on startup when enabled</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_4"> - <attribute name="title"> - <string>Output</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <property name="topMargin"> - <number>0</number> - </property> - <item> - <widget class="QGroupBox" name="groupBox_4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="font"> - <font> - <kerning>true</kerning> - </font> - </property> - <property name="title"> - <string>Output remap</string> - </property> - <property name="alignment"> - <set>Qt::AlignHCenter|Qt::AlignTop</set> - </property> - <property name="flat"> - <bool>false</bool> - </property> - <property name="checkable"> - <bool>false</bool> - </property> - <layout class="QGridLayout" name="gridLayout_4"> - <item row="1" column="0"> - <widget class="QGroupBox" name="groupBox_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="styleSheet"> - <string notr="true">QGroupBox -{ - border: 0; -}</string> - </property> - <layout class="QGridLayout" name="gridLayout_5"> - <property name="horizontalSpacing"> - <number>12</number> - </property> - <property name="verticalSpacing"> - <number>9</number> - </property> - <item row="7" column="1"> - <widget class="QComboBox" name="src_y"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <item> - <property name="text"> - <string>X</string> - </property> - </item> - <item> - <property name="text"> - <string>Y</string> - </property> - </item> - <item> - <property name="text"> - <string>Z</string> - </property> - </item> - <item> - <property name="text"> - <string>Yaw</string> - </property> - </item> - <item> - <property name="text"> - <string>Pitch</string> - </property> - </item> - <item> - <property name="text"> - <string>Roll</string> - </property> - </item> - <item> - <property name="text"> - <string>Disabled</string> - </property> - </item> - <item> - <property name="text"> - <string>Relative translation only</string> - </property> - </item> - </widget> - </item> - <item row="6" column="0"> - <widget class="QLabel" name="label_10"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>254</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>X</string> - </property> - </widget> - </item> - <item row="5" column="0"> - <widget class="QLabel" name="label_9"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>254</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Roll</string> - </property> - </widget> - </item> - <item row="7" column="2"> - <widget class="QCheckBox" name="invert_y"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="4" column="2"> - <widget class="QCheckBox" name="invert_pitch"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_7"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>254</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Yaw</string> - </property> - </widget> - </item> - <item row="6" column="2"> - <widget class="QCheckBox" name="invert_x"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLabel" name="label_13"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>254</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Source</string> - </property> - </widget> - </item> - <item row="5" column="1"> - <widget class="QComboBox" name="src_roll"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <item> - <property name="text"> - <string>X</string> - </property> - </item> - <item> - <property name="text"> - <string>Y</string> - </property> - </item> - <item> - <property name="text"> - <string>Z</string> - </property> - </item> - <item> - <property name="text"> - <string>Yaw</string> - </property> - </item> - <item> - <property name="text"> - <string>Pitch</string> - </property> - </item> - <item> - <property name="text"> - <string>Roll</string> - </property> - </item> - <item> - <property name="text"> - <string>Disabled</string> - </property> - </item> - </widget> - </item> - <item row="3" column="2"> - <widget class="QCheckBox" name="invert_yaw"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="4" column="1"> - <widget class="QComboBox" name="src_pitch"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <item> - <property name="text"> - <string>X</string> - </property> - </item> - <item> - <property name="text"> - <string>Y</string> - </property> - </item> - <item> - <property name="text"> - <string>Z</string> - </property> - </item> - <item> - <property name="text"> - <string>Yaw</string> - </property> - </item> - <item> - <property name="text"> - <string>Pitch</string> - </property> - </item> - <item> - <property name="text"> - <string>Roll</string> - </property> - </item> - <item> - <property name="text"> - <string>Disabled</string> - </property> - </item> - </widget> - </item> - <item row="8" column="0"> - <widget class="QLabel" name="label_12"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>254</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Z</string> - </property> - </widget> - </item> - <item row="8" column="2"> - <widget class="QCheckBox" name="invert_z"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="8" column="1"> - <widget class="QComboBox" name="src_z"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <item> - <property name="text"> - <string>X</string> - </property> - </item> - <item> - <property name="text"> - <string>Y</string> - </property> - </item> - <item> - <property name="text"> - <string>Z</string> - </property> - </item> - <item> - <property name="text"> - <string>Yaw</string> - </property> - </item> - <item> - <property name="text"> - <string>Pitch</string> - </property> - </item> - <item> - <property name="text"> - <string>Roll</string> - </property> - </item> - <item> - <property name="text"> - <string>Disabled</string> - </property> - </item> - <item> - <property name="text"> - <string>Relative translation only</string> - </property> - </item> - </widget> - </item> - <item row="3" column="1"> - <widget class="QComboBox" name="src_yaw"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <item> - <property name="text"> - <string>X</string> - </property> - </item> - <item> - <property name="text"> - <string>Y</string> - </property> - </item> - <item> - <property name="text"> - <string>Z</string> - </property> - </item> - <item> - <property name="text"> - <string>Yaw</string> - </property> - </item> - <item> - <property name="text"> - <string>Pitch</string> - </property> - </item> - <item> - <property name="text"> - <string>Roll</string> - </property> - </item> - <item> - <property name="text"> - <string>Disabled</string> - </property> - </item> - </widget> - </item> - <item row="5" column="2"> - <widget class="QCheckBox" name="invert_roll"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>255</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QLabel" name="label_14"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>254</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Invert</string> - </property> - </widget> - </item> - <item row="6" column="1"> - <widget class="QComboBox" name="src_x"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <item> - <property name="text"> - <string>X</string> - </property> - </item> - <item> - <property name="text"> - <string>Y</string> - </property> - </item> - <item> - <property name="text"> - <string>Z</string> - </property> - </item> - <item> - <property name="text"> - <string>Yaw</string> - </property> - </item> - <item> - <property name="text"> - <string>Pitch</string> - </property> - </item> - <item> - <property name="text"> - <string>Roll</string> - </property> - </item> - <item> - <property name="text"> - <string>Disabled</string> - </property> - </item> - <item> - <property name="text"> - <string>Relative translation only</string> - </property> - </item> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="label_15"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>254</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Destination</string> - </property> - </widget> - </item> - <item row="7" column="0"> - <widget class="QLabel" name="label_11"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>254</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Y</string> - </property> - </widget> - </item> - <item row="4" column="0"> - <widget class="QLabel" name="label_8"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>254</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Pitch</string> - </property> - </widget> - </item> - </layout> - <zorder>label_15</zorder> - <zorder>label_13</zorder> - <zorder>label_14</zorder> - <zorder>src_yaw</zorder> - <zorder>invert_yaw</zorder> - <zorder>label_7</zorder> - <zorder>src_pitch</zorder> - <zorder>label_8</zorder> - <zorder>invert_pitch</zorder> - <zorder>label_9</zorder> - <zorder>src_roll</zorder> - <zorder>invert_roll</zorder> - <zorder>label_10</zorder> - <zorder>src_x</zorder> - <zorder>invert_x</zorder> - <zorder>label_11</zorder> - <zorder>src_y</zorder> - <zorder>invert_y</zorder> - <zorder>label_12</zorder> - <zorder>src_z</zorder> - <zorder>invert_z</zorder> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="label_20"> - <property name="text"> - <string>Assign input axis to output axis.</string> - </property> - <property name="alignment"> - <set>Qt::AlignJustify|Qt::AlignVCenter</set> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_6"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Custom center pose</string> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - <layout class="QVBoxLayout" name="verticalLayout_6"> - <item> - <widget class="QLabel" name="label_22"> - <property name="text"> - <string>Alter the centered position sent to games. Useful if the default position is too much downward or upward.</string> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - <property name="margin"> - <number>2</number> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_7"> - <property name="styleSheet"> - <string notr="true">QGroupBox { - border: 0; -}</string> - </property> - <property name="title"> - <string/> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - <property name="flat"> - <bool>false</bool> - </property> - <property name="checkable"> - <bool>false</bool> - </property> - <layout class="QGridLayout" name="gridLayout_3"> - <item row="2" column="1"> - <widget class="QDoubleSpinBox" name="pos_rz"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="suffix"> - <string>°</string> - </property> - <property name="decimals"> - <number>2</number> - </property> - <property name="minimum"> - <double>-180.000000000000000</double> - </property> - <property name="maximum"> - <double>180.000000000000000</double> - </property> - </widget> - </item> - <item row="2" column="3"> - <widget class="QDoubleSpinBox" name="pos_tz"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="suffix"> - <string> cm</string> - </property> - <property name="decimals"> - <number>3</number> - </property> - <property name="minimum"> - <double>-500.000000000000000</double> - </property> - <property name="maximum"> - <double>500.000000000000000</double> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QLabel" name="label_4"> - <property name="text"> - <string>X</string> - </property> - </widget> - </item> - <item row="0" column="3"> - <widget class="QDoubleSpinBox" name="pos_tx"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="suffix"> - <string> cm</string> - </property> - <property name="decimals"> - <number>3</number> - </property> - <property name="minimum"> - <double>-500.000000000000000</double> - </property> - <property name="maximum"> - <double>500.000000000000000</double> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Pitch</string> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QLabel" name="label_5"> - <property name="text"> - <string>Y</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QDoubleSpinBox" name="pos_ry"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="suffix"> - <string>°</string> - </property> - <property name="decimals"> - <number>2</number> - </property> - <property name="minimum"> - <double>-180.000000000000000</double> - </property> - <property name="maximum"> - <double>180.000000000000000</double> - </property> - </widget> - </item> - <item row="2" column="2"> - <widget class="QLabel" name="label_6"> - <property name="text"> - <string>Z</string> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string>Roll</string> - </property> - </widget> - </item> - <item row="1" column="3"> - <widget class="QDoubleSpinBox" name="pos_ty"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="suffix"> - <string> cm</string> - </property> - <property name="decimals"> - <number>3</number> - </property> - <property name="minimum"> - <double>-500.000000000000000</double> - </property> - <property name="maximum"> - <double>500.000000000000000</double> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Yaw</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QDoubleSpinBox" name="pos_rx"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="suffix"> - <string>°</string> - </property> - <property name="decimals"> - <number>2</number> - </property> - <property name="minimum"> - <double>-180.000000000000000</double> - </property> - <property name="maximum"> - <double>180.000000000000000</double> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_10"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>50</height> - </size> - </property> - <property name="title"> - <string>CSV Data Logging</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_11"> - <item> - <widget class="QCheckBox" name="tracklogging_enabled"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>1</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Enable - You will be asked for a filename whenever tracking starts</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_2"> - <attribute name="title"> - <string>Relative translation</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QGroupBox" name="groupBox_"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="title"> - <string>Relative translation</string> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - <layout class="QVBoxLayout" name="verticalLayout_7"> - <item> - <widget class="QLabel" name="label_16"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>With relative mode on, translation is applied after rotation. For example, rotating +180 degrees yaw and moving backwards results in moving forward as a result of that rotation.</string> - </property> - <property name="alignment"> - <set>Qt::AlignJustify|Qt::AlignVCenter</set> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - <property name="margin"> - <number>2</number> - </property> - </widget> - </item> - <item> - <widget class="QWidget" name="widget" native="true"> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLabel" name="label_17"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>10</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Mode</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="reltrans_mode"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>4</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <item> - <property name="text"> - <string>Disabled</string> - </property> - </item> - <item> - <property name="text"> - <string>Enabled</string> - </property> - </item> - <item> - <property name="text"> - <string>Enabled when not aiming</string> - </property> - </item> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QFrame" name="frame_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QGridLayout" name="gridLayout"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <property name="spacing"> - <number>0</number> - </property> - <item row="2" column="0"> - <widget class="QCheckBox" name="tcomp_ty_disable"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>3</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="text"> - <string>Disable for Y</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QCheckBox" name="tcomp_tx_disable"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>3</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="text"> - <string>Disable for X</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QCheckBox" name="tcomp_src_roll_disable"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>2</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Disable effect by roll</string> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QCheckBox" name="tcomp_tz_disable"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>3</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="text"> - <string>Disable for Z (for zoom on Z axis)</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QCheckBox" name="tcomp_src_pitch_disable"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>2</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Disable effect by pitch</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QCheckBox" name="tcomp_src_yaw_disable"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>2</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Disable effect by yaw</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_12"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Neck displacement</string> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - <layout class="QVBoxLayout" name="verticalLayout_13"> - <property name="spacing"> - <number>7</number> - </property> - <item> - <widget class="QLabel" name="label_33"> - <property name="text"> - <string>Eyes will be offset from the pivot of rotation, assumed to be the neck. It also works with relative translation disabled.</string> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - <property name="margin"> - <number>0</number> - </property> - </widget> - </item> - <item> - <widget class="QFrame" name="frame_4"> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <layout class="QGridLayout" name="gridLayout_9"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>9</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <property name="spacing"> - <number>0</number> - </property> - <item row="0" column="0"> - <widget class="QCheckBox" name="neck_enable"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="text"> - <string>Enable</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QSpinBox" name="neck_z"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>4</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="suffix"> - <string> cm</string> - </property> - <property name="minimum"> - <number>-100</number> - </property> - <property name="maximum"> - <number>100</number> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_32"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>15</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Forward from center of rotation</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_5"> - <attribute name="title"> - <string>Game detection</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_9"> - <item> - <widget class="QGroupBox" name="groupBox_1"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Game detection</string> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - <layout class="QVBoxLayout" name="verticalLayout_12"> - <item> - <widget class="QLabel" name="label_24"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Start tracking automatically when a game starts with selected profile, and stop when the game exits.</string> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="process_detector" name="game_detector" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </widget> - </item> - <item> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="standardButtons"> - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> - </property> - </widget> - </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>process_detector</class> - <extends>QWidget</extends> - <header>gui/process_detector.h</header> - </customwidget> - </customwidgets> - <tabstops> - <tabstop>tabWidget</tabstop> - <tabstop>bind_center</tabstop> - <tabstop>bind_toggle</tabstop> - <tabstop>bind_toggle_held</tabstop> - <tabstop>bind_zero</tabstop> - <tabstop>bind_zero_held</tabstop> - <tabstop>bind_start</tabstop> - <tabstop>bind_stop</tabstop> - <tabstop>bind_toggle_tracking</tabstop> - <tabstop>bind_restart_tracking</tabstop> - <tabstop>bind_center_2</tabstop> - <tabstop>bind_toggle_2</tabstop> - <tabstop>bind_toggle_held_2</tabstop> - <tabstop>bind_zero_2</tabstop> - <tabstop>bind_zero_held_2</tabstop> - <tabstop>bind_start_2</tabstop> - <tabstop>bind_stop_2</tabstop> - <tabstop>bind_toggle_tracking_2</tabstop> - <tabstop>bind_restart_tracking_2</tabstop> - <tabstop>center_at_startup</tabstop> - <tabstop>disable_translation</tabstop> - <tabstop>trayp</tabstop> - <tabstop>tray_start</tabstop> - <tabstop>src_yaw</tabstop> - <tabstop>invert_yaw</tabstop> - <tabstop>src_pitch</tabstop> - <tabstop>invert_pitch</tabstop> - <tabstop>src_roll</tabstop> - <tabstop>invert_roll</tabstop> - <tabstop>src_x</tabstop> - <tabstop>invert_x</tabstop> - <tabstop>src_y</tabstop> - <tabstop>invert_y</tabstop> - <tabstop>src_z</tabstop> - <tabstop>invert_z</tabstop> - <tabstop>tracklogging_enabled</tabstop> - <tabstop>tcomp_tx_disable</tabstop> - <tabstop>tcomp_ty_disable</tabstop> - <tabstop>tcomp_tz_disable</tabstop> - <tabstop>tcomp_src_yaw_disable</tabstop> - <tabstop>tcomp_src_pitch_disable</tabstop> - <tabstop>tcomp_src_roll_disable</tabstop> - <tabstop>neck_enable</tabstop> - <tabstop>neck_z</tabstop> - </tabstops> - <resources> - <include location="opentrack-res.qrc"/> - </resources> - <connections/> - <slots> - <slot>startEngineClicked()</slot> - <slot>stopEngineClicked()</slot> - <slot>cameraSettingsClicked()</slot> - </slots> -</ui> diff --git a/gui/settings.hpp b/gui/settings.hpp deleted file mode 100644 index 63e109a4..00000000 --- a/gui/settings.hpp +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include "export.hpp" - -#include "gui/ui_settings-dialog.h" -#include "logic/shortcuts.h" -#include <QObject> -#include <QDialog> -#include <QWidget> -#include <functional> - -class OTR_GUI_EXPORT options_dialog : public QDialog -{ - Q_OBJECT -signals: - void closing(); -public: - options_dialog(std::function<void(bool)> pause_keybindings); -private: - main_settings main; - std::function<void(bool)> pause_keybindings; - Ui::options_dialog ui; - void closeEvent(QCloseEvent *) override; - static QString kopts_to_string(const key_opts& opts); -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); -}; |