Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOISSUE Customizable Patreon URL #5430

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ set(Launcher_DISCORD_URL "" CACHE STRING "URL for the Discord guild.")
# Subreddit URL
set(Launcher_SUBREDDIT_URL "" CACHE STRING "URL for the subreddit.")

# Patreon URL
set(Launcher_PATREON_URL "" CACHE STRING "URL for the patreon.")

# Use the secrets library or a public stub?
option(Launcher_EMBED_SECRETS "Determines whether to embed secrets. Secrets are separate and non-public." OFF)

Expand Down
1 change: 1 addition & 0 deletions buildconfig/BuildConfig.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Config::Config()
BUG_TRACKER_URL = "@Launcher_BUG_TRACKER_URL@";
DISCORD_URL = "@Launcher_DISCORD_URL@";
SUBREDDIT_URL = "@Launcher_SUBREDDIT_URL@";
PATREON_URL = "@Launcher_PATREON_URL@";
}

QString Config::printableVersionString() const
Expand Down
1 change: 1 addition & 0 deletions buildconfig/BuildConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class Config
QString BUG_TRACKER_URL;
QString DISCORD_URL;
QString SUBREDDIT_URL;
QString PATREON_URL;

QString RESOURCE_BASE = "https://resources.download.minecraft.net/";
QString LIBRARY_BASE = "https://libraries.minecraft.net/";
Expand Down
19 changes: 11 additions & 8 deletions launcher/ui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,16 @@ class MainWindow::Ui

mainToolBar->addSeparator();

actionPatreon = TranslatedAction(MainWindow);
actionPatreon->setObjectName(QStringLiteral("actionPatreon"));
actionPatreon->setIcon(APPLICATION->getThemedIcon("patreon"));
actionPatreon.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Support %1"));
actionPatreon.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the %1 Patreon page."));
all_actions.append(&actionPatreon);
mainToolBar->addAction(actionPatreon);
if (!BuildConfig.PATREON_URL.isEmpty())
{
actionPatreon = TranslatedAction(MainWindow);
actionPatreon->setObjectName(QStringLiteral("actionPatreon"));
actionPatreon->setIcon(APPLICATION->getThemedIcon("patreon"));
actionPatreon.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Support %1"));
actionPatreon.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the %1 Patreon page."));
all_actions.append(&actionPatreon);
mainToolBar->addAction(actionPatreon);
}

actionCAT = TranslatedAction(MainWindow);
actionCAT->setObjectName(QStringLiteral("actionCAT"));
Expand Down Expand Up @@ -1732,7 +1735,7 @@ void MainWindow::on_actionReportBug_triggered()

void MainWindow::on_actionPatreon_triggered()
{
DesktopServices::openUrl(QUrl("https://www.patreon.com/multimc"));
DesktopServices::openUrl(QUrl(BuildConfig.PATREON_URL));
}

void MainWindow::on_actionMoreNews_triggered()
Expand Down