diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-12-16 14:28:14 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-12-16 15:32:04 +0100 |
commit | e6c060cc56b0d6a7c28ffbfff5aa1d2251d1dabe (patch) | |
tree | d7bd126a6ea27baf752b1e7b4d01c4c658c451fd /gui/options-dialog.hpp | |
parent | b81634fd08ce2bec64360aaf28823ea80ed24b36 (diff) |
opentrack, gui: rename options dialog impl filename
Diffstat (limited to 'gui/options-dialog.hpp')
-rw-r--r-- | gui/options-dialog.hpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/gui/options-dialog.hpp b/gui/options-dialog.hpp new file mode 100644 index 00000000..2cb3492c --- /dev/null +++ b/gui/options-dialog.hpp @@ -0,0 +1,57 @@ +#pragma once + +#include "export.hpp" + +#include "gui/ui_settings-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); +}; |