diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-10-12 17:02:00 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-10-12 17:08:58 +0000 |
commit | 132350f8c5161a5daf4f202ac02cb5f4c0463915 (patch) | |
tree | 9a2048f17961d166bd511392143bde6bad5bbf05 /variant/trackmouse/window.hpp | |
parent | 7d1905251c12c27d7bc2caed03169b6a0fd9f83d (diff) |
variant/trackmouse: copy-paste from default on short notice
Diffstat (limited to 'variant/trackmouse/window.hpp')
-rw-r--r-- | variant/trackmouse/window.hpp | 81 |
1 files changed, 75 insertions, 6 deletions
diff --git a/variant/trackmouse/window.hpp b/variant/trackmouse/window.hpp index e5c34410..af3a3043 100644 --- a/variant/trackmouse/window.hpp +++ b/variant/trackmouse/window.hpp @@ -1,17 +1,86 @@ #pragma once -#include "ui_window.h" +/* Copyright (c) 2013-2016, Stanislaw Halik <sthalik@misaki.pl> + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + +#pragma once + +#include "api/plugin-support.hpp" +#include "logic/main-settings.hpp" +#include "logic/pipeline.hpp" +#include "logic/shortcuts.h" +#include "logic/work.hpp" +#include "logic/state.hpp" +#include "options/options.hpp" + #include <QMainWindow> -#include <QCloseEvent> +#include <QKeySequence> +#include <QShortcut> +#include <QPixmap> +#include <QTimer> +#include <QString> -class window : public QMainWindow +#include <tuple> +#include <memory> + +#include "ui_window.h" + +class main_window final : public QMainWindow, private State { Q_OBJECT Ui::window ui; - void closeEvent(QCloseEvent* e) override; -public: - window(); + Shortcuts global_shortcuts; + module_settings m; + + QShortcut kbd_quit { QKeySequence("Ctrl+Q"), this }; + std::unique_ptr<IFilterDialog> pFilterDialog; + std::unique_ptr<IProtocolDialog> pProtocolDialog; + std::unique_ptr<ITrackerDialog> pTrackerDialog; + + using dylib_ptr = Modules::dylib_ptr; + using dylib_list = Modules::dylib_list; + static std::tuple<dylib_ptr, int> module_by_name(const QString& name, Modules::dylib_list& list); + + dylib_ptr current_tracker(); + dylib_ptr current_protocol(); + dylib_ptr current_filter(); + + void update_button_state(bool running, bool inertialp); + + void set_title(const QString& game_title = QString()); + + void set_profile_in_registry(); + void register_shortcuts(); + + void closeEvent(QCloseEvent *event) override; + + bool maybe_die_on_config_not_writable(const QString& current); + void die_on_config_not_writable(); + +private slots: + void save_modules(); + void exit(int status = EXIT_SUCCESS); + bool set_profile(); + + void start_tracker_(); + void stop_tracker_(); + void toggle_tracker_(); + + static void set_working_directory(); + +signals: + void start_tracker(); + void stop_tracker(); + +public: + main_window(); + ~main_window() override; }; |