2023-02-28 01:15:26 +00:00
|
|
|
// AUTOGENERATED COPYRIGHT HEADER START
|
|
|
|
// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
|
|
|
// AUTOGENERATED COPYRIGHT HEADER END
|
2020-04-05 16:52:06 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "ui-common.hpp"
|
2022-08-28 12:28:37 +00:00
|
|
|
#include "ui-about.hpp"
|
2020-04-05 16:52:06 +00:00
|
|
|
|
2020-09-09 03:06:15 +00:00
|
|
|
#ifdef ENABLE_UPDATER
|
|
|
|
#include "ui-updater.hpp"
|
|
|
|
#endif
|
|
|
|
|
2020-04-05 16:52:06 +00:00
|
|
|
namespace streamfx::ui {
|
|
|
|
class handler : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
QAction* _menu_action;
|
|
|
|
QMenu* _menu;
|
|
|
|
|
2021-10-17 12:28:33 +00:00
|
|
|
// Menu Actions
|
|
|
|
QAction* _action_support;
|
|
|
|
QAction* _action_wiki;
|
|
|
|
QAction* _action_website;
|
|
|
|
QAction* _action_discord;
|
|
|
|
QAction* _action_twitter;
|
|
|
|
QAction* _action_youtube;
|
2020-04-05 16:52:06 +00:00
|
|
|
|
|
|
|
// About Dialog
|
|
|
|
QAction* _about_action;
|
|
|
|
ui::about* _about_dialog;
|
|
|
|
|
2021-01-21 02:00:44 +00:00
|
|
|
QTranslator* _translator;
|
|
|
|
|
2020-09-09 03:06:15 +00:00
|
|
|
#ifdef ENABLE_UPDATER
|
|
|
|
std::shared_ptr<streamfx::ui::updater> _updater;
|
|
|
|
#endif
|
|
|
|
|
2020-04-05 16:52:06 +00:00
|
|
|
public:
|
|
|
|
handler();
|
|
|
|
~handler();
|
|
|
|
|
|
|
|
bool have_shown_about_streamfx(bool shown = false);
|
|
|
|
|
|
|
|
private:
|
|
|
|
static void frontend_event_handler(obs_frontend_event event, void* private_data);
|
|
|
|
|
|
|
|
void on_obs_loaded();
|
2021-01-21 02:00:44 +00:00
|
|
|
void on_obs_exit();
|
2020-04-05 16:52:06 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
; // Not having this breaks some linters.
|
2020-09-09 03:06:15 +00:00
|
|
|
|
2021-10-17 12:28:33 +00:00
|
|
|
// Menu Actions
|
|
|
|
void on_action_support(bool);
|
|
|
|
void on_action_wiki(bool);
|
2020-04-05 16:52:06 +00:00
|
|
|
void on_action_website(bool);
|
|
|
|
void on_action_discord(bool);
|
2021-10-17 12:28:33 +00:00
|
|
|
void on_action_twitter(bool);
|
|
|
|
void on_action_youtube(bool);
|
2020-09-09 03:06:15 +00:00
|
|
|
|
|
|
|
// About
|
2020-04-05 16:52:06 +00:00
|
|
|
void on_action_about(bool);
|
|
|
|
|
|
|
|
public /* Singleton */:
|
|
|
|
static void initialize();
|
|
|
|
|
|
|
|
static void finalize();
|
|
|
|
|
|
|
|
static std::shared_ptr<ui::handler> get();
|
|
|
|
};
|
|
|
|
|
|
|
|
class translator : public QTranslator {
|
|
|
|
public:
|
|
|
|
translator(QObject* parent = nullptr);
|
|
|
|
~translator();
|
|
|
|
|
2023-05-13 12:35:46 +00:00
|
|
|
virtual QString translate(const char* context, const char* sourceText, const char* disambiguation = nullptr, int n = -1) const override;
|
2020-04-05 16:52:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace streamfx::ui
|