aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
authorRachel Powers <508861+Ryex@users.noreply.github.com>2023-05-12 01:13:17 -0700
committerGitHub <noreply@github.com>2023-05-12 01:13:17 -0700
commit6b6d6a01dc9cf05715f01e3a549740b169ef9ae3 (patch)
tree8ba9746a188c39003213839825552543e3f1a48f /launcher
parentf27716656c6f6006238203669a7a02f035733fc0 (diff)
parentc5aff7cc1ef43a1326bd3ce0c83e29669e2ff43f (diff)
downloadPrismLauncher-6b6d6a01dc9cf05715f01e3a549740b169ef9ae3.tar.gz
PrismLauncher-6b6d6a01dc9cf05715f01e3a549740b169ef9ae3.tar.bz2
PrismLauncher-6b6d6a01dc9cf05715f01e3a549740b169ef9ae3.zip
Merge branch 'develop' into fix/network_and_signals
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher')
-rw-r--r--launcher/Application.cpp44
-rw-r--r--launcher/Application.h5
-rw-r--r--launcher/BaseInstance.cpp36
-rw-r--r--launcher/BaseInstance.h6
-rw-r--r--launcher/CMakeLists.txt124
-rw-r--r--launcher/DesktopServices.cpp1
-rw-r--r--launcher/FileSystem.cpp967
-rw-r--r--launcher/FileSystem.h347
-rw-r--r--launcher/InstanceCopyPrefs.cpp59
-rw-r--r--launcher/InstanceCopyPrefs.h16
-rw-r--r--launcher/InstanceCopyTask.cpp103
-rw-r--r--launcher/InstanceCopyTask.h5
-rw-r--r--launcher/InstanceImportTask.cpp5
-rw-r--r--launcher/InstanceList.cpp14
-rw-r--r--launcher/InstanceList.h2
-rw-r--r--launcher/MMCTime.cpp64
-rw-r--r--launcher/MMCTime.h9
-rw-r--r--launcher/MMCZip.cpp16
-rw-r--r--launcher/MMCZip.h6
-rw-r--r--launcher/QVariantUtils.h70
-rw-r--r--launcher/ResourceDownloadTask.cpp1
-rw-r--r--launcher/StringUtils.cpp108
-rw-r--r--launcher/StringUtils.h50
-rw-r--r--launcher/filelink/FileLink.cpp277
-rw-r--r--launcher/filelink/FileLink.h67
-rw-r--r--launcher/filelink/filelink.exe.manifest28
-rw-r--r--launcher/filelink/main.cpp30
-rw-r--r--launcher/launch/steps/Update.cpp2
-rw-r--r--launcher/minecraft/MinecraftInstance.cpp19
-rw-r--r--launcher/minecraft/MinecraftLoadAndCheck.cpp1
-rw-r--r--launcher/minecraft/MinecraftUpdate.cpp4
-rw-r--r--launcher/minecraft/World.cpp24
-rw-r--r--launcher/minecraft/World.h15
-rw-r--r--launcher/minecraft/WorldList.cpp34
-rw-r--r--launcher/minecraft/WorldList.h9
-rw-r--r--launcher/minecraft/mod/ModFolderModel.cpp24
-rw-r--r--launcher/minecraft/mod/ModFolderModel.h2
-rw-r--r--launcher/minecraft/mod/Resource.cpp20
-rw-r--r--launcher/minecraft/mod/Resource.h13
-rw-r--r--launcher/minecraft/mod/ResourceFolderModel.cpp32
-rw-r--r--launcher/minecraft/mod/ResourceFolderModel.h7
-rw-r--r--launcher/minecraft/mod/ResourcePackFolderModel.cpp24
-rw-r--r--launcher/minecraft/mod/ResourcePackFolderModel.h2
-rw-r--r--launcher/minecraft/mod/ShaderPackFolderModel.h4
-rw-r--r--launcher/minecraft/mod/TexturePackFolderModel.cpp4
-rw-r--r--launcher/minecraft/mod/TexturePackFolderModel.h2
-rw-r--r--launcher/minecraft/mod/tasks/LocalModParseTask.cpp6
-rw-r--r--launcher/minecraft/update/AssetUpdateTask.cpp2
-rw-r--r--launcher/minecraft/update/FMLLibrariesTask.cpp1
-rw-r--r--launcher/minecraft/update/LibrariesTask.cpp2
-rw-r--r--launcher/modplatform/atlauncher/ATLPackInstallTask.cpp3
-rw-r--r--launcher/modplatform/flame/FlameInstanceCreationTask.cpp11
-rw-r--r--launcher/modplatform/legacy_ftb/PackInstallTask.cpp1
-rw-r--r--launcher/modplatform/modpacksch/FTBPackInstallTask.cpp387
-rw-r--r--launcher/modplatform/modpacksch/FTBPackInstallTask.h101
-rw-r--r--launcher/modplatform/modpacksch/FTBPackManifest.cpp195
-rw-r--r--launcher/modplatform/modpacksch/FTBPackManifest.h168
-rw-r--r--launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp9
-rw-r--r--launcher/modplatform/technic/SingleZipPackInstallTask.cpp1
-rw-r--r--launcher/modplatform/technic/SolderPackInstallTask.cpp1
-rw-r--r--launcher/net/Download.cpp86
-rw-r--r--launcher/net/Download.h10
-rw-r--r--launcher/net/FileSink.cpp12
-rw-r--r--launcher/net/FileSink.h2
-rw-r--r--launcher/net/HttpMetaCache.cpp18
-rw-r--r--launcher/net/HttpMetaCache.h2
-rw-r--r--launcher/net/Logging.cpp26
-rw-r--r--launcher/net/Logging.h28
-rw-r--r--launcher/net/MetaCacheSink.cpp12
-rw-r--r--launcher/net/MetaCacheSink.h2
-rw-r--r--launcher/net/NetAction.h7
-rw-r--r--launcher/net/NetJob.cpp3
-rw-r--r--launcher/net/NetJob.h3
-rw-r--r--launcher/net/PasteUpload.cpp24
-rw-r--r--launcher/net/PasteUpload.h2
-rw-r--r--launcher/net/Upload.cpp39
-rw-r--r--launcher/net/Upload.h3
-rw-r--r--launcher/qtlogging.ini16
-rw-r--r--launcher/settings/INIFile.cpp137
-rw-r--r--launcher/settings/INIFile.h47
-rw-r--r--launcher/settings/SettingsObject.h2
-rw-r--r--launcher/tasks/ConcurrentTask.cpp199
-rw-r--r--launcher/tasks/ConcurrentTask.h70
-rw-r--r--launcher/tasks/MultipleOptionsTask.cpp34
-rw-r--r--launcher/tasks/MultipleOptionsTask.h34
-rw-r--r--launcher/tasks/SequentialTask.cpp35
-rw-r--r--launcher/tasks/SequentialTask.h35
-rw-r--r--launcher/tasks/Task.cpp50
-rw-r--r--launcher/tasks/Task.h52
-rw-r--r--launcher/ui/MainWindow.cpp14
-rw-r--r--launcher/ui/dialogs/BlockedModsDialog.cpp39
-rw-r--r--launcher/ui/dialogs/CopyInstanceDialog.cpp125
-rw-r--r--launcher/ui/dialogs/CopyInstanceDialog.h33
-rw-r--r--launcher/ui/dialogs/CopyInstanceDialog.ui358
-rw-r--r--launcher/ui/dialogs/ExportInstanceDialog.cpp5
-rw-r--r--launcher/ui/dialogs/NewInstanceDialog.cpp2
-rw-r--r--launcher/ui/dialogs/ProgressDialog.cpp136
-rw-r--r--launcher/ui/dialogs/ProgressDialog.h54
-rw-r--r--launcher/ui/dialogs/ProgressDialog.ui150
-rw-r--r--launcher/ui/pages/global/MinecraftPage.cpp1
-rw-r--r--launcher/ui/pages/global/MinecraftPage.ui133
-rw-r--r--launcher/ui/pages/instance/WorldListPage.cpp1
-rw-r--r--launcher/ui/pages/modplatform/ftb/FtbFilterModel.cpp93
-rw-r--r--launcher/ui/pages/modplatform/ftb/FtbFilterModel.h51
-rw-r--r--launcher/ui/pages/modplatform/ftb/FtbListModel.cpp304
-rw-r--r--launcher/ui/pages/modplatform/ftb/FtbListModel.h83
-rw-r--r--launcher/ui/pages/modplatform/ftb/FtbPage.cpp199
-rw-r--r--launcher/ui/pages/modplatform/ftb/FtbPage.h105
-rw-r--r--launcher/ui/pages/modplatform/ftb/FtbPage.ui86
-rw-r--r--launcher/ui/widgets/ProgressWidget.cpp1
-rw-r--r--launcher/ui/widgets/SubTaskProgressBar.cpp58
-rw-r--r--launcher/ui/widgets/SubTaskProgressBar.h48
-rw-r--r--launcher/ui/widgets/SubTaskProgressBar.ui94
113 files changed, 4326 insertions, 2427 deletions
diff --git a/launcher/Application.cpp b/launcher/Application.cpp
index a7c97aa7..1659eb44 100644
--- a/launcher/Application.cpp
+++ b/launcher/Application.cpp
@@ -8,6 +8,7 @@
* Copyright (C) 2022 Lenny McLennington <lenny@sneed.church>
* Copyright (C) 2022 Tayou <tayou@gmx.net>
* Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me>
+ * Copyright (C) 2023 Rachel Powers <508861+Ryex@users.noreply.github.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -46,6 +47,7 @@
#include "net/PasteUpload.h"
#include "pathmatcher/MultiMatcher.h"
#include "pathmatcher/SimplePrefixMatcher.h"
+#include "settings/INIFile.h"
#include "ui/MainWindow.h"
#include "ui/InstanceWindow.h"
@@ -286,6 +288,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
if (QFile::exists(FS::PathCombine(m_rootPath, "portable.txt"))) {
dataPath = m_rootPath;
adjustedBy = "Portable data path";
+ m_portable = true;
}
#endif
}
@@ -410,6 +413,47 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
" " "|" " "
"%{if-category}[%{category}]: %{endif}"
"%{message}");
+
+ bool foundLoggingRules = false;
+
+ auto logRulesFile = QStringLiteral("qtlogging.ini");
+ auto logRulesPath = FS::PathCombine(dataPath, logRulesFile);
+
+ qDebug() << "Testing" << logRulesPath << "...";
+ foundLoggingRules = QFile::exists(logRulesPath);
+
+ // search the dataPath()
+ // seach app data standard path
+ if(!foundLoggingRules && !isPortable() && dirParam.isEmpty()) {
+ logRulesPath = QStandardPaths::locate(QStandardPaths::AppDataLocation, FS::PathCombine("..", logRulesFile));
+ if(!logRulesPath.isEmpty()) {
+ qDebug() << "Found" << logRulesPath << "...";
+ foundLoggingRules = true;
+ }
+ }
+ // seach root path
+ if(!foundLoggingRules) {
+ logRulesPath = FS::PathCombine(m_rootPath, logRulesFile);
+ qDebug() << "Testing" << logRulesPath << "...";
+ foundLoggingRules = QFile::exists(logRulesPath);
+ }
+
+ if(foundLoggingRules) {
+ // load and set logging rules
+ qDebug() << "Loading logging rules from:" << logRulesPath;
+ QSettings loggingRules(logRulesPath, QSettings::IniFormat);
+ loggingRules.beginGroup("Rules");
+ QStringList rule_names = loggingRules.childKeys();
+ QStringList rules;
+ qDebug() << "Setting log rules:";
+ for (auto rule_name : rule_names) {
+ auto rule = QString("%1=%2").arg(rule_name).arg(loggingRules.value(rule_name).toString());
+ rules.append(rule);
+ qDebug() << " " << rule;
+ }
+ auto rules_str = rules.join("\n");
+ QLoggingCategory::setFilterRules(rules_str);
+ }
qDebug() << "<> Log initialized.";
}
diff --git a/launcher/Application.h b/launcher/Application.h
index 0d24a4e9..ced0af17 100644
--- a/launcher/Application.h
+++ b/launcher/Application.h
@@ -187,6 +187,10 @@ public:
return m_rootPath;
}
+ bool isPortable() {
+ return m_portable;
+ }
+
const Capabilities capabilities() {
return m_capabilities;
}
@@ -275,6 +279,7 @@ private:
QString m_rootPath;
Status m_status = Application::StartingUp;
Capabilities m_capabilities;
+ bool m_portable = false;
#ifdef Q_OS_MACOS
Qt::ApplicationState m_prevAppState = Qt::ApplicationInactive;
diff --git a/launcher/BaseInstance.cpp b/launcher/BaseInstance.cpp
index 8680361c..a8fce879 100644
--- a/launcher/BaseInstance.cpp
+++ b/launcher/BaseInstance.cpp
@@ -40,6 +40,8 @@
#include <QDir>
#include <QDebug>
#include <QRegularExpression>
+#include <QJsonDocument>
+#include <QJsonObject>
#include "settings/INISettingsObject.h"
#include "settings/Setting.h"
@@ -64,6 +66,8 @@ BaseInstance::BaseInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr s
m_settings->registerSetting("totalTimePlayed", 0);
m_settings->registerSetting("lastTimePlayed", 0);
+ m_settings->registerSetting("linkedInstances", "[]");
+
// Game time override
auto gameTimeOverride = m_settings->registerSetting("OverrideGameTime", false);
m_settings->registerOverride(globalSettings->getSetting("ShowGameTime"), gameTi