ui: Update StreamFX's menu with new Links

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2021-10-17 14:28:33 +02:00
parent e3563c7cf4
commit 4fea923371
3 changed files with 84 additions and 61 deletions

View file

@ -38,12 +38,15 @@ State.Default="Default"
# Front-end # Front-end
UI.Menu="StreamFX" UI.Menu="StreamFX"
UI.Menu.Website="Visit the Website" UI.Menu.Wiki="Read the Wiki"
UI.Menu.Discord="Join the Discord" UI.Menu.Support="Help && Support"
UI.Menu.Github="Source Code on Github" UI.Menu.Website="Visit the StreamFX Website"
UI.Menu.ReportIssue="Report a Bug or Crash" UI.Menu.Discord="Join the StreamFX Discord"
UI.Menu.RequestHelp="Request Help && Support" UI.Menu.Twitter="Follow StreamFX on Twitter"
UI.Menu.YouTube="Subscribe to StreamFX on YouTube"
UI.Menu.About="About StreamFX" UI.Menu.About="About StreamFX"
# Front-end - About StreamFX
UI.About.Title="About StreamFX" UI.About.Title="About StreamFX"
UI.About.Text="<html><head/><body><p>StreamFX is made possible by all the supporters on <a href='https://patreon.com/Xaymar'><span style='text-decoration: underline;'>Patreon</span></a>, on <a href='https://github.com/sponsors/xaymar'><span style='text-decoration: underline;'>Github Sponsors</span></a>, and anyone donating through <a href='https://paypal.me/Xaymar'><span style='text-decoration: underline;'>PayPal</span></a>. Additional thanks go out to all the translators helping out with the localization on <a href='https://crowdin.com/project/obs-stream-effects'><span style='text-decoration: underline;'>Crowdin</span></a>. You all are amazing!</p></body></html>" UI.About.Text="<html><head/><body><p>StreamFX is made possible by all the supporters on <a href='https://patreon.com/Xaymar'><span style='text-decoration: underline;'>Patreon</span></a>, on <a href='https://github.com/sponsors/xaymar'><span style='text-decoration: underline;'>Github Sponsors</span></a>, and anyone donating through <a href='https://paypal.me/Xaymar'><span style='text-decoration: underline;'>PayPal</span></a>. Additional thanks go out to all the translators helping out with the localization on <a href='https://crowdin.com/project/obs-stream-effects'><span style='text-decoration: underline;'>Crowdin</span></a>. You all are amazing!</p></body></html>"
UI.About.Role.Contributor="Contributor" UI.About.Role.Contributor="Contributor"

View file

