aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
Diffstat (limited to 'launcher')
-rw-r--r--launcher/modplatform/flame/FlameInstanceCreationTask.cpp4
-rw-r--r--launcher/net/Validator.h1
-rw-r--r--launcher/tasks/Task.h1
-rw-r--r--launcher/ui/pages/instance/ManagedPackPage.cpp16
-rw-r--r--launcher/ui/pages/instance/ManagedPackPage.ui12
-rw-r--r--launcher/ui/pages/instance/ServersPage.cpp20
6 files changed, 33 insertions, 21 deletions
diff --git a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
index c170a4f5..9fe8d486 100644
--- a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
+++ b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
@@ -354,11 +354,11 @@ bool FlameCreationTask::createInstance()
id.remove("forge-");
loaderType = "forge";
loaderUid = "net.minecraftforge";
- } else if (loaderType == "fabric") {
+ } else if (id.startsWith("fabric-")) {
id.remove("fabric-");
loaderType = "fabric";
loaderUid = "net.fabricmc.fabric-loader";
- } else if (loaderType == "quilt") {
+ } else if (id.startsWith("quilt-")) {
id.remove("quilt-");
loaderType = "quilt";
loaderUid = "org.quiltmc.quilt-loader";
diff --git a/launcher/net/Validator.h b/launcher/net/Validator.h
index 7eaede7b..92ac6ea1 100644
--- a/launcher/net/Validator.h
+++ b/launcher/net/Validator.h
@@ -40,7 +40,6 @@ namespace Net {
class Validator {
public: /* con/des */
Validator() {}
-
virtual ~Validator() {}
public: /* methods */
diff --git a/launcher/tasks/Task.h b/launcher/tasks/Task.h
index a6f039de..94b4089f 100644
--- a/launcher/tasks/Task.h
+++ b/launcher/tasks/Task.h
@@ -61,7 +61,6 @@ struct TaskStepProgress {
TaskStepState state = TaskStepState::Waiting;
TaskStepProgress() { this->uid = QUuid::createUuid(); }
-
TaskStepProgress(QUuid uid_) : uid(uid_) {}
bool isDone() const { return (state == TaskStepState::Failed) || (state == TaskStepState::Succeeded); }
diff --git a/launcher/ui/pages/instance/ManagedPackPage.cpp b/launcher/ui/pages/instance/ManagedPackPage.cpp
index 82de9742..8fdaf065 100644
--- a/launcher/ui/pages/instance/ManagedPackPage.cpp
+++ b/launcher/ui/pages/instance/ManagedPackPage.cpp
@@ -3,6 +3,9 @@
// SPDX-License-Identifier: GPL-3.0-only
#include "ManagedPackPage.h"
+#include <QDesktopServices>
+#include <QUrl>
+#include <QUrlQuery>
#include "ui_ManagedPackPage.h"
#include <QListView>
@@ -105,6 +108,19 @@ ManagedPackPage::ManagedPackPage(BaseInstance* inst, InstanceWindow* instance_wi
// Pretend we're opening the page again
openedImpl();
});
+
+ connect(ui->changelogTextBrowser, &QTextBrowser::anchorClicked, this, [](const QUrl url) {
+ if (url.scheme().isEmpty()) {
+ auto querry =
+ QUrlQuery(url.query()).queryItemValue("remoteUrl", QUrl::FullyDecoded); // curseforge workaround for linkout?remoteUrl=
+ auto decoded = QUrl::fromPercentEncoding(querry.toUtf8());
+ auto newUrl = QUrl(decoded);
+ if (newUrl.isValid() && (newUrl.scheme() == "http" || newUrl.scheme() == "https"))
+ QDesktopServices ::openUrl(newUrl);
+ return;
+ }
+ QDesktopServices::openUrl(url);
+ });
}
ManagedPackPage::~ManagedPackPage()
diff --git a/launcher/ui/pages/instance/ManagedPackPage.ui b/launcher/ui/pages/instance/ManagedPackPage.ui
index bbe44a94..05e91bbc 100644
--- a/launcher/ui/pages/instance/ManagedPackPage.ui
+++ b/launcher/ui/pages/instance/ManagedPackPage.ui
@@ -168,10 +168,13 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
- <widget class="QTextBrowser" name="changelogTextBrowser">
+ <widget class="ProjectDescriptionPage" name="changelogTextBrowser">
<property name="placeholderText">
<string>No changelog available for this version!</string>
</property>
+ <property name="openLinks">
+ <bool>false</bool>
+ </property>
</widget>
</item>
</layout>
@@ -188,6 +191,13 @@
</item>
</layout>
</widget>
+ <customwidgets>
+ <customwidget>
+ <class>ProjectDescriptionPage</class>
+ <extends>QTextBrowser</extends>
+ <header>ui/widgets/ProjectDescriptionPage.h</header>
+ </customwidget>
+ </customwidgets>
<resources/>
<connections/>
</ui>
diff --git a/launcher/ui/pages/instance/ServersPage.cpp b/launcher/ui/pages/instance/ServersPage.cpp
index da49f4a7..5c31f73b 100644
--- a/launcher/ui/pages/instance/ServersPage.cpp
+++ b/launcher/ui/pages/instance/ServersPage.cpp
@@ -354,14 +354,8 @@ class ServersModel : public QAbstractListModel {
}
}
- virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override
- {
- return parent.isValid() ? 0 : m_servers.size();
- }
- int columnCount(const QModelIndex& parent) const override
- {
- return parent.isValid() ? 0 : COLUMN_COUNT;
- }
+ virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override { return parent.isValid() ? 0 : m_servers.size(); }
+ int columnCount(const QModelIndex& parent) const override { return parent.isValid() ? 0 : COLUMN_COUNT; }
Server* at(int index)
{
@@ -445,10 +439,7 @@ class ServersModel : public QAbstractListModel {
qDebug() << "Changed:" << path;
load();
}
- void fileChanged(const QString& path)
- {
- qDebug() << "Changed:" << path;
- }
+ void fileChanged(const QString& path) { qDebug() << "Changed:" << path; }
private slots:
void save_internal()
@@ -492,10 +483,7 @@ class ServersModel : public QAbstractListModel {
m_saveTimer.stop();
}
- bool saveIsScheduled() const
- {
- return m_dirty;
- }
+ bool saveIsScheduled() const { return m_dirty; }
void updateFSObserver()
{