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 news URL #5431

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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_DEPRECATED_WARNINGS=Y")
##################################### Set Application options #####################################

######## Set URLs ########
set(Launcher_NEWS_URL "https://multimc.org/posts.html" CACHE STRING "URL to open Launcher's news.")
set(Launcher_NEWS_RSS_URL "https://multimc.org/rss.xml" CACHE STRING "URL to fetch Launcher's news RSS feed from.")

######## Set version numbers ########
Expand Down
1 change: 1 addition & 0 deletions buildconfig/BuildConfig.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Config::Config()
}

VERSION_STR = "@Launcher_VERSION_STRING@";
NEWS_URL = "@Launcher_NEWS_URL@";
NEWS_RSS_URL = "@Launcher_NEWS_RSS_URL@";
PASTE_EE_KEY = "@Launcher_PASTE_EE_API_KEY@";
IMGUR_CLIENT_ID = "@Launcher_IMGUR_CLIENT_ID@";
Expand Down
6 changes: 6 additions & 0 deletions buildconfig/BuildConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ class Config
/// This is printed on start to standard output
QString VERSION_STR;

/**
* This is used to open the news page with the "More news" button.
* It defaults in CMakeLists.txt to "https://multimc.org/posts.html"
*/
QString NEWS_URL;

/**
* This is used to fetch the news RSS feed.
* It defaults in CMakeLists.txt to "https://multimc.org/rss.xml"
Expand Down
4 changes: 2 additions & 2 deletions launcher/ui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@ void MainWindow::on_actionPatreon_triggered()

void MainWindow::on_actionMoreNews_triggered()
{
DesktopServices::openUrl(QUrl("https://multimc.org/posts.html"));
DesktopServices::openUrl(QUrl(BuildConfig.NEWS_URL));
}

void MainWindow::newsButtonClicked()
Expand All @@ -1749,7 +1749,7 @@ void MainWindow::newsButtonClicked()
}
else
{
DesktopServices::openUrl(QUrl("https://multimc.org/posts.html"));
DesktopServices::openUrl(QUrl(BuildConfig.NEWS_URL));
}
}

Expand Down