fix: open correct wiki URL when opened from the Help *menu*

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2026-03-04 22:16:48 +05:00
parent b114d043f6
commit 979973b313
No known key found for this signature in database
GPG key ID: B77C34313AEE1FFF
5 changed files with 14 additions and 7 deletions

View file

@ -172,7 +172,8 @@ endif()
######## Set URLs ######## ######## Set URLs ########
set(Launcher_NEWS_RSS_URL "https://prismlauncher.org/feed/feed.xml" CACHE STRING "URL to fetch Prism Launcher's news RSS feed from.") set(Launcher_NEWS_RSS_URL "https://prismlauncher.org/feed/feed.xml" CACHE STRING "URL to fetch Prism Launcher's news RSS feed from.")
set(Launcher_NEWS_OPEN_URL "https://prismlauncher.org/news" CACHE STRING "URL that gets opened when the user clicks 'More News'") set(Launcher_NEWS_OPEN_URL "https://prismlauncher.org/news" CACHE STRING "URL that gets opened when the user clicks 'More News'")
set(Launcher_HELP_URL "https://prismlauncher.org/wiki/help-pages/%1" CACHE STRING "URL (with arg %1 to be substituted with page-id) that gets opened when the user requests help") set(Launcher_WIKI_URL "https://prismlauncher.org/wiki/" CACHE STRING "URL that gets opened when the user clicks 'Launcher Help'")
set(Launcher_HELP_URL "https://prismlauncher.org/wiki/help-pages/%1" CACHE STRING "URL (with arg %1 to be substituted with page-id) that gets opened when the user requests help in a dialog window")
set(Launcher_LOGIN_CALLBACK_URL "https://prismlauncher.org/successful-login" CACHE STRING "URL that gets opened when the user successfully logins.") set(Launcher_LOGIN_CALLBACK_URL "https://prismlauncher.org/successful-login" CACHE STRING "URL that gets opened when the user successfully logins.")
set(Launcher_LEGACY_FMLLIBS_BASE_URL "https://files.prismlauncher.org/fmllibs/" CACHE STRING "URL for legacy (<=1.5.2) FML Libraries.") set(Launcher_LEGACY_FMLLIBS_BASE_URL "https://files.prismlauncher.org/fmllibs/" CACHE STRING "URL for legacy (<=1.5.2) FML Libraries.")

View file

@ -105,6 +105,7 @@ Config::Config()
NEWS_RSS_URL = "@Launcher_NEWS_RSS_URL@"; NEWS_RSS_URL = "@Launcher_NEWS_RSS_URL@";
NEWS_OPEN_URL = "@Launcher_NEWS_OPEN_URL@"; NEWS_OPEN_URL = "@Launcher_NEWS_OPEN_URL@";
WIKI_URL = "@Launcher_WIKI_URL@";
HELP_URL = "@Launcher_HELP_URL@"; HELP_URL = "@Launcher_HELP_URL@";
LOGIN_CALLBACK_URL = "@Launcher_LOGIN_CALLBACK_URL@"; LOGIN_CALLBACK_URL = "@Launcher_LOGIN_CALLBACK_URL@";
IMGUR_CLIENT_ID = "@Launcher_IMGUR_CLIENT_ID@"; IMGUR_CLIENT_ID = "@Launcher_IMGUR_CLIENT_ID@";

View file

@ -128,7 +128,12 @@ class Config {
QString NEWS_OPEN_URL; QString NEWS_OPEN_URL;
/** /**
* URL (with arg %1 to be substituted with page-id) that gets opened when the user requests help * URL that gets opened when the user clicks 'Launcher Help'
*/
QString WIKI_URL;
/**
* URL (with arg %1 to be substituted with page-id) that gets opened when the user requests help in a dialog window
*/ */
QString HELP_URL; QString HELP_URL;

View file

@ -1005,13 +1005,13 @@ void MainWindow::processURLs(QList<QUrl> urls)
receivedData.insert(it->first, it->second); receivedData.insert(it->first, it->second);
emit APPLICATION->oauthReplyRecieved(receivedData); emit APPLICATION->oauthReplyRecieved(receivedData);
continue; continue;
} else if ((url.scheme() == "prismlauncher" || url.scheme() == BuildConfig.LAUNCHER_APP_BINARY_NAME) } else if ((url.scheme() == "prismlauncher" || url.scheme() == BuildConfig.LAUNCHER_APP_BINARY_NAME)
&& isExternalURLImport) { && isExternalURLImport) {
// PrismLauncher URL protocol modpack import // PrismLauncher URL protocol modpack import
// works for any prism fork // works for any prism fork
// preferred import format: prismlauncher://import?url=ENCODED // preferred import format: prismlauncher://import?url=ENCODED
const auto host = url.host().toLower(); const auto host = url.host().toLower();
const auto path = url.path(); const auto path = url.path();
QString encodedTarget; QString encodedTarget;
@ -1075,7 +1075,7 @@ void MainWindow::processURLs(QList<QUrl> urls)
if (res != QMessageBox::Yes) { if (res != QMessageBox::Yes) {
continue; continue;
} }
dl_url = target; dl_url = target;
} else { } else {
dl_url = url; dl_url = url;
@ -1435,7 +1435,7 @@ void MainWindow::on_actionAddToPATH_triggered()
void MainWindow::on_actionOpenWiki_triggered() void MainWindow::on_actionOpenWiki_triggered()
{ {
DesktopServices::openUrl(QUrl(BuildConfig.HELP_URL.arg(""))); DesktopServices::openUrl(QUrl(BuildConfig.WIKI_URL));
} }
void MainWindow::on_actionMoreNews_triggered() void MainWindow::on_actionMoreNews_triggered()

View file

@ -721,7 +721,7 @@
<iconset theme="help"/> <iconset theme="help"/>
</property> </property>
<property name="text"> <property name="text">
<string>%1 &amp;Help</string> <string>%1 &amp;Wiki</string>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Open the %1 wiki</string> <string>Open the %1 wiki</string>