Merge pull request #5431 from sasha0552/cust-news-url

NOISSUE Customizable news URL
This commit is contained in:
Petr Mrázek 2024-12-16 02:44:54 +01:00 committed by GitHub
commit 8a265eb67d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 2 deletions

View File

@ -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 ########

View File

@ -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@";

View File

@ -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"

View File

@ -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));
}
}