From 530352f28b919ee3a55d22585c16c1661e8ca2ca Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 10 Aug 2016 18:15:45 +0200 Subject: gui/main-window: add a tray menu Issue: #410 --- gui/main-window.hpp | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) (limited to 'gui/main-window.hpp') diff --git a/gui/main-window.hpp b/gui/main-window.hpp index 14c7cf0d..b068d158 100644 --- a/gui/main-window.hpp +++ b/gui/main-window.hpp @@ -8,6 +8,17 @@ #pragma once +#include "opentrack/plugin-support.hpp" +#include "mapping-window.hpp" +#include "options-dialog.hpp" +#include "process_detector.h" +#include "opentrack-logic/main-settings.hpp" +#include "opentrack-logic/tracker.h" +#include "opentrack-logic/shortcuts.h" +#include "opentrack-logic/work.hpp" +#include "opentrack-logic/state.hpp" +#include "opentrack-compat/options.hpp" + #include #include #include @@ -16,24 +27,16 @@ #include #include #include +#include #include +#include #include #include +#include #include "ui_main-window.h" -#include "opentrack-compat/options.hpp" -#include "opentrack-logic/main-settings.hpp" -#include "opentrack/plugin-support.hpp" -#include "opentrack-logic/tracker.h" -#include "opentrack-logic/shortcuts.h" -#include "opentrack-logic/work.hpp" -#include "opentrack-logic/state.hpp" -#include "mapping-window.hpp" -#include "options-dialog.hpp" -#include "process_detector.h" - using namespace options; class MainWindow : public QMainWindow, private State @@ -44,18 +47,24 @@ class MainWindow : public QMainWindow, private State Shortcuts global_shortcuts; module_settings m; - mem tray; + ptr tray; + QMenu tray_menu; QTimer pose_update_timer; QTimer det_timer; QTimer config_list_timer; - mem options_widget; - mem mapping_widget; + ptr options_widget; + ptr mapping_widget; QShortcut kbd_quit; - mem pFilterDialog; - mem pProtocolDialog; - mem pTrackerDialog; + ptr pFilterDialog; + ptr pProtocolDialog; + ptr pTrackerDialog; process_detector_worker det; QMenu profile_menu; + + QAction menu_action_header, menu_action_show, menu_action_exit, + menu_action_tracker, menu_action_filter, menu_action_proto, + menu_action_options, menu_action_mappings; + bool is_refreshing_profiles; mem current_tracker() @@ -82,7 +91,10 @@ class MainWindow : public QMainWindow, private State void register_shortcuts(); void set_keys_enabled(bool flag); + void init_tray_menu(); + void changeEvent(QEvent* e) override; + void closeEvent(QCloseEvent*) override; bool maybe_hide_to_tray(QEvent* e); private slots: -- cgit v1.2.3