diff options
Diffstat (limited to 'facetracknoir/ui.h')
-rw-r--r-- | facetracknoir/ui.h | 68 |
1 files changed, 23 insertions, 45 deletions
diff --git a/facetracknoir/ui.h b/facetracknoir/ui.h index 2253ec80..1abd92ff 100644 --- a/facetracknoir/ui.h +++ b/facetracknoir/ui.h @@ -1,27 +1,3 @@ -/******************************************************************************* -* MainWindow This program is a private project of the some enthusiastic -* gamers from Holland, who don't like to pay much for -* head-tracking. -* -* Copyright (C) 2010 Wim Vriend (Developing) -* Ron Hendriks (Researching and Testing) -* -* Homepage -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 3 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program; if not, see <http://www.gnu.org/licenses/>. -*********************************************************************************/ - /* Copyright (c) 2014-2015, Stanislaw Halik <sthalik@misaki.pl> * Permission to use, copy, modify, and/or distribute this @@ -39,12 +15,7 @@ #include <QTimer> #include <QSystemTrayIcon> #include <QString> - -#if !defined(_WIN32) -# include "qxt-mini/QxtGlobalShortcut" -#else -# include <windows.h> -#endif +#include <QMenu> #include "ui_main.h" @@ -69,12 +40,16 @@ class MainWindow : public QMainWindow, private State mem<QSystemTrayIcon> tray; QTimer pose_update_timer; QTimer det_timer; - mem<OptionsDialog> shortcuts_widget; + QTimer config_list_timer; + mem<OptionsDialog> options_widget; mem<MapWidget> mapping_widget; QShortcut kbd_quit; QPixmap no_feed_pixmap; mem<IProtocolDialog> pProtocolDialog; process_detector_worker det; + QMenu profile_menu; + bool is_refreshing_profiles; + QTimer save_timer; mem<dylib> current_protocol() { @@ -83,41 +58,44 @@ class MainWindow : public QMainWindow, private State void changeEvent(QEvent* e) override; - void createIconGroupBox(); void load_settings(); void updateButtonState(bool running, bool inertialp); - void fill_profile_combobox(); void display_pose(const double* mapped, const double* raw); void ensure_tray(); void set_title(const QString& game_title = QStringLiteral("")); -public slots: - void shortcutRecentered(); - void shortcutToggled(); - void shortcutZeroed(); - void bindKeyboardShortcuts(); + static bool get_new_config_name_from_dialog(QString &ret); + void set_profile(const QString& profile); + void maybe_save(); private slots: - void open(); + void _save(); void save(); - void saveAs(); void exit(); - void profileSelected(int index); + void profileSelected(QString name); void showProtocolSettings(); - void showKeyboardShortcuts(); + void show_options_dialog(); void showCurveConfiguration(); void showHeadPose(); void restore_from_tray(QSystemTrayIcon::ActivationReason); void maybe_start_profile_from_executable(); -public slots: + + void make_empty_config(); + void make_copied_config(); + void open_config_directory(); + void refresh_config_list(); + void startTracker(); void stopTracker(); + void reload_options(); +public slots: + void shortcutRecentered(); + void shortcutToggled(); + void shortcutZeroed(); public: MainWindow(); ~MainWindow(); void save_mappings(); void load_mappings(); - static QString remove_app_path(const QString full_path); static void set_working_directory(); - static void set_profile(const QString& profile); }; |