From 4fea9233716980085b112f9444c573ec3807a9e9 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 17 Oct 2021 14:28:33 +0200 Subject: [PATCH] ui: Update StreamFX's menu with new Links --- data/locale/en-US.ini | 13 ++++-- source/ui/ui.cpp | 106 +++++++++++++++++++++++++----------------- source/ui/ui.hpp | 26 +++++------ 3 files changed, 84 insertions(+), 61 deletions(-) diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index c3f61a21..9a05e071 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -38,12 +38,15 @@ State.Default="Default" # Front-end UI.Menu="StreamFX" -UI.Menu.Website="Visit the Website" -UI.Menu.Discord="Join the Discord" -UI.Menu.Github="Source Code on Github" -UI.Menu.ReportIssue="Report a Bug or Crash" -UI.Menu.RequestHelp="Request Help && Support" +UI.Menu.Wiki="Read the Wiki" +UI.Menu.Support="Help && Support" +UI.Menu.Website="Visit the StreamFX Website" +UI.Menu.Discord="Join the StreamFX Discord" +UI.Menu.Twitter="Follow StreamFX on Twitter" +UI.Menu.YouTube="Subscribe to StreamFX on YouTube" UI.Menu.About="About StreamFX" + +# Front-end - About StreamFX UI.About.Title="About StreamFX" UI.About.Text="

StreamFX is made possible by all the supporters on Patreon, on Github Sponsors, and anyone donating through PayPal. Additional thanks go out to all the translators helping out with the localization on Crowdin. You all are amazing!

" UI.About.Role.Contributor="Contributor" diff --git a/source/ui/ui.cpp b/source/ui/ui.cpp index efc7a71a..0812b6dd 100644 --- a/source/ui/ui.cpp +++ b/source/ui/ui.cpp @@ -28,24 +28,27 @@ #include // Translation Keys -constexpr std::string_view _i18n_prefix = "StreamFX::"; -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_request_help = "UI.Menu.RequestHelp"; -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_github = "UI.Menu.Github"; -constexpr std::string_view _i18n_menu_about = "UI.Menu.About"; +constexpr std::string_view _i18n_prefix = "StreamFX::"; +constexpr std::string_view _i18n_menu = "UI.Menu"; +constexpr std::string_view _i18n_menu_support = "UI.Menu.Support"; +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_discord = "UI.Menu.Discord"; +constexpr std::string_view _i18n_menu_youtube = "UI.Menu.YouTube"; +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 constexpr std::string_view _cfg_have_shown_about = "UI.HaveShownAboutStreamFX"; // URLs -constexpr std::string_view _url_report_issue = "https://github.com/Xaymar/obs-StreamFX/issues/new?template=issue.md"; -constexpr std::string_view _url_request_help = "https://github.com/Xaymar/obs-StreamFX/issues/new?template=help.md"; -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_github = "https://github.com/Xaymar/obs-StreamFX"; +constexpr std::string_view _url_support = "https://s.xaymar.com/streamfx-dc-support"; +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_discord = "https://s.xaymar.com/streamfx-dc"; +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() { @@ -74,9 +77,7 @@ bool streamfx::ui::handler::have_shown_about_streamfx(bool shown) streamfx::ui::handler::handler() : QObject(), _menu_action(), _menu(), - _report_issue(), _request_help(), - - _link_website(), _link_discord(), _link_github(), + _action_support(), _action_wiki(), _action_website(), _action_discord(), _action_twitter(), _action_youtube(), _about_action(), _about_dialog(), @@ -124,32 +125,48 @@ void streamfx::ui::handler::on_obs_loaded() { // Create and build the StreamFX menu _menu = new QMenu(reinterpret_cast(obs_frontend_get_main_window())); - // Report an Issue - _report_issue = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_report_issue.data()))); - _report_issue->setMenuRole(QAction::NoRole); - connect(_report_issue, &QAction::triggered, this, &streamfx::ui::handler::on_action_report_issue); + // Wiki + // Help & Support + // --- + // Website + // Discord + // Twitter + // YouTube + // <---> + // + // --- + // About StreamFX - // Request help - _request_help = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_request_help.data()))); - _request_help->setMenuRole(QAction::NoRole); - connect(_request_help, &QAction::triggered, this, &streamfx::ui::handler::on_action_request_help); + { + // Wiki + _action_wiki = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_wiki.data()))); + _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(); + { + _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 - _link_website = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_website.data()))); - _link_website->setMenuRole(QAction::NoRole); - connect(_link_website, &QAction::triggered, this, &streamfx::ui::handler::on_action_website); + _action_discord = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_discord.data()))); + _action_discord->setMenuRole(QAction::NoRole); + connect(_action_discord, &QAction::triggered, this, &streamfx::ui::handler::on_action_discord); - // Discord - _link_discord = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_discord.data()))); - _link_discord->setMenuRole(QAction::NoRole); - connect(_link_discord, &QAction::triggered, this, &streamfx::ui::handler::on_action_discord); + _action_twitter = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_twitter.data()))); + _action_twitter->setMenuRole(QAction::NoRole); + connect(_action_twitter, &QAction::triggered, this, &streamfx::ui::handler::on_action_twitter); - // Github - _link_github = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_github.data()))); - _link_github->setMenuRole(QAction::NoRole); - connect(_link_github, &QAction::triggered, this, &streamfx::ui::handler::on_action_github); + _action_youtube = _menu->addAction(QString::fromUtf8(D_TRANSLATE(_i18n_menu_youtube.data()))); + _action_youtube->setMenuRole(QAction::NoRole); + connect(_action_youtube, &QAction::triggered, this, &streamfx::ui::handler::on_action_youtube); + } // Create the updater. #ifdef ENABLE_UPDATER @@ -203,14 +220,14 @@ void streamfx::ui::handler::on_obs_exit() 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) @@ -223,9 +240,14 @@ void streamfx::ui::handler::on_action_discord(bool) 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) diff --git a/source/ui/ui.hpp b/source/ui/ui.hpp index 2fb968d4..18c219c9 100644 --- a/source/ui/ui.hpp +++ b/source/ui/ui.hpp @@ -33,14 +33,13 @@ namespace streamfx::ui { QAction* _menu_action; QMenu* _menu; - // Bug Report, Help Request - QAction* _report_issue; - QAction* _request_help; - - // Website, Discord, Source - QAction* _link_website; - QAction* _link_discord; - QAction* _link_github; + // 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; @@ -67,14 +66,13 @@ namespace streamfx::ui { public slots: ; // Not having this breaks some linters. - // Issues & Help - void on_action_report_issue(bool); - void on_action_request_help(bool); - - // Official Links + // 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_github(bool); + void on_action_twitter(bool); + void on_action_youtube(bool); // About void on_action_about(bool);