@ -28,24 +28,27 @@
#include <obs-frontend-api.h> #include <obs-frontend-api.h>
// Translation Keys // Translation Keys
constexpr std::string_view _i18n_prefix = "StreamFX::"; constexpr std::string_view _i18n_prefix = "StreamFX::";
constexpr std::string_view _i18n_menu = "UI.Menu"; constexpr std::string_view _i18n_menu = "UI.Menu";
constexpr std::string_view _i18n_menu_report_issue = "UI.Menu.ReportIssue"; constexpr std::string_view _i18n_menu_support = "UI.Menu.Support";
constexpr std::string_view _i18n_menu_request_help = "UI.Menu.RequestHelp"; constexpr std::string_view _i18n_menu_wiki = "UI.Menu.Wiki";
constexpr std::string_view _i18n_menu_website = "UI.Menu.Website"; constexpr std::string_view _i18n_menu_website = "UI.Menu.Website";
constexpr std::string_view _i18n_menu_discord = "UI.Menu.Discord"; constexpr std::string_view _i18n_menu_discord = "UI.Menu.Discord";
constexpr std::string_view _i18n_menu_github = "UI.Menu.Github"; constexpr std::string_view _i18n_menu_youtube = "UI.Menu.YouTube";
constexpr std::string_view _i18n_menu_about = "UI.Menu.About"; constexpr std::string_view _i18n_menu_twitter = "UI.Menu.Twitter";
constexpr std::string_view _i18n_menu_github = "UI.Menu.Github";
constexpr std::string_view _i18n_menu_about = "UI.Menu.About";
// Configuration // Configuration
constexpr std::string_view _cfg_have_shown_about = "UI.HaveShownAboutStreamFX"; constexpr std::string_view _cfg_have_shown_about = "UI.HaveShownAboutStreamFX";
// URLs // URLs
constexpr std::string_view _url_report_issue = "https://github.com/Xaymar/obs-StreamFX/issues/new?template=issue.md"; constexpr std::string_view _url_support = "https://s.xaymar.com/streamfx-dc-support";
constexpr std::string_view _url_request_help = "https://github.com/Xaymar/obs-StreamFX/issues/new?template=help.md"; constexpr std::string_view _url_wiki = "https://github.com/Xaymar/obs-StreamFX/wiki";
constexpr std::string_view _url_website = "https://streamfx.xaymar.com"; constexpr std::string_view _url_website = "https://streamfx.xaymar.com";
constexpr std::string_view _url_discord = "https://discord.gg/rjkxERs"; constexpr std::string_view _url_discord = "https://s.xaymar.com/streamfx-dc";
constexpr std::string_view _url_github = "https://github.com/Xaymar/obs-StreamFX"; constexpr std::string_view _url_twitter = "https://s.xaymar.com/streamfx-tw";
constexpr std::string_view _url_youtube = "https://s.xaymar.com/streamfx-yt";
inline void qt_init_resource() inline void qt_init_resource()
{ {
@ -74,9 +77,7 @@ bool streamfx::ui::handler::have_shown_about_streamfx(bool shown)
streamfx::ui::handler::handler() streamfx::ui::handler::handler()
: QObject(), _menu_action(), _menu(), : QObject(), _menu_action(), _menu(),
_report_issue(), _request_help(), _action_support(), _action_wiki(), _action_website(), _action_discord(), _action_twitter(), _action_youtube(),
_link_website(), _link_discord(), _link_github(),
_about_action(), _about_dialog(), _about_action(), _about_dialog(),
@ -124,32 +125,48 @@ void streamfx::ui::handler::on_obs_loaded()
{ // Create and build the StreamFX menu { // Create and build the StreamFX menu
_menu = new QMenu(reinterpret_cast<QWidget*>(obs_frontend_get_main_window())); _menu = new QMenu(reinterpret_cast<QWidget*>(obs_frontend_get_main_window()));
// Report an Issue // Wiki
_report_issue = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_report_issue.data()))); // Help & Support
_report_issue->setMenuRole(QAction::NoRole); // ---
connect(_report_issue, &QAction::triggered, this, &streamfx::ui::handler::on_action_report_issue); // Website
// Discord
// Twitter
// YouTube
// <--->
// <Updater>
// ---
// About StreamFX
// Request help {
_request_help = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_request_help.data()))); // Wiki
_request_help->setMenuRole(QAction::NoRole); _action_wiki = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_wiki.data())));
connect(_request_help, &QAction::triggered, this, &streamfx::ui::handler::on_action_request_help); _action_wiki->setMenuRole(QAction::NoRole);
connect(_action_wiki, &QAction::triggered, this, &streamfx::ui::handler::on_action_wiki);
// Help & Support
_action_support = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_support.data())));
_action_support->setMenuRole(QAction::NoRole);
connect(_action_support, &QAction::triggered, this, &streamfx::ui::handler::on_action_support);
}
_menu->addSeparator(); _menu->addSeparator();
{
_action_website = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_website.data())));
_action_website->setMenuRole(QAction::NoRole);
connect(_action_website, &QAction::triggered, this, &streamfx::ui::handler::on_action_website);
// Website _action_discord = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_discord.data())));
_link_website = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_website.data()))); _action_discord->setMenuRole(QAction::NoRole);
_link_website->setMenuRole(QAction::NoRole); connect(_action_discord, &QAction::triggered, this, &streamfx::ui::handler::on_action_discord);
connect(_link_website, &QAction::triggered, this, &streamfx::ui::handler::on_action_website);
// Discord _action_twitter = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_twitter.data())));
_link_discord = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_discord.data()))); _action_twitter->setMenuRole(QAction::NoRole);
_link_discord->setMenuRole(QAction::NoRole); connect(_action_twitter, &QAction::triggered, this, &streamfx::ui::handler::on_action_twitter);
connect(_link_discord, &QAction::triggered, this, &streamfx::ui::handler::on_action_discord);
// Github _action_youtube = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_youtube.data())));
_link_github = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_github.data()))); _action_youtube->setMenuRole(QAction::NoRole);
_link_github->setMenuRole(QAction::NoRole); connect(_action_youtube, &QAction::triggered, this, &streamfx::ui::handler::on_action_youtube);
connect(_link_github, &QAction::triggered, this, &streamfx::ui::handler::on_action_github); }
// Create the updater. // Create the updater.
#ifdef ENABLE_UPDATER #ifdef ENABLE_UPDATER
@ -203,14 +220,14 @@ void streamfx::ui::handler::on_obs_exit()
qt_cleanup_resource(); qt_cleanup_resource();
} }
void streamfx::ui::handler::on_action_report_issue(bool) void streamfx::ui::handler::on_action_support(bool)
{ {
QDesktopServices::openUrl(QUrl(QString::fromUtf8(_url_report_issue.data()))); QDesktopServices::openUrl(QUrl(QString::fromUtf8(_url_support.data())));
} }
void streamfx::ui::handler::on_action_request_help(bool) void streamfx::ui::handler::on_action_wiki(bool)
{ {
QDesktopServices::openUrl(QUrl(QString::fromUtf8(_url_request_help.data()))); QDesktopServices::openUrl(QUrl(QString::fromUtf8(_url_wiki.data())));
} }
void streamfx::ui::handler::on_action_website(bool) void streamfx::ui::handler::on_action_website(bool)
@ -223,9 +240,14 @@ void streamfx::ui::handler::on_action_discord(bool)
QDesktopServices::openUrl(QUrl(QString::fromUtf8(_url_discord.data()))); QDesktopServices::openUrl(QUrl(QString::fromUtf8(_url_discord.data())));
} }
void streamfx::ui::handler::on_action_github(bool) void streamfx::ui::handler::on_action_twitter(bool)
{ {
QDesktopServices::openUrl(QUrl(QString::fromUtf8(_url_github.data()))); QDesktopServices::openUrl(QUrl(QString::fromUtf8(_url_twitter.data())));
}
void streamfx::ui::handler::on_action_youtube(bool)
{
QDesktopServices::openUrl(QUrl(QString::fromUtf8(_url_youtube.data())));
} }
void streamfx::ui::handler::on_action_about(bool checked) void streamfx::ui::handler::on_action_about(bool checked)

View file

@ -33,14 +33,13 @@ namespace streamfx::ui {
QAction* _menu_action; QAction* _menu_action;
QMenu* _menu; QMenu* _menu;
// Bug Report, Help Request // Menu Actions
QAction* _report_issue; QAction* _action_support;
QAction* _request_help; QAction* _action_wiki;
QAction* _action_website;
// Website, Discord, Source QAction* _action_discord;
QAction* _link_website; QAction* _action_twitter;
QAction* _link_discord; QAction* _action_youtube;
QAction* _link_github;
// About Dialog // About Dialog
QAction* _about_action; QAction* _about_action;
@ -67,14 +66,13 @@ namespace streamfx::ui {
public slots: public slots:
; // Not having this breaks some linters. ; // Not having this breaks some linters.
// Issues & Help // Menu Actions
void on_action_report_issue(bool); void on_action_support(bool);
void on_action_request_help(bool); void on_action_wiki(bool);
// Official Links
void on_action_website(bool); void on_action_website(bool);
void on_action_discord(bool); void on_action_discord(bool);
void on_action_github(bool); void on_action_twitter(bool);
void on_action_youtube(bool);
// About // About
void on_action_about(bool); void on_action_about(bool);