aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-03-06 11:31:50 +0100
committerSefa Eyeoglu <contact@scrumplex.net>2022-03-06 11:31:50 +0100
commit6545d250e8f3e10385cbf86f0d7f46feb7b2456c (patch)
treeff36d4b5f096427aac64db888b591ff9e50bebed
parentb162351ff45a124b9f1df7658f4cfb8d607737a3 (diff)
downloadPrismLauncher-6545d250e8f3e10385cbf86f0d7f46feb7b2456c.tar.gz
PrismLauncher-6545d250e8f3e10385cbf86f0d7f46feb7b2456c.tar.bz2
PrismLauncher-6545d250e8f3e10385cbf86f0d7f46feb7b2456c.zip
refactor: move help URL into buildconfig
-rw-r--r--CMakeLists.txt1
-rw-r--r--buildconfig/BuildConfig.cpp.in1
-rw-r--r--buildconfig/BuildConfig.h5
-rw-r--r--launcher/ui/widgets/PageContainer.cpp3
4 files changed, 9 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c370b6ea..bf1b222b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,6 +48,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_DEPRECATED_WARNINGS=Y")
######## Set URLs ########
set(Launcher_NEWS_RSS_URL "https://polymc.github.io/feed/feed.xml" CACHE STRING "URL to fetch PolyMC's news RSS feed from.")
set(Launcher_NEWS_OPEN_URL "https://polymc.github.io/news/" CACHE STRING "URL that gets opened when the user clicks 'More News'")
+set(Launcher_HELP_URL "https://polymc.org/wiki/%1" CACHE STRING "URL (with arg %1 to be substituted with page-id) that gets opened when the user requests help")
######## Set version numbers ########
set(Launcher_VERSION_MAJOR 1)
diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in
index 0ffc9326..80c67037 100644
--- a/buildconfig/BuildConfig.cpp.in
+++ b/buildconfig/BuildConfig.cpp.in
@@ -50,6 +50,7 @@ Config::Config()
VERSION_STR = "@Launcher_VERSION_STRING@";
NEWS_RSS_URL = "@Launcher_NEWS_RSS_URL@";
NEWS_OPEN_URL = "@Launcher_NEWS_OPEN_URL@";
+ HELP_URL = "@Launcher_HELP_URL@";
IMGUR_CLIENT_ID = "@Launcher_IMGUR_CLIENT_ID@";
MSA_CLIENT_ID = "@Launcher_MSA_CLIENT_ID@";
META_URL = "@Launcher_META_URL@";
diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h
index 863f88df..95619587 100644
--- a/buildconfig/BuildConfig.h
+++ b/buildconfig/BuildConfig.h
@@ -74,6 +74,11 @@ public:
QString NEWS_OPEN_URL;
/**
+ * URL (with arg %1 to be substituted with page-id) that gets opened when the user requests help
+ */
+ QString HELP_URL;
+
+ /**
* Client ID you can get from Imgur when you register an application
*/
QString IMGUR_CLIENT_ID;
diff --git a/launcher/ui/widgets/PageContainer.cpp b/launcher/ui/widgets/PageContainer.cpp
index 368bfe40..558a98fb 100644
--- a/launcher/ui/widgets/PageContainer.cpp
+++ b/launcher/ui/widgets/PageContainer.cpp
@@ -14,6 +14,7 @@
*/
#include "PageContainer.h"
+#include "BuildConfig.h"
#include "PageContainer_p.h"
#include <QStackedLayout>
@@ -207,7 +208,7 @@ void PageContainer::help()
QString pageId = m_currentPage->helpPage();
if (pageId.isEmpty())
return;
- DesktopServices::openUrl(QUrl("https://polymc.org/wiki/" + pageId));
+ DesktopServices::openUrl(QUrl(BuildConfig.HELP_URL.arg(pageId)));
}
}