diff --git a/CMakeLists.txt b/CMakeLists.txt index ddc0956e..d48efc44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ######## diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index 8c04dd4d..e5dc25cd 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -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@"; diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h index 2c41d14a..f09405cd 100644 --- a/buildconfig/BuildConfig.h +++ b/buildconfig/BuildConfig.h @@ -64,6 +64,12 @@ public: /// 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" diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 0a747734..be732511 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -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() @@ -1749,7 +1749,7 @@ void MainWindow::newsButtonClicked() } else { - DesktopServices::openUrl(QUrl("https://multimc.org/posts.html")); + DesktopServices::openUrl(QUrl(BuildConfig.NEWS_URL)); } }