obs-StreamFX/source/ui/ui.hpp
Michael Fabian 'Xaymar' Dirks 5a3954ae0e project: Fix License, License headers and Copyright information
Fixes several files incorrectly stated a different license from the actual project, as well as the copyright headers included in all files. This change has no effect on the licensing terms, it should clear up a bit of confusion by contributors. Plus the files get a bit smaller, and we have less duplicated information across the entire project.

Overall the project is GPLv2 if not built with Qt, and GPLv3 if it is built with Qt. There are no parts licensed under a different license, all have been adapted from other compatible licenses into GPLv2 or GPLv3.
2023-04-05 18:59:08 +02:00

82 lines
1.7 KiB
C++

// AUTOGENERATED COPYRIGHT HEADER START
// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
// AUTOGENERATED COPYRIGHT HEADER END
#pragma once
#include "ui-common.hpp"
#include "ui-about.hpp"
#ifdef ENABLE_UPDATER
#include "ui-updater.hpp"
#endif
namespace streamfx::ui {
class handler : public QObject {
Q_OBJECT
private:
QAction* _menu_action;
QMenu* _menu;
// Menu Actions
QAction* _action_support;
QAction* _action_wiki;
QAction* _action_website;
QAction* _action_discord;
QAction* _action_twitter;
QAction* _action_youtube;
// About Dialog
QAction* _about_action;
ui::about* _about_dialog;
QTranslator* _translator;
#ifdef ENABLE_UPDATER
std::shared_ptr<streamfx::ui::updater> _updater;
#endif
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();
void on_obs_exit();
public slots:
; // Not having this breaks some linters.
// Menu Actions
void on_action_support(bool);
void on_action_wiki(bool);
void on_action_website(bool);
void on_action_discord(bool);
void on_action_twitter(bool);
void on_action_youtube(bool);
// About
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();
virtual QString translate(const char* context, const char* sourceText, const char* disambiguation = nullptr,
int n = -1) const override;
};
} // namespace streamfx::ui