Merge pull request #3870 from jamierocks/build-time-support-links

NOISSUE Specify support URLs at build time
This commit is contained in:
Petr Mrázek 2021-06-18 13:43:35 +02:00 committed by GitHub
commit 434adc4cd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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,29 +306,35 @@ public:
helpMenu = new QMenu(MainWindow); helpMenu = new QMenu(MainWindow);
helpMenu->setToolTipsVisible(true); helpMenu->setToolTipsVisible(true);
actionReportBug = TranslatedAction(MainWindow); if (!BuildConfig.BUG_TRACKER_URL.isEmpty()) {
actionReportBug->setObjectName(QStringLiteral("actionReportBug")); actionReportBug = TranslatedAction(MainWindow);
actionReportBug->setIcon(MMC->getThemedIcon("bug")); actionReportBug->setObjectName(QStringLiteral("actionReportBug"));
actionReportBug.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Report a Bug")); actionReportBug->setIcon(MMC->getThemedIcon("bug"));
actionReportBug.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the bug tracker to report a bug with MultiMC.")); actionReportBug.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Report a Bug"));
all_actions.append(&actionReportBug); actionReportBug.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the bug tracker to report a bug with MultiMC."));
helpMenu->addAction(actionReportBug); all_actions.append(&actionReportBug);
helpMenu->addAction(actionReportBug);
}
actionDISCORD = TranslatedAction(MainWindow); if (!BuildConfig.DISCORD_URL.isEmpty()) {
actionDISCORD->setObjectName(QStringLiteral("actionDISCORD")); actionDISCORD = TranslatedAction(MainWindow);
actionDISCORD->setIcon(MMC->getThemedIcon("discord")); actionDISCORD->setObjectName(QStringLiteral("actionDISCORD"));
actionDISCORD.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Discord")); actionDISCORD->setIcon(MMC->getThemedIcon("discord"));
actionDISCORD.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open MultiMC discord voice chat.")); actionDISCORD.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Discord"));
all_actions.append(&actionDISCORD); actionDISCORD.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open MultiMC discord voice chat."));
helpMenu->addAction(actionDISCORD); all_actions.append(&actionDISCORD);
helpMenu->addAction(actionDISCORD);
}
actionREDDIT = TranslatedAction(MainWindow); if (!BuildConfig.SUBREDDIT_URL.isEmpty()) {
actionREDDIT->setObjectName(QStringLiteral("actionREDDIT")); actionREDDIT = TranslatedAction(MainWindow);
actionREDDIT->setIcon(MMC->getThemedIcon("reddit-alien")); actionREDDIT->setObjectName(QStringLiteral("actionREDDIT"));
actionREDDIT.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Reddit")); actionREDDIT->setIcon(MMC->getThemedIcon("reddit-alien"));
actionREDDIT.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open MultiMC subreddit.")); actionREDDIT.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Reddit"));
all_actions.append(&actionREDDIT); actionREDDIT.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open MultiMC subreddit."));
helpMenu->addAction(actionREDDIT); all_actions.append(&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/";