NOISSUE Specify support URLs at build time

Support URLs (bug tracker, Discord guild, subreddit) are now specified
as cache variables in cmake, and the buttons are not shown if no value
is set for them.

This is an early-stage move towards debranding the MultiMC codebase,
and will (hopefully) alleviate support requests coming to us from
illicit forks.
This commit is contained in:
Jamie Mansfield 2021-06-18 12:24:20 +01:00
parent 9fafe3ffe6
commit 40f41e5fbe
No known key found for this signature in database
GPG Key ID: 36F61598F39F67B0
4 changed files with 47 additions and 24 deletions

View File

@ -78,6 +78,15 @@ set(MultiMC_PASTE_EE_API_KEY "utLvciUouSURFzfjPxLBf5W4ISsUX4pwBDF7N1AfZ" CACHE S
# Google analytics ID # Google analytics ID
set(MultiMC_ANALYTICS_ID "UA-87731965-2" CACHE STRING "ID you can get from Google analytics") set(MultiMC_ANALYTICS_ID "UA-87731965-2" CACHE STRING "ID you can get from Google analytics")
# Bug tracker URL
set(MultiMC_BUG_TRACKER_URL "" CACHE STRING "URL for the bug tracker.")
# Discord URL
set(MultiMC_DISCORD_URL "" CACHE STRING "URL for the Discord guild.")
# Subreddit URL
set(MultiMC_SUBREDDIT_URL "" CACHE STRING "URL for the subreddit.")
#### Check the current Git commit and branch #### Check the current Git commit and branch
include(GetGitRevisionDescription) include(GetGitRevisionDescription)
get_git_head_revision(MultiMC_GIT_REFSPEC MultiMC_GIT_COMMIT) get_git_head_revision(MultiMC_GIT_REFSPEC MultiMC_GIT_COMMIT)

View File

@ -306,6 +306,7 @@ public:
helpMenu = new QMenu(MainWindow); helpMenu = new QMenu(MainWindow);
helpMenu->setToolTipsVisible(true); helpMenu->setToolTipsVisible(true);
if (!BuildConfig.BUG_TRACKER_URL.isEmpty()) {
actionReportBug = TranslatedAction(MainWindow); actionReportBug = TranslatedAction(MainWindow);
actionReportBug->setObjectName(QStringLiteral("actionReportBug")); actionReportBug->setObjectName(QStringLiteral("actionReportBug"));
actionReportBug->setIcon(MMC->getThemedIcon("bug")); actionReportBug->setIcon(MMC->getThemedIcon("bug"));
@ -313,7 +314,9 @@ public:
actionReportBug.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the bug tracker to report a bug with MultiMC.")); actionReportBug.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the bug tracker to report a bug with MultiMC."));
all_actions.append(&actionReportBug); all_actions.append(&actionReportBug);
helpMenu->addAction(actionReportBug); helpMenu->addAction(actionReportBug);
}
if (!BuildConfig.DISCORD_URL.isEmpty()) {
actionDISCORD = TranslatedAction(MainWindow); actionDISCORD = TranslatedAction(MainWindow);
actionDISCORD->setObjectName(QStringLiteral("actionDISCORD")); actionDISCORD->setObjectName(QStringLiteral("actionDISCORD"));
actionDISCORD->setIcon(MMC->getThemedIcon("discord")); actionDISCORD->setIcon(MMC->getThemedIcon("discord"));
@ -321,7 +324,9 @@ public:
actionDISCORD.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open MultiMC discord voice chat.")); actionDISCORD.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open MultiMC discord voice chat."));
all_actions.append(&actionDISCORD); all_actions.append(&actionDISCORD);
helpMenu->addAction(actionDISCORD); helpMenu->addAction(actionDISCORD);
}
if (!BuildConfig.SUBREDDIT_URL.isEmpty()) {
actionREDDIT = TranslatedAction(MainWindow); actionREDDIT = TranslatedAction(MainWindow);
actionREDDIT->setObjectName(QStringLiteral("actionREDDIT")); actionREDDIT->setObjectName(QStringLiteral("actionREDDIT"));
actionREDDIT->setIcon(MMC->getThemedIcon("reddit-alien")); actionREDDIT->setIcon(MMC->getThemedIcon("reddit-alien"));
@ -329,6 +334,7 @@ public:
actionREDDIT.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open MultiMC subreddit.")); actionREDDIT.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open MultiMC subreddit."));
all_actions.append(&actionREDDIT); all_actions.append(&actionREDDIT);
helpMenu->addAction(actionREDDIT); helpMenu->addAction(actionREDDIT);
}
actionAbout = TranslatedAction(MainWindow); actionAbout = TranslatedAction(MainWindow);
actionAbout->setObjectName(QStringLiteral("actionAbout")); actionAbout->setObjectName(QStringLiteral("actionAbout"));
@ -1455,12 +1461,12 @@ void MainWindow::droppedURLs(QList<QUrl> urls)
void MainWindow::on_actionREDDIT_triggered() void MainWindow::on_actionREDDIT_triggered()
{ {
DesktopServices::openUrl(QUrl("https://www.reddit.com/r/MultiMC/")); DesktopServices::openUrl(QUrl(BuildConfig.SUBREDDIT_URL));
} }
void MainWindow::on_actionDISCORD_triggered() void MainWindow::on_actionDISCORD_triggered()
{ {
DesktopServices::openUrl(QUrl("https://discord.gg/multimc")); DesktopServices::openUrl(QUrl(BuildConfig.DISCORD_URL));
} }
void MainWindow::on_actionChangeInstIcon_triggered() void MainWindow::on_actionChangeInstIcon_triggered()
@ -1638,7 +1644,7 @@ void MainWindow::on_actionManageAccounts_triggered()
void MainWindow::on_actionReportBug_triggered() void MainWindow::on_actionReportBug_triggered()
{ {
DesktopServices::openUrl(QUrl("https://github.com/MultiMC/MultiMC5/issues")); DesktopServices::openUrl(QUrl(BuildConfig.BUG_TRACKER_URL));
} }
void MainWindow::on_actionPatreon_triggered() void MainWindow::on_actionPatreon_triggered()

View File

@ -34,6 +34,10 @@ Config::Config()
NEWS_RSS_URL = "@MultiMC_NEWS_RSS_URL@"; NEWS_RSS_URL = "@MultiMC_NEWS_RSS_URL@";
PASTE_EE_KEY = "@MultiMC_PASTE_EE_API_KEY@"; PASTE_EE_KEY = "@MultiMC_PASTE_EE_API_KEY@";
META_URL = "@MultiMC_META_URL@"; META_URL = "@MultiMC_META_URL@";
BUG_TRACKER_URL = "@MultiMC_BUG_TRACKER_URL@";
DISCORD_URL = "@MultiMC_DISCORD_URL@";
SUBREDDIT_URL = "@MultiMC_SUBREDDIT_URL@";
} }
QString Config::printableVersionString() const QString Config::printableVersionString() const

View File

@ -65,6 +65,10 @@ public:
*/ */
QString META_URL; QString META_URL;
QString BUG_TRACKER_URL;
QString DISCORD_URL;
QString SUBREDDIT_URL;
QString RESOURCE_BASE = "https://resources.download.minecraft.net/"; QString RESOURCE_BASE = "https://resources.download.minecraft.net/";
QString LIBRARY_BASE = "https://libraries.minecraft.net/"; QString LIBRARY_BASE = "https://libraries.minecraft.net/";
QString SKINS_BASE = "https://crafatar.com/skins/"; QString SKINS_BASE = "https://crafatar.com/skins/";