From bca120e79898854d40d033bed91e3b6675fb68fb Mon Sep 17 00:00:00 2001 From: HyperSoop Date: Tue, 11 Jul 2023 21:25:26 +0300 Subject: [PATCH 01/56] Reduce mininmum memory amounts Signed-off-by: HyperSoop --- launcher/ui/pages/global/JavaPage.ui | 6 +++--- launcher/ui/pages/instance/InstanceSettingsPage.ui | 6 +++--- launcher/ui/widgets/JavaSettingsWidget.cpp | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/launcher/ui/pages/global/JavaPage.ui b/launcher/ui/pages/global/JavaPage.ui index 6749cbe41..1a217e825 100644 --- a/launcher/ui/pages/global/JavaPage.ui +++ b/launcher/ui/pages/global/JavaPage.ui @@ -84,7 +84,7 @@ MiB - 128 + 8 1048576 @@ -106,7 +106,7 @@ MiB - 128 + 8 1048576 @@ -128,7 +128,7 @@ MiB - 64 + 4 999999999 diff --git a/launcher/ui/pages/instance/InstanceSettingsPage.ui b/launcher/ui/pages/instance/InstanceSettingsPage.ui index 8427965de..c2282ce87 100644 --- a/launcher/ui/pages/instance/InstanceSettingsPage.ui +++ b/launcher/ui/pages/instance/InstanceSettingsPage.ui @@ -150,7 +150,7 @@ MiB - 128 + 8 1048576 @@ -172,7 +172,7 @@ MiB - 128 + 8 1048576 @@ -194,7 +194,7 @@ MiB - 64 + 4 999999999 diff --git a/launcher/ui/widgets/JavaSettingsWidget.cpp b/launcher/ui/widgets/JavaSettingsWidget.cpp index c94fdd8d5..03ca363f3 100644 --- a/launcher/ui/widgets/JavaSettingsWidget.cpp +++ b/launcher/ui/widgets/JavaSettingsWidget.cpp @@ -80,7 +80,7 @@ void JavaSettingsWidget::setupUi() m_minMemSpinBox = new QSpinBox(m_memoryGroupBox); m_minMemSpinBox->setObjectName(QStringLiteral("minMemSpinBox")); m_minMemSpinBox->setSuffix(QStringLiteral(" MiB")); - m_minMemSpinBox->setMinimum(128); + m_minMemSpinBox->setMinimum(8); m_minMemSpinBox->setMaximum(1048576); m_minMemSpinBox->setSingleStep(128); m_labelMinMem->setBuddy(m_minMemSpinBox); @@ -93,7 +93,7 @@ void JavaSettingsWidget::setupUi() m_maxMemSpinBox = new QSpinBox(m_memoryGroupBox); m_maxMemSpinBox->setObjectName(QStringLiteral("maxMemSpinBox")); m_maxMemSpinBox->setSuffix(QStringLiteral(" MiB")); - m_maxMemSpinBox->setMinimum(128); + m_maxMemSpinBox->setMinimum(8); m_maxMemSpinBox->setMaximum(1048576); m_maxMemSpinBox->setSingleStep(128); m_labelMaxMem->setBuddy(m_maxMemSpinBox); @@ -112,7 +112,7 @@ void JavaSettingsWidget::setupUi() m_permGenSpinBox = new QSpinBox(m_memoryGroupBox); m_permGenSpinBox->setObjectName(QStringLiteral("permGenSpinBox")); m_permGenSpinBox->setSuffix(QStringLiteral(" MiB")); - m_permGenSpinBox->setMinimum(64); + m_permGenSpinBox->setMinimum(4); m_permGenSpinBox->setMaximum(1048576); m_permGenSpinBox->setSingleStep(8); m_gridLayout_2->addWidget(m_permGenSpinBox, 2, 1, 1, 1); From 4f1ee854249f62c36dd9e8e1d9fbbc0b20bc09ec Mon Sep 17 00:00:00 2001 From: Trial97 Date: Fri, 6 Oct 2023 00:21:37 +0300 Subject: [PATCH 02/56] check for minecraft java runtime Signed-off-by: Trial97 --- launcher/java/JavaUtils.cpp | 43 +++++++++++++++++++++++++++++++++++++ launcher/java/JavaUtils.h | 1 + 2 files changed, 44 insertions(+) diff --git a/launcher/java/JavaUtils.cpp b/launcher/java/JavaUtils.cpp index cca1ed6d4..9f682e086 100644 --- a/launcher/java/JavaUtils.cpp +++ b/launcher/java/JavaUtils.cpp @@ -335,6 +335,7 @@ QList JavaUtils::FindJavaPaths() } } + javas.append(getMinecraftJavaBundle()); candidates = addJavasFromEnv(candidates); candidates.removeDuplicates(); return candidates; @@ -360,6 +361,7 @@ QList JavaUtils::FindJavaPaths() javas.append(systemLibraryJVMDir.absolutePath() + "/" + java + "/Contents/Home/bin/java"); javas.append(systemLibraryJVMDir.absolutePath() + "/" + java + "/Contents/Commands/java"); } + javas.append(getMinecraftJavaBundle()); javas = addJavasFromEnv(javas); javas.removeDuplicates(); return javas; @@ -411,6 +413,7 @@ QList JavaUtils::FindJavaPaths() // javas downloaded by sdkman scanJavaDirs(FS::PathCombine(home, ".sdkman/candidates/java")); + javas.append(getMinecraftJavaBundle()); javas = addJavasFromEnv(javas); javas.removeDuplicates(); return javas; @@ -423,6 +426,7 @@ QList JavaUtils::FindJavaPaths() QList javas; javas.append(this->GetDefaultJava()->path); + javas.append(getMinecraftJavaBundle()); return addJavasFromEnv(javas); } #endif @@ -431,3 +435,42 @@ QString JavaUtils::getJavaCheckPath() { return APPLICATION->getJarPath("JavaCheck.jar"); } + +QStringList getMinecraftJavaBundle() +{ + QString partialPath; + QString executable = "java"; +#if defined(Q_OS_OSX) + partialPath = FS::PathCombine(QDir::homePath(), "Library/Application Support"); +#elif defined(Q_OS_WIN32) + partialPath = QProcessEnvironment::systemEnvironment().value("LOCALAPPDATA", ""); + executable += "w.exe"; +#else + partialPath = QDir::homePath(); +#endif + auto minecraftPath = FS::PathCombine(partialPath, ".minecraft", "runtime"); + QStringList javas; + QStringList processpaths{ minecraftPath }; + + while (!processpaths.isEmpty()) { + auto dirPath = processpaths.takeFirst(); + QDir dir(dirPath); + if (!dir.exists()) + continue; + auto entries = dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot); + auto binFound = false; + for (auto& entry : entries) { + if (entry.baseName() == "bin") { + javas.append(FS::PathCombine(entry.canonicalFilePath(), executable)); + binFound = true; + break; + } + } + if (!binFound) { + for (auto& entry : entries) { + processpaths << entry.canonicalFilePath(); + } + } + } + return javas; +} diff --git a/launcher/java/JavaUtils.h b/launcher/java/JavaUtils.h index 616179706..2fb03af7a 100644 --- a/launcher/java/JavaUtils.h +++ b/launcher/java/JavaUtils.h @@ -26,6 +26,7 @@ QString stripVariableEntries(QString name, QString target, QString remove); QProcessEnvironment CleanEnviroment(); +QStringList getMinecraftJavaBundle(); class JavaUtils : public QObject { Q_OBJECT From 82461b1113b01a4305046b5da69dbf60e885f756 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Fri, 6 Oct 2023 08:51:45 +0300 Subject: [PATCH 03/56] rename for windows Signed-off-by: Trial97 --- launcher/java/JavaUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/java/JavaUtils.cpp b/launcher/java/JavaUtils.cpp index 9f682e086..10bbb1f1b 100644 --- a/launcher/java/JavaUtils.cpp +++ b/launcher/java/JavaUtils.cpp @@ -335,7 +335,7 @@ QList JavaUtils::FindJavaPaths() } } - javas.append(getMinecraftJavaBundle()); + candidates.append(getMinecraftJavaBundle()); candidates = addJavasFromEnv(candidates); candidates.removeDuplicates(); return candidates; From e66c3b94199fe3fe0d7fd1a29c26858f01cb3fc0 Mon Sep 17 00:00:00 2001 From: Hazel Date: Wed, 11 Oct 2023 23:19:14 +0200 Subject: [PATCH 04/56] Add game category to generated Linux shortcuts Signed-off-by: Hazel --- launcher/FileSystem.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp index defb2cb9e..00a6ee539 100644 --- a/launcher/FileSystem.cpp +++ b/launcher/FileSystem.cpp @@ -872,6 +872,8 @@ bool createShortcut(QString destination, QString target, QStringList args, QStri << "\n"; stream << "Type=Application" << "\n"; + stream << "Categories=Game" + << "\n"; stream << "Exec=\"" << target.toLocal8Bit() << "\"" << argstring.toLocal8Bit() << "\n"; stream << "Name=" << name.toLocal8Bit() << "\n"; if (!icon.isEmpty()) { From 7b62d146838967903addc80247cf6e7db9862967 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Fri, 20 Oct 2023 17:15:12 +0300 Subject: [PATCH 05/56] fixed squished mod icons Signed-off-by: Trial97 --- launcher/minecraft/mod/ModFolderModel.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/launcher/minecraft/mod/ModFolderModel.cpp b/launcher/minecraft/mod/ModFolderModel.cpp index a5f1489dd..b1e35f405 100644 --- a/launcher/minecraft/mod/ModFolderModel.cpp +++ b/launcher/minecraft/mod/ModFolderModel.cpp @@ -127,7 +127,18 @@ QVariant ModFolderModel::data(const QModelIndex& index, int role) const if (column == NAME_COLUMN && (at(row)->isSymLinkUnder(instDirPath()) || at(row)->isMoreThanOneHardLink())) return APPLICATION->getThemedIcon("status-yellow"); if (column == ImageColumn) { - return at(row)->icon({ 32, 32 }, Qt::AspectRatioMode::KeepAspectRatioByExpanding); + QSize size(32, 32); + auto icon = at(row)->icon(size, Qt::AspectRatioMode::KeepAspectRatioByExpanding); + if (icon.isNull()) { + QPixmap transparent_image(size); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + transparent_image.fill(QColorConstants::Transparent); +#else + transparent_image.fill(QColor(0, 0, 0, 0)); +#endif + return transparent_image; + } + return icon; } return {}; } From 5d926582c7dcd4a288b9539a4a15338c1bfce21e Mon Sep 17 00:00:00 2001 From: Trial97 Date: Fri, 20 Oct 2023 19:08:56 +0300 Subject: [PATCH 06/56] added Image column size hint Signed-off-by: Trial97 --- launcher/minecraft/mod/ModFolderModel.cpp | 18 ++++++------------ .../minecraft/mod/ResourcePackFolderModel.cpp | 5 +++++ .../minecraft/mod/TexturePackFolderModel.cpp | 5 +++++ 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/launcher/minecraft/mod/ModFolderModel.cpp b/launcher/minecraft/mod/ModFolderModel.cpp index b1e35f405..11f7cd0f1 100644 --- a/launcher/minecraft/mod/ModFolderModel.cpp +++ b/launcher/minecraft/mod/ModFolderModel.cpp @@ -127,21 +127,15 @@ QVariant ModFolderModel::data(const QModelIndex& index, int role) const if (column == NAME_COLUMN && (at(row)->isSymLinkUnder(instDirPath()) || at(row)->isMoreThanOneHardLink())) return APPLICATION->getThemedIcon("status-yellow"); if (column == ImageColumn) { - QSize size(32, 32); - auto icon = at(row)->icon(size, Qt::AspectRatioMode::KeepAspectRatioByExpanding); - if (icon.isNull()) { - QPixmap transparent_image(size); -#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) - transparent_image.fill(QColorConstants::Transparent); -#else - transparent_image.fill(QColor(0, 0, 0, 0)); -#endif - return transparent_image; - } - return icon; + return at(row)->icon({ 32, 32 }, Qt::AspectRatioMode::KeepAspectRatioByExpanding); } return {}; } + case Qt::SizeHintRole: + if (column == ImageColumn) { + return QSize(32, 32); + } + return {}; case Qt::CheckStateRole: switch (column) { case ActiveColumn: diff --git a/launcher/minecraft/mod/ResourcePackFolderModel.cpp b/launcher/minecraft/mod/ResourcePackFolderModel.cpp index f27431576..efe1cc5dd 100644 --- a/launcher/minecraft/mod/ResourcePackFolderModel.cpp +++ b/launcher/minecraft/mod/ResourcePackFolderModel.cpp @@ -117,6 +117,11 @@ QVariant ResourcePackFolderModel::data(const QModelIndex& index, int role) const } return m_resources[row]->internal_id(); } + case Qt::SizeHintRole: + if (column == ImageColumn) { + return QSize(32, 32); + } + return {}; case Qt::CheckStateRole: switch (column) { case ActiveColumn: diff --git a/launcher/minecraft/mod/TexturePackFolderModel.cpp b/launcher/minecraft/mod/TexturePackFolderModel.cpp index 5c5f2b7c1..e39be1fb9 100644 --- a/launcher/minecraft/mod/TexturePackFolderModel.cpp +++ b/launcher/minecraft/mod/TexturePackFolderModel.cpp @@ -104,6 +104,11 @@ QVariant TexturePackFolderModel::data(const QModelIndex& index, int role) const } return {}; } + case Qt::SizeHintRole: + if (column == ImageColumn) { + return QSize(32, 32); + } + return {}; case Qt::CheckStateRole: if (column == ActiveColumn) { return m_resources[row]->enabled() ? Qt::Checked : Qt::Unchecked; From f7c9972db07fc10b58383f55feb5254a6c950315 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Mon, 23 Oct 2023 19:46:30 +0300 Subject: [PATCH 07/56] separated dependecy check from mod update Signed-off-by: Trial97 --- launcher/ui/dialogs/ChooseProviderDialog.h | 1 - launcher/ui/dialogs/ModUpdateDialog.cpp | 6 +++-- launcher/ui/dialogs/ModUpdateDialog.h | 4 +++- .../pages/instance/ExternalResourcesPage.ui | 11 +++++++++ launcher/ui/pages/instance/ModFolderPage.cpp | 23 ++++++++++++------- launcher/ui/pages/instance/ModFolderPage.h | 2 +- 6 files changed, 34 insertions(+), 13 deletions(-) diff --git a/launcher/ui/dialogs/ChooseProviderDialog.h b/launcher/ui/dialogs/ChooseProviderDialog.h index be9735b5c..51e7c98c6 100644 --- a/launcher/ui/dialogs/ChooseProviderDialog.h +++ b/launcher/ui/dialogs/ChooseProviderDialog.h @@ -13,7 +13,6 @@ enum class ResourceProvider; class Mod; class NetJob; -class ModUpdateDialog; class ChooseProviderDialog : public QDialog { Q_OBJECT diff --git a/launcher/ui/dialogs/ModUpdateDialog.cpp b/launcher/ui/dialogs/ModUpdateDialog.cpp index 1a70ea59a..9e91a4aec 100644 --- a/launcher/ui/dialogs/ModUpdateDialog.cpp +++ b/launcher/ui/dialogs/ModUpdateDialog.cpp @@ -39,7 +39,8 @@ static std::optional mcLoaders(BaseInstance* inst) ModUpdateDialog::ModUpdateDialog(QWidget* parent, BaseInstance* instance, const std::shared_ptr mods, - QList& search_for) + QList& search_for, + bool includeDeps) : ReviewMessageBox(parent, tr("Confirm mods to update"), "") , m_parent(parent) , m_mod_model(mods) @@ -47,6 +48,7 @@ ModUpdateDialog::ModUpdateDialog(QWidget* parent, , m_second_try_metadata( new ConcurrentTask(nullptr, "Second Metadata Search", APPLICATION->settings()->get("NumberOfConcurrentTasks").toInt())) , m_instance(instance) + , m_include_deps(includeDeps) { ReviewMessageBox::setGeometry(0, 0, 800, 600); @@ -186,7 +188,7 @@ void ModUpdateDialog::checkCandidates() } } - { // dependencies + if (m_include_deps) { // dependencies auto depTask = makeShared(this, m_instance, m_mod_model.get(), selectedVers); connect(depTask.get(), &Task::failed, this, diff --git a/launcher/ui/dialogs/ModUpdateDialog.h b/launcher/ui/dialogs/ModUpdateDialog.h index b79aa4943..98f6780bf 100644 --- a/launcher/ui/dialogs/ModUpdateDialog.h +++ b/launcher/ui/dialogs/ModUpdateDialog.h @@ -19,7 +19,8 @@ class ModUpdateDialog final : public ReviewMessageBox { explicit ModUpdateDialog(QWidget* parent, BaseInstance* instance, const std::shared_ptr mod_model, - QList& search_for); + QList& search_for, + bool includeDeps); void checkCandidates(); @@ -61,4 +62,5 @@ class ModUpdateDialog final : public ReviewMessageBox { bool m_no_updates = false; bool m_aborted = false; + bool m_include_deps = false; }; diff --git a/launcher/ui/pages/instance/ExternalResourcesPage.ui b/launcher/ui/pages/instance/ExternalResourcesPage.ui index ba703f77d..b9a8e4963 100644 --- a/launcher/ui/pages/instance/ExternalResourcesPage.ui +++ b/launcher/ui/pages/instance/ExternalResourcesPage.ui @@ -156,6 +156,17 @@ Try to check or update all selected resources (all resources if none are selected) + + + + false + + + &Verify Dependencies + + + Try to update and check for missing dependencies all selected resources (all resources if none are selected) + diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp index 625d37933..8e3b9e93b 100644 --- a/launcher/ui/pages/instance/ModFolderPage.cpp +++ b/launcher/ui/pages/instance/ModFolderPage.cpp @@ -88,6 +88,11 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr ui->actionsToolbar->insertActionAfter(ui->actionAddItem, ui->actionUpdateItem); connect(ui->actionUpdateItem, &QAction::triggered, this, &ModFolderPage::updateMods); + ui->actionUpdateDepsItem->setToolTip( + tr("Try to update and check for missing dependencies all selected mods (all mods if none are selected)")); + ui->actionsToolbar->insertActionAfter(ui->actionUpdateItem, ui->actionUpdateDepsItem); + connect(ui->actionUpdateDepsItem, &QAction::triggered, this, [this] { updateMods(true); }); + ui->actionVisitItemPage->setToolTip(tr("Go to mod's home page")); ui->actionsToolbar->addAction(ui->actionVisitItemPage); connect(ui->actionVisitItemPage, &QAction::triggered, this, &ModFolderPage::visitModPages); @@ -100,6 +105,7 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr connect(ui->treeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, [this, check_allow_update] { ui->actionUpdateItem->setEnabled(check_allow_update()); + ui->actionUpdateDepsItem->setEnabled(check_allow_update()); auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection()).indexes(); auto mods_list = m_model->selectedMods(selection); @@ -120,14 +126,15 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr ui->actionRemoveItemMetadata->setEnabled(selected != 0); }); - connect(mods.get(), &ModFolderModel::rowsInserted, this, - [this, check_allow_update] { ui->actionUpdateItem->setEnabled(check_allow_update()); }); + auto updateButtons = [this, check_allow_update] { + ui->actionUpdateItem->setEnabled(check_allow_update()); + ui->actionUpdateDepsItem->setEnabled(check_allow_update()); + }; + connect(mods.get(), &ModFolderModel::rowsInserted, this, updateButtons); - connect(mods.get(), &ModFolderModel::rowsRemoved, this, - [this, check_allow_update] { ui->actionUpdateItem->setEnabled(check_allow_update()); }); + connect(mods.get(), &ModFolderModel::rowsRemoved, this, updateButtons); - connect(mods.get(), &ModFolderModel::updateFinished, this, - [this, check_allow_update] { ui->actionUpdateItem->setEnabled(check_allow_update()); }); + connect(mods.get(), &ModFolderModel::updateFinished, this, updateButtons); } } @@ -204,7 +211,7 @@ void ModFolderPage::installMods() } } -void ModFolderPage::updateMods() +void ModFolderPage::updateMods(bool includeDeps) { if (m_instance->typeName() != "Minecraft") return; // this is a null instance or a legacy instance @@ -221,7 +228,7 @@ void ModFolderPage::updateMods() if (use_all) mods_list = m_model->allMods(); - ModUpdateDialog update_dialog(this, m_instance, m_model, mods_list); + ModUpdateDialog update_dialog(this, m_instance, m_model, mods_list, includeDeps); update_dialog.checkCandidates(); if (update_dialog.aborted()) { diff --git a/launcher/ui/pages/instance/ModFolderPage.h b/launcher/ui/pages/instance/ModFolderPage.h index 0c654d0d1..4672350c6 100644 --- a/launcher/ui/pages/instance/ModFolderPage.h +++ b/launcher/ui/pages/instance/ModFolderPage.h @@ -64,7 +64,7 @@ class ModFolderPage : public ExternalResourcesPage { void deleteModMetadata(); void installMods(); - void updateMods(); + void updateMods(bool includeDeps = false); void visitModPages(); protected: From 364cb4ff6afccb2d9696a5a2363df0623beee0da Mon Sep 17 00:00:00 2001 From: IThundxr Date: Sat, 28 Oct 2023 07:39:32 -0400 Subject: [PATCH 08/56] chore: remove windows 7/8 support With 8.0 windows legacy support was dropped, this just removes it from the manifest Signed-off-by: IThundxr --- program_info/prismlauncher.manifest.in | 6 ------ 1 file changed, 6 deletions(-) diff --git a/program_info/prismlauncher.manifest.in b/program_info/prismlauncher.manifest.in index 6f4467c7d..fb28afc17 100644 --- a/program_info/prismlauncher.manifest.in +++ b/program_info/prismlauncher.manifest.in @@ -16,12 +16,6 @@ Custom Minecraft launcher for managing multiple installs. - - - - - - From 54305397e45ec9f2c14b84eb782b541633b9dc3d Mon Sep 17 00:00:00 2001 From: LocalSpook <56512186+LocalSpook@users.noreply.github.com> Date: Sat, 28 Oct 2023 12:50:40 -0700 Subject: [PATCH 09/56] Localize sorting options for resource and shader packs Signed-off-by: LocalSpook <56512186+LocalSpook@users.noreply.github.com> --- launcher/modplatform/flame/FlameAPI.cpp | 20 +++++++++---------- launcher/modplatform/modrinth/ModrinthAPI.cpp | 14 ++++++------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/launcher/modplatform/flame/FlameAPI.cpp b/launcher/modplatform/flame/FlameAPI.cpp index e99ce3a56..bb4f18983 100644 --- a/launcher/modplatform/flame/FlameAPI.cpp +++ b/launcher/modplatform/flame/FlameAPI.cpp @@ -208,17 +208,15 @@ Task::Ptr FlameAPI::getFile(const QString& addonId, const QString& fileId, std:: return netJob; } -// https://docs.curseforge.com/?python#tocS_ModsSearchSortField -static QList s_sorts = { { 1, "Featured", QObject::tr("Sort by Featured") }, - { 2, "Popularity", QObject::tr("Sort by Popularity") }, - { 3, "LastUpdated", QObject::tr("Sort by Last Updated") }, - { 4, "Name", QObject::tr("Sort by Name") }, - { 5, "Author", QObject::tr("Sort by Author") }, - { 6, "TotalDownloads", QObject::tr("Sort by Downloads") }, - { 7, "Category", QObject::tr("Sort by Category") }, - { 8, "GameVersion", QObject::tr("Sort by Game Version") } }; - QList FlameAPI::getSortingMethods() const { - return s_sorts; + // https://docs.curseforge.com/?python#tocS_ModsSearchSortField + return { { 1, "Featured", QObject::tr("Sort by Featured") }, + { 2, "Popularity", QObject::tr("Sort by Popularity") }, + { 3, "LastUpdated", QObject::tr("Sort by Last Updated") }, + { 4, "Name", QObject::tr("Sort by Name") }, + { 5, "Author", QObject::tr("Sort by Author") }, + { 6, "TotalDownloads", QObject::tr("Sort by Downloads") }, + { 7, "Category", QObject::tr("Sort by Category") }, + { 8, "GameVersion", QObject::tr("Sort by Game Version") } }; } diff --git a/launcher/modplatform/modrinth/ModrinthAPI.cpp b/launcher/modplatform/modrinth/ModrinthAPI.cpp index f453f5cb9..8be963ecf 100644 --- a/launcher/modplatform/modrinth/ModrinthAPI.cpp +++ b/launcher/modplatform/modrinth/ModrinthAPI.cpp @@ -111,14 +111,12 @@ Task::Ptr ModrinthAPI::getProjects(QStringList addonIds, std::shared_ptr s_sorts = { { 1, "relevance", QObject::tr("Sort by Relevance") }, - { 2, "downloads", QObject::tr("Sort by Downloads") }, - { 3, "follows", QObject::tr("Sort by Follows") }, - { 4, "newest", QObject::tr("Sort by Last Updated") }, - { 5, "updated", QObject::tr("Sort by Newest") } }; - QList ModrinthAPI::getSortingMethods() const { - return s_sorts; + // https://docs.modrinth.com/api-spec/#tag/projects/operation/searchProjects + return { { 1, "relevance", QObject::tr("Sort by Relevance") }, + { 2, "downloads", QObject::tr("Sort by Downloads") }, + { 3, "follows", QObject::tr("Sort by Follows") }, + { 4, "newest", QObject::tr("Sort by Last Updated") }, + { 5, "updated", QObject::tr("Sort by Newest") } }; } From 55ac17c45b40f678f831b189a6d25a1f5344f73e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 29 Oct 2023 00:18:11 +0000 Subject: [PATCH 10/56] chore(nix): update lockfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:nixos/nixpkgs/44881e03af1c730cbb1d72a4d41274a2c957813a' (2023-10-21) → 'github:nixos/nixpkgs/808c0d8c53c7ae50f82aca8e7df263225cf235bf' (2023-10-26) • Updated input 'pre-commit-hooks': 'github:cachix/pre-commit-hooks.nix/8cc349bfd082da8782b989cad2158c9ad5bd70fd' (2023-10-19) → 'github:cachix/pre-commit-hooks.nix/bd38df3d508dfcdff52cd243d297f218ed2257bf' (2023-10-25) --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index d71403358..7cf901f77 100644 --- a/flake.lock +++ b/flake.lock @@ -106,11 +106,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1697886341, - "narHash": "sha256-AdE67xPty9M9wn36nPVp6aDntIdigrs7UbyaGv1VAaM=", + "lastModified": 1698336494, + "narHash": "sha256-sO72WDBKyijYD1GcKPlGsycKbMBiTJMBCnmOxLAs880=", "owner": "nixos", "repo": "nixpkgs", - "rev": "44881e03af1c730cbb1d72a4d41274a2c957813a", + "rev": "808c0d8c53c7ae50f82aca8e7df263225cf235bf", "type": "github" }, "original": { @@ -153,11 +153,11 @@ ] }, "locked": { - "lastModified": 1697746376, - "narHash": "sha256-gu77VkgdfaHgNCVufeb6WP9oqFLjwK4jHcoPZmBVF3E=", + "lastModified": 1698227354, + "narHash": "sha256-Fi5H9jbaQLmLw9qBi/mkR33CoFjNbobo5xWdX4tKz1Q=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "8cc349bfd082da8782b989cad2158c9ad5bd70fd", + "rev": "bd38df3d508dfcdff52cd243d297f218ed2257bf", "type": "github" }, "original": { From 5a54d80c6ee2ec05bcca0044d3936d5fa0e8d13d Mon Sep 17 00:00:00 2001 From: TheKodeToad Date: Mon, 30 Oct 2023 09:26:38 +0000 Subject: [PATCH 11/56] Fix group issues Signed-off-by: TheKodeToad --- launcher/InstanceList.cpp | 11 ++++++----- launcher/InstanceList.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/launcher/InstanceList.cpp b/launcher/InstanceList.cpp index 756ff93dd..111f8d8a4 100644 --- a/launcher/InstanceList.cpp +++ b/launcher/InstanceList.cpp @@ -290,8 +290,7 @@ void InstanceList::deleteGroup(const GroupId& name) qDebug() << "Remove" << instID << "from group" << name; removed = true; auto idx = getInstIndex(instance.get()); - if (idx > 0) - emit dataChanged(index(idx), index(idx), { GroupRole }); + emit dataChanged(index(idx), index(idx), { GroupRole }); } } if (removed) @@ -315,8 +314,7 @@ void InstanceList::renameGroup(const QString& src, const QString& dst) qDebug() << "Set" << instID << "group to" << dst; modified = true; auto idx = getInstIndex(instance.get()); - if (idx > 0) - emit dataChanged(index(idx), index(idx), { GroupRole }); + emit dataChanged(index(idx), index(idx), { GroupRole }); } } if (modified) @@ -947,9 +945,12 @@ QString InstanceList::getStagedInstancePath() bool InstanceList::commitStagedInstance(const QString& path, InstanceName const& instanceName, - const QString& groupName, + QString groupName, InstanceTask const& commiting) { + if (groupName.isEmpty() && !groupName.isNull()) + groupName = QString(); + QDir dir; QString instID; InstancePtr inst; diff --git a/launcher/InstanceList.h b/launcher/InstanceList.h index 6b0bcd810..5ddddee95 100644 --- a/launcher/InstanceList.h +++ b/launcher/InstanceList.h @@ -130,7 +130,7 @@ class InstanceList : public QAbstractListModel { * should_override is used when another similar instance already exists, and we want to override it * - for instance, when updating it. */ - bool commitStagedInstance(const QString& keyPath, const InstanceName& instanceName, const QString& groupName, const InstanceTask&); + bool commitStagedInstance(const QString& keyPath, const InstanceName& instanceName, QString groupName, const InstanceTask&); /** * Destroy a previously created staging area given by @keyPath - used when creation fails. From 2526275c5e124996b7a6b0465bad8b2bc9a1dffe Mon Sep 17 00:00:00 2001 From: TheKodeToad Date: Mon, 30 Oct 2023 09:51:37 +0000 Subject: [PATCH 12/56] Better check Signed-off-by: TheKodeToad --- launcher/InstanceList.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/launcher/InstanceList.cpp b/launcher/InstanceList.cpp index 111f8d8a4..2b8f34293 100644 --- a/launcher/InstanceList.cpp +++ b/launcher/InstanceList.cpp @@ -290,7 +290,8 @@ void InstanceList::deleteGroup(const GroupId& name) qDebug() << "Remove" << instID << "from group" << name; removed = true; auto idx = getInstIndex(instance.get()); - emit dataChanged(index(idx), index(idx), { GroupRole }); + if (idx >= 0) + emit dataChanged(index(idx), index(idx), { GroupRole }); } } if (removed) @@ -314,7 +315,8 @@ void InstanceList::renameGroup(const QString& src, const QString& dst) qDebug() << "Set" << instID << "group to" << dst; modified = true; auto idx = getInstIndex(instance.get()); - emit dataChanged(index(idx), index(idx), { GroupRole }); + if (idx >= 0) + emit dataChanged(index(idx), index(idx), { GroupRole }); } } if (modified) From 2349f29be01e1f6777f60a0397eab69650454c0d Mon Sep 17 00:00:00 2001 From: Trial97 Date: Thu, 2 Nov 2023 01:19:18 +0200 Subject: [PATCH 13/56] jsut a overflow protection Signed-off-by: Trial97 --- launcher/MTPixmapCache.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/launcher/MTPixmapCache.h b/launcher/MTPixmapCache.h index 1a3e52160..a14882097 100644 --- a/launcher/MTPixmapCache.h +++ b/launcher/MTPixmapCache.h @@ -113,7 +113,13 @@ class PixmapCache final : public QObject { if (m_consecutive_fast_evicitons >= m_consecutive_fast_evicitons_threshold) { // double the cache size auto newSize = _cacheLimit() * 2; - qDebug() << m_consecutive_fast_evicitons << "pixmap cache misses by eviction happened too fast, doubling cache size to" + if (newSize <= 0) { // double it until you overflow :D + qDebug() << m_consecutive_fast_evicitons + << tr("pixmap cache misses by eviction happened too fast, doing nothing as the cache size reached it's limit"); + m_consecutive_fast_evicitons = 0; + return true; + } + qDebug() << m_consecutive_fast_evicitons << tr("pixmap cache misses by eviction happened too fast, doubling cache size to") << newSize; _setCacheLimit(newSize); m_consecutive_fast_evicitons = 0; From 220a1de99a564602b9d043732b83b5d7c5545c25 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Thu, 2 Nov 2023 22:41:56 +0200 Subject: [PATCH 14/56] made sure that we do not relay for undefined behavior Signed-off-by: Trial97 --- launcher/MTPixmapCache.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/launcher/MTPixmapCache.h b/launcher/MTPixmapCache.h index a14882097..5f8212d74 100644 --- a/launcher/MTPixmapCache.h +++ b/launcher/MTPixmapCache.h @@ -5,6 +5,7 @@ #include #include #include +#include #define GET_TYPE() \ Qt::ConnectionType type; \ @@ -112,16 +113,16 @@ class PixmapCache final : public QObject { m_last_cache_miss_by_eviciton = now; if (m_consecutive_fast_evicitons >= m_consecutive_fast_evicitons_threshold) { // double the cache size - auto newSize = _cacheLimit() * 2; - if (newSize <= 0) { // double it until you overflow :D + auto newSize = _cacheLimit() * 2.L; + if (newSize >= std::numeric_limits::max()) { // double it until you overflow :D + newSize = std::numeric_limits::max(); qDebug() << m_consecutive_fast_evicitons << tr("pixmap cache misses by eviction happened too fast, doing nothing as the cache size reached it's limit"); - m_consecutive_fast_evicitons = 0; - return true; + } else { + qDebug() << m_consecutive_fast_evicitons << tr("pixmap cache misses by eviction happened too fast, doubling cache size to") + << static_cast(newSize); } - qDebug() << m_consecutive_fast_evicitons << tr("pixmap cache misses by eviction happened too fast, doubling cache size to") - << newSize; - _setCacheLimit(newSize); + _setCacheLimit(static_cast(newSize)); m_consecutive_fast_evicitons = 0; return true; } From 127a31ba3a468f8ad9fcedc29befea78ad381657 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Fri, 3 Nov 2023 10:31:40 +0200 Subject: [PATCH 15/56] Added warning for remove account Signed-off-by: Trial97 --- launcher/ui/pages/global/AccountListPage.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp index 50f3ff2b6..6fd6112d4 100644 --- a/launcher/ui/pages/global/AccountListPage.cpp +++ b/launcher/ui/pages/global/AccountListPage.cpp @@ -42,22 +42,17 @@ #include -#include "net/NetJob.h" - #include "ui/dialogs/CustomMessageBox.h" #include "ui/dialogs/MSALoginDialog.h" #include "ui/dialogs/OfflineLoginDialog.h" #include "ui/dialogs/ProgressDialog.h" #include "ui/dialogs/SkinUploadDialog.h" -#include "minecraft/auth/AccountTask.h" #include "minecraft/services/SkinDelete.h" #include "tasks/Task.h" #include "Application.h" -#include "BuildConfig.h" - AccountListPage::AccountListPage(QWidget* parent) : QMainWindow(parent), ui(new Ui::AccountListPage) { ui->setupUi(this); @@ -172,6 +167,12 @@ void AccountListPage::on_actionAddOffline_triggered() void AccountListPage::on_actionRemove_triggered() { + auto response = CustomMessageBox::selectable(this, tr("Remove account?"), tr("Do you realy want to delete this account?"), + QMessageBox::Question, QMessageBox::Yes | QMessageBox::No, QMessageBox::No) + ->exec(); + if (response != QMessageBox::Yes) { + return; + } QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); if (selection.size() > 0) { QModelIndex selected = selection.first(); From b18082376ddc90eab4176ff88a10683d3b38ecff Mon Sep 17 00:00:00 2001 From: Trial97 Date: Fri, 3 Nov 2023 11:04:13 +0200 Subject: [PATCH 16/56] Fixed visual bug with Modlist export Signed-off-by: Trial97 --- launcher/ui/dialogs/ExportToModListDialog.cpp | 7 +++--- launcher/ui/dialogs/ExportToModListDialog.ui | 23 +++++++++++++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/launcher/ui/dialogs/ExportToModListDialog.cpp b/launcher/ui/dialogs/ExportToModListDialog.cpp index c811bfe6a..a343f555a 100644 --- a/launcher/ui/dialogs/ExportToModListDialog.cpp +++ b/launcher/ui/dialogs/ExportToModListDialog.cpp @@ -214,10 +214,11 @@ void ExportToModListDialog::addExtra(ExportToModList::OptionalData option) void ExportToModListDialog::enableCustom(bool enabled) { ui->authorsCheckBox->setHidden(enabled); - ui->versionCheckBox->setHidden(enabled); - ui->urlCheckBox->setHidden(enabled); - ui->authorsButton->setHidden(!enabled); + + ui->versionCheckBox->setHidden(enabled); ui->versionButton->setHidden(!enabled); + + ui->urlCheckBox->setHidden(enabled); ui->urlButton->setHidden(!enabled); } diff --git a/launcher/ui/dialogs/ExportToModListDialog.ui b/launcher/ui/dialogs/ExportToModListDialog.ui index 25eb43429..4f8ab52b5 100644 --- a/launcher/ui/dialogs/ExportToModListDialog.ui +++ b/launcher/ui/dialogs/ExportToModListDialog.ui @@ -7,7 +7,7 @@ 0 0 650 - 446 + 522 @@ -61,18 +61,37 @@ + + + 0 + 0 + + Template - + + + + 0 + 0 + + + + + + 0 + 0 + + Optional Info From 1bd69ecbb286df9d14a76d2dcb8a635d7895f154 Mon Sep 17 00:00:00 2001 From: Alexandru Ionut Tripon Date: Fri, 3 Nov 2023 11:42:40 +0200 Subject: [PATCH 17/56] Update launcher/ui/pages/global/AccountListPage.cpp Co-authored-by: TheKodeToad Signed-off-by: Alexandru Ionut Tripon --- launcher/ui/pages/global/AccountListPage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp index 6fd6112d4..3a21cdd9b 100644 --- a/launcher/ui/pages/global/AccountListPage.cpp +++ b/launcher/ui/pages/global/AccountListPage.cpp @@ -167,7 +167,7 @@ void AccountListPage::on_actionAddOffline_triggered() void AccountListPage::on_actionRemove_triggered() { - auto response = CustomMessageBox::selectable(this, tr("Remove account?"), tr("Do you realy want to delete this account?"), + auto response = CustomMessageBox::selectable(this, tr("Remove account?"), tr("Do you really want to delete this account?"), QMessageBox::Question, QMessageBox::Yes | QMessageBox::No, QMessageBox::No) ->exec(); if (response != QMessageBox::Yes) { From 0f95bf1e424e3ebd7f1450461d554f54c71c5f33 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Sat, 4 Nov 2023 12:08:49 +0200 Subject: [PATCH 18/56] Updated readme Signed-off-by: Trial97 --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 61bf4c20b..e3457c7ed 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,18 @@ - All downloads and instructions for Prism Launcher can be found on our [Website](https://prismlauncher.org/download). -- Last build status can be found in the [GitHub Actions](https://github.com/PrismLauncher/PrismLauncher/actions). +- Last build status can be found in the [GitHub Actions](https://github.com/PrismLauncher/PrismLauncher/actions) (this also includes the pull requests status). ### Development Builds -There are development builds available [here](https://github.com/PrismLauncher/PrismLauncher/actions). These have debug information in the binaries, so their file sizes are relatively larger. +Please understand that these builds are not intended for most users. There may be bugs, and other instabilities. You have been warned. + +There are development builds available on: + +- [GitHub Actions](https://github.com/PrismLauncher/PrismLauncher/actions) includes builds from pull requests opened by contribuitors. +- [nightly.link](https://nightly.link/PrismLauncher/PrismLauncher/workflows/trigger_builds/develop) this will allways point only to the latest develop. + +These have debug information in the binaries, so their file sizes are relatively larger. Prebuilt Development builds are provided for **Linux**, **Windows** and **macOS**. From 40ebae394afe7ba426a67615e7a658f07ea76297 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 5 Nov 2023 00:18:56 +0000 Subject: [PATCH 19/56] chore(nix): update lockfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4' (2023-10-03) → 'github:hercules-ci/flake-parts/8c9fa2545007b49a5db5f650ae91f227672c3877' (2023-11-01) • Updated input 'flake-parts/nixpkgs-lib': 'github:NixOS/nixpkgs/f5892ddac112a1e9b3612c39af1b72987ee5783a?dir=lib' (2023-09-29) → 'github:NixOS/nixpkgs/0cbe9f69c234a7700596e943bfae7ef27a31b735?dir=lib' (2023-10-29) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/808c0d8c53c7ae50f82aca8e7df263225cf235bf' (2023-10-26) → 'github:nixos/nixpkgs/9d5d25bbfe8c0297ebe85324addcb5020ed1a454' (2023-11-04) • Updated input 'pre-commit-hooks': 'github:cachix/pre-commit-hooks.nix/bd38df3d508dfcdff52cd243d297f218ed2257bf' (2023-10-25) → 'github:cachix/pre-commit-hooks.nix/dec10399e5b56aa95fcd530e0338be72ad6462a0' (2023-11-01) --- flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 7cf901f77..a520c27e5 100644 --- a/flake.lock +++ b/flake.lock @@ -21,11 +21,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1696343447, - "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", + "lastModified": 1698882062, + "narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", + "rev": "8c9fa2545007b49a5db5f650ae91f227672c3877", "type": "github" }, "original": { @@ -106,11 +106,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1698336494, - "narHash": "sha256-sO72WDBKyijYD1GcKPlGsycKbMBiTJMBCnmOxLAs880=", + "lastModified": 1699094435, + "narHash": "sha256-YLZ5/KKZ1PyLrm2MO8UxRe4H3M0/oaYqNhSlq6FDeeA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "808c0d8c53c7ae50f82aca8e7df263225cf235bf", + "rev": "9d5d25bbfe8c0297ebe85324addcb5020ed1a454", "type": "github" }, "original": { @@ -123,11 +123,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1696019113, - "narHash": "sha256-X3+DKYWJm93DRSdC5M6K5hLqzSya9BjibtBsuARoPco=", + "lastModified": 1698611440, + "narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f5892ddac112a1e9b3612c39af1b72987ee5783a", + "rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735", "type": "github" }, "original": { @@ -153,11 +153,11 @@ ] }, "locked": { - "lastModified": 1698227354, - "narHash": "sha256-Fi5H9jbaQLmLw9qBi/mkR33CoFjNbobo5xWdX4tKz1Q=", + "lastModified": 1698852633, + "narHash": "sha256-Hsc/cCHud8ZXLvmm8pxrXpuaPEeNaaUttaCvtdX/Wug=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "bd38df3d508dfcdff52cd243d297f218ed2257bf", + "rev": "dec10399e5b56aa95fcd530e0338be72ad6462a0", "type": "github" }, "original": { From cf4144cb5022db62c97d35b9917ade9947110d16 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 4 Nov 2023 15:22:43 -0400 Subject: [PATCH 20/56] Fixed link to Fulmine's website Signed-off-by: Alex --- launcher/ui/dialogs/AboutDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/ui/dialogs/AboutDialog.cpp b/launcher/ui/dialogs/AboutDialog.cpp index f5eaff7a1..cee01e821 100644 --- a/launcher/ui/dialogs/AboutDialog.cpp +++ b/launcher/ui/dialogs/AboutDialog.cpp @@ -101,7 +101,7 @@ QString getCreditsHtml() stream << "

" << QObject::tr("With thanks to", "About Credits") << "

\n"; stream << QString("

Boba %1

\n").arg(getWebsite("https://bobaonline.neocities.org/")); stream << QString("

Davi Rafael %1

\n").arg(getWebsite("https://auti.one/")); - stream << QString("

Fulmine %1

\n").arg(getWebsite("https://www.fulmine.xyz/")); + stream << QString("

Fulmine %1

\n").arg(getWebsite("https://fulmine.xyz/")); stream << QString("

ely %1

\n").arg(getGitHub("elyrodso")); stream << QString("

gon sawa %1

\n").arg(getGitHub("gonsawa")); stream << QString("

Pankakes

\n"); From 64bbcb2834a7974d2c329180add799a728a856f9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 5 Nov 2023 15:57:06 +0000 Subject: [PATCH 21/56] chore(deps): update korthout/backport-action action to v2.1.0 --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index f9cf4fb7d..6f2025551 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -24,7 +24,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - name: Create backport PRs - uses: korthout/backport-action@v2.0.0 + uses: korthout/backport-action@v2.1.0 with: # Config README: https://github.com/korthout/backport-action#backport-action pull_description: |- From d2a85cb580f47ab181d65d13d18de2a96e297471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgars=20C=C4=ABrulis?= Date: Sun, 5 Nov 2023 17:41:53 +0000 Subject: [PATCH 22/56] visual: Fix spacing. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Edgars Cīrulis --- launcher/LaunchController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/LaunchController.cpp b/launcher/LaunchController.cpp index 9fb385777..f59cdeda8 100644 --- a/launcher/LaunchController.cpp +++ b/launcher/LaunchController.cpp @@ -89,7 +89,7 @@ void LaunchController::decideAccount() // Tell the user they need to log in at least one account in order to play. auto reply = CustomMessageBox::selectable(m_parentWidget, tr("No Accounts"), tr("In order to play Minecraft, you must have at least one Microsoft " - "account which owns Minecraft logged in." + "account which owns Minecraft logged in. " "Would you like to open the account manager to add an account now?"), QMessageBox::Information, QMessageBox::Yes | QMessageBox::No) ->exec(); From 710a48fcafdfd70c13077ea26a57dfb1aa375079 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Sun, 5 Nov 2023 21:41:10 +0200 Subject: [PATCH 23/56] changed type form double long to long long Signed-off-by: Trial97 --- launcher/MTPixmapCache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/MTPixmapCache.h b/launcher/MTPixmapCache.h index 5f8212d74..a1447fd5a 100644 --- a/launcher/MTPixmapCache.h +++ b/launcher/MTPixmapCache.h @@ -113,7 +113,7 @@ class PixmapCache final : public QObject { m_last_cache_miss_by_eviciton = now; if (m_consecutive_fast_evicitons >= m_consecutive_fast_evicitons_threshold) { // double the cache size - auto newSize = _cacheLimit() * 2.L; + auto newSize = _cacheLimit() * 2ll; if (newSize >= std::numeric_limits::max()) { // double it until you overflow :D newSize = std::numeric_limits::max(); qDebug() << m_consecutive_fast_evicitons From 9a8667e99cdfd9608f8aa543b432bacc672a45e4 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Sun, 5 Nov 2023 22:22:49 +0200 Subject: [PATCH 24/56] Added Global Dependenicies toggle Signed-off-by: Trial97 --- launcher/Application.cpp | 1 + launcher/ui/dialogs/ModUpdateDialog.cpp | 2 +- launcher/ui/dialogs/ResourceDownloadDialog.cpp | 14 ++++++++------ launcher/ui/pages/global/LauncherPage.cpp | 2 ++ launcher/ui/pages/global/LauncherPage.ui | 10 ++++++++++ launcher/ui/pages/instance/ModFolderPage.cpp | 4 ++++ 6 files changed, 26 insertions(+), 7 deletions(-) diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 661c6c5be..be252f1c5 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -644,6 +644,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv) // Minecraft mods m_settings->registerSetting("ModMetadataDisabled", false); + m_settings->registerSetting("ModDependenciesDisabled", false); // Minecraft offline player name m_settings->registerSetting("LastOfflinePlayerName", ""); diff --git a/launcher/ui/dialogs/ModUpdateDialog.cpp b/launcher/ui/dialogs/ModUpdateDialog.cpp index 1a70ea59a..298bdad97 100644 --- a/launcher/ui/dialogs/ModUpdateDialog.cpp +++ b/launcher/ui/dialogs/ModUpdateDialog.cpp @@ -186,7 +186,7 @@ void ModUpdateDialog::checkCandidates() } } - { // dependencies + if (!APPLICATION->settings()->get("ModDependenciesDisabled").toBool()) { // dependencies auto depTask = makeShared(this, m_instance, m_mod_model.get(), selectedVers); connect(depTask.get(), &Task::failed, this, diff --git a/launcher/ui/dialogs/ResourceDownloadDialog.cpp b/launcher/ui/dialogs/ResourceDownloadDialog.cpp index dc7cfff06..1431ea92c 100644 --- a/launcher/ui/dialogs/ResourceDownloadDialog.cpp +++ b/launcher/ui/dialogs/ResourceDownloadDialog.cpp @@ -270,13 +270,15 @@ QList ModDownloadDialog::getPages() GetModDependenciesTask::Ptr ModDownloadDialog::getModDependenciesTask() { - if (auto model = dynamic_cast(getBaseModel().get()); model) { - QList> selectedVers; - for (auto& selected : getTasks()) { - selectedVers.append(std::make_shared(selected->getPack(), selected->getVersion())); - } + if (!APPLICATION->settings()->get("ModDependenciesDisabled").toBool()) { // dependencies + if (auto model = dynamic_cast(getBaseModel().get()); model) { + QList> selectedVers; + for (auto& selected : getTasks()) { + selectedVers.append(std::make_shared(selected->getPack(), selected->getVersion())); + } - return makeShared(this, m_instance, model, selectedVers); + return makeShared(this, m_instance, model, selectedVers); + } } return nullptr; } diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp index 6d8c65ec5..d15883db5 100644 --- a/launcher/ui/pages/global/LauncherPage.cpp +++ b/launcher/ui/pages/global/LauncherPage.cpp @@ -223,6 +223,7 @@ void LauncherPage::applySettings() // Mods s->set("ModMetadataDisabled", ui->metadataDisableBtn->isChecked()); + s->set("ModDependenciesDisabled", ui->dependenciesDisableBtn->isChecked()); } void LauncherPage::loadSettings() { @@ -278,6 +279,7 @@ void LauncherPage::loadSettings() // Mods ui->metadataDisableBtn->setChecked(s->get("ModMetadataDisabled").toBool()); ui->metadataWarningLabel->setHidden(!ui->metadataDisableBtn->isChecked()); + ui->dependenciesDisableBtn->setChecked(s->get("ModDependenciesDisabled").toBool()); } void LauncherPage::refreshFontPreview() diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui index 250a8bc88..637b2cd81 100644 --- a/launcher/ui/pages/global/LauncherPage.ui +++ b/launcher/ui/pages/global/LauncherPage.ui @@ -186,6 +186,16 @@
+ + + + Disable mod dependencies checking. + + + Disable mod dependencies checking + + + diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp index 625d37933..8d99256b9 100644 --- a/launcher/ui/pages/instance/ModFolderPage.cpp +++ b/launcher/ui/pages/instance/ModFolderPage.cpp @@ -214,6 +214,10 @@ void ModFolderPage::updateMods() QMessageBox::critical(this, tr("Error"), tr("Please install a mod loader first!")); return; } + if (APPLICATION->settings()->get("ModMetadataDisabled").toBool()) { + QMessageBox::critical(this, tr("Error"), tr("The mod update is disabled when the metadata is disabled!")); + return; + } auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection()).indexes(); auto mods_list = m_model->selectedMods(selection); From bd9d5e09907071d2a2576add9c99314e6c52ed20 Mon Sep 17 00:00:00 2001 From: TheKodeToad Date: Sun, 5 Nov 2023 20:31:48 +0000 Subject: [PATCH 25/56] Reword Signed-off-by: TheKodeToad --- launcher/ui/pages/global/LauncherPage.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui index 637b2cd81..32d89ee51 100644 --- a/launcher/ui/pages/global/LauncherPage.ui +++ b/launcher/ui/pages/global/LauncherPage.ui @@ -189,10 +189,10 @@ - Disable mod dependencies checking. + Disable automatically checking and installation of mod dependencies. - Disable mod dependencies checking + Do not install mod dependencies From 902e861fc68b658d999476f273f4a15fe4207672 Mon Sep 17 00:00:00 2001 From: Alexandru Ionut Tripon Date: Sun, 5 Nov 2023 23:41:26 +0200 Subject: [PATCH 26/56] Apply suggestions from code review Co-authored-by: seth Signed-off-by: Alexandru Ionut Tripon --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e3457c7ed..b32132d49 100644 --- a/README.md +++ b/README.md @@ -18,16 +18,16 @@ - All downloads and instructions for Prism Launcher can be found on our [Website](https://prismlauncher.org/download). -- Last build status can be found in the [GitHub Actions](https://github.com/PrismLauncher/PrismLauncher/actions) (this also includes the pull requests status). +- Last build status can be found in the [GitHub Actions](https://github.com/PrismLauncher/PrismLauncher/actions) tab (this also includes the pull requests status). ### Development Builds Please understand that these builds are not intended for most users. There may be bugs, and other instabilities. You have been warned. -There are development builds available on: +There are development builds available through: -- [GitHub Actions](https://github.com/PrismLauncher/PrismLauncher/actions) includes builds from pull requests opened by contribuitors. -- [nightly.link](https://nightly.link/PrismLauncher/PrismLauncher/workflows/trigger_builds/develop) this will allways point only to the latest develop. +- [GitHub Actions](https://github.com/PrismLauncher/PrismLauncher/actions) (includes builds from pull requests opened by contribuitors) +- [nightly.link](https://nightly.link/PrismLauncher/PrismLauncher/workflows/trigger_builds/develop) (this will always point only to the latest version of develop) These have debug information in the binaries, so their file sizes are relatively larger. From 3e7f9083cab97489aab958d3bbc649b24d58abb6 Mon Sep 17 00:00:00 2001 From: Alexandru Ionut Tripon Date: Sun, 5 Nov 2023 23:41:54 +0200 Subject: [PATCH 27/56] Update launcher/ui/pages/instance/ModFolderPage.cpp Co-authored-by: seth Signed-off-by: Alexandru Ionut Tripon --- launcher/ui/pages/instance/ModFolderPage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp index 8d99256b9..f45f8b4b3 100644 --- a/launcher/ui/pages/instance/ModFolderPage.cpp +++ b/launcher/ui/pages/instance/ModFolderPage.cpp @@ -215,7 +215,7 @@ void ModFolderPage::updateMods() return; } if (APPLICATION->settings()->get("ModMetadataDisabled").toBool()) { - QMessageBox::critical(this, tr("Error"), tr("The mod update is disabled when the metadata is disabled!")); + QMessageBox::critical(this, tr("Error"), tr("Mod updates are unavailable when metadata is disabled!")); return; } auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection()).indexes(); From 867e6223ce5601ea32e8fc471d5dc3e13e32e276 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Sun, 5 Nov 2023 23:48:26 +0200 Subject: [PATCH 28/56] Fixed mangoHub loading Signed-off-by: Trial97 --- launcher/minecraft/MinecraftInstance.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/launcher/minecraft/MinecraftInstance.cpp b/launcher/minecraft/MinecraftInstance.cpp index 170561f11..7cb4100ea 100644 --- a/launcher/minecraft/MinecraftInstance.cpp +++ b/launcher/minecraft/MinecraftInstance.cpp @@ -575,15 +575,20 @@ QProcessEnvironment MinecraftInstance::createLaunchEnvironment() #ifdef Q_OS_LINUX if (settings()->get("EnableMangoHud").toBool() && APPLICATION->capabilities() & Application::SupportsMangoHud) { - auto preloadList = env.value("LD_PRELOAD").split(QLatin1String(":")); - auto libPaths = env.value("LD_LIBRARY_PATH").split(QLatin1String(":")); + QStringList preloadList; + if (auto value = env.value("LD_PRELOAD"); !value.isEmpty()) + preloadList = value.split(QLatin1String(":")); + QStringList libPaths; + if (auto value = env.value("LD_LIBRARY_PATH"); !value.isEmpty()) + libPaths = value.split(QLatin1String(":")); auto mangoHudLibString = MangoHud::getLibraryString(); if (!mangoHudLibString.isEmpty()) { QFileInfo mangoHudLib(mangoHudLibString); // dlsym variant is only needed for OpenGL and not included in the vulkan layer - preloadList << "libMangoHud_dlsym.so" << mangoHudLib.fileName(); + preloadList << "libMangoHud_dlsym.so" + << "libMangoHud_opengl.so" << mangoHudLib.fileName(); libPaths << mangoHudLib.absolutePath(); } From cc291219f9c937ec69402f7b88b79d1f33927ba3 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Mon, 6 Nov 2023 10:51:34 +0200 Subject: [PATCH 29/56] apply suggested changes Signed-off-by: Trial97 --- launcher/MTPixmapCache.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/launcher/MTPixmapCache.h b/launcher/MTPixmapCache.h index a1447fd5a..da9500788 100644 --- a/launcher/MTPixmapCache.h +++ b/launcher/MTPixmapCache.h @@ -101,10 +101,14 @@ class PixmapCache final : public QObject { */ bool _markCacheMissByEviciton() { + static constexpr int maxInt = std::numeric_limits::max(); + static constexpr uint oneMB = 1000; + static constexpr int oneSecond = 1000; + auto now = QTime::currentTime(); if (!m_last_cache_miss_by_eviciton.isNull()) { auto diff = m_last_cache_miss_by_eviciton.msecsTo(now); - if (diff < 1000) { // less than a second ago + if (diff < oneSecond) { // less than a second ago ++m_consecutive_fast_evicitons; } else { m_consecutive_fast_evicitons = 0; @@ -112,10 +116,10 @@ class PixmapCache final : public QObject { } m_last_cache_miss_by_eviciton = now; if (m_consecutive_fast_evicitons >= m_consecutive_fast_evicitons_threshold) { - // double the cache size - auto newSize = _cacheLimit() * 2ll; - if (newSize >= std::numeric_limits::max()) { // double it until you overflow :D - newSize = std::numeric_limits::max(); + // increase the cache size + uint newSize = _cacheLimit() + oneMB; + if (newSize >= maxInt) { // increase it until you overflow :D + newSize = maxInt; qDebug() << m_consecutive_fast_evicitons << tr("pixmap cache misses by eviction happened too fast, doing nothing as the cache size reached it's limit"); } else { From 670e91cb6072d42f74e501cfaeadbb49a8f171b4 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Mon, 6 Nov 2023 11:08:18 +0200 Subject: [PATCH 30/56] Increased the step to around 10MB Signed-off-by: Trial97 --- launcher/MTPixmapCache.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launcher/MTPixmapCache.h b/launcher/MTPixmapCache.h index da9500788..eab6a70ec 100644 --- a/launcher/MTPixmapCache.h +++ b/launcher/MTPixmapCache.h @@ -102,7 +102,7 @@ class PixmapCache final : public QObject { bool _markCacheMissByEviciton() { static constexpr int maxInt = std::numeric_limits::max(); - static constexpr uint oneMB = 1000; + static constexpr uint step = 10240; static constexpr int oneSecond = 1000; auto now = QTime::currentTime(); @@ -117,7 +117,7 @@ class PixmapCache final : public QObject { m_last_cache_miss_by_eviciton = now; if (m_consecutive_fast_evicitons >= m_consecutive_fast_evicitons_threshold) { // increase the cache size - uint newSize = _cacheLimit() + oneMB; + uint newSize = _cacheLimit() + step; if (newSize >= maxInt) { // increase it until you overflow :D newSize = maxInt; qDebug() << m_consecutive_fast_evicitons From ca226d2ab5c3fb88d2e4a69ae94d2393960e9713 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Mon, 6 Nov 2023 11:24:19 +0200 Subject: [PATCH 31/56] Fixed comparation warning Signed-off-by: Trial97 --- launcher/MTPixmapCache.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/launcher/MTPixmapCache.h b/launcher/MTPixmapCache.h index eab6a70ec..b6bd13045 100644 --- a/launcher/MTPixmapCache.h +++ b/launcher/MTPixmapCache.h @@ -101,7 +101,7 @@ class PixmapCache final : public QObject { */ bool _markCacheMissByEviciton() { - static constexpr int maxInt = std::numeric_limits::max(); + static constexpr uint maxInt = static_cast(std::numeric_limits::max()); static constexpr uint step = 10240; static constexpr int oneSecond = 1000; @@ -123,8 +123,8 @@ class PixmapCache final : public QObject { qDebug() << m_consecutive_fast_evicitons << tr("pixmap cache misses by eviction happened too fast, doing nothing as the cache size reached it's limit"); } else { - qDebug() << m_consecutive_fast_evicitons << tr("pixmap cache misses by eviction happened too fast, doubling cache size to") - << static_cast(newSize); + qDebug() << m_consecutive_fast_evicitons + << tr("pixmap cache misses by eviction happened too fast, increasing cache size to") << static_cast(newSize); } _setCacheLimit(static_cast(newSize)); m_consecutive_fast_evicitons = 0; From 6506e93e4a74eb859fb41ff3fd90adbc11f5727f Mon Sep 17 00:00:00 2001 From: Trial97 Date: Tue, 7 Nov 2023 09:44:27 +0200 Subject: [PATCH 32/56] Removed some buttons Signed-off-by: Trial97 --- .../pages/instance/ExternalResourcesPage.ui | 33 ++----- launcher/ui/pages/instance/ModFolderPage.cpp | 91 ++++++++++++------- 2 files changed, 65 insertions(+), 59 deletions(-) diff --git a/launcher/ui/pages/instance/ExternalResourcesPage.ui b/launcher/ui/pages/instance/ExternalResourcesPage.ui index b9a8e4963..ff08e12d2 100644 --- a/launcher/ui/pages/instance/ExternalResourcesPage.ui +++ b/launcher/ui/pages/instance/ExternalResourcesPage.ui @@ -70,6 +70,9 @@ + + true + Actions @@ -146,28 +149,6 @@ Download a new resource
- - - false - - - Check for &Updates - - - Try to check or update all selected resources (all resources if none are selected) - - - - - false - - - &Verify Dependencies - - - Try to update and check for missing dependencies all selected resources (all resources if none are selected) - - false @@ -179,15 +160,15 @@ Go to mods home page - + - false + true - Remove metadata + Check for &Updates - Remove mod's metadata + Try to check or update all selected resources (all resources if none are selected) diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp index daf9b635f..efe8092bb 100644 --- a/launcher/ui/pages/instance/ModFolderPage.cpp +++ b/launcher/ui/pages/instance/ModFolderPage.cpp @@ -84,52 +84,77 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr connect(ui->actionDownloadItem, &QAction::triggered, this, &ModFolderPage::installMods); - ui->actionUpdateItem->setToolTip(tr("Try to check or update all selected mods (all mods if none are selected)")); - ui->actionsToolbar->insertActionAfter(ui->actionAddItem, ui->actionUpdateItem); - connect(ui->actionUpdateItem, &QAction::triggered, this, &ModFolderPage::updateMods); + auto updateMenu = ui->actionUpdateItem->menu(); + if (updateMenu) { + updateMenu->clear(); + } else { + updateMenu = new QMenu(this); + } - ui->actionUpdateDepsItem->setToolTip( - tr("Try to update and check for missing dependencies all selected mods (all mods if none are selected)")); - ui->actionsToolbar->insertActionAfter(ui->actionUpdateItem, ui->actionUpdateDepsItem); - connect(ui->actionUpdateDepsItem, &QAction::triggered, this, [this] { updateMods(true); }); + { + auto update = updateMenu->addAction(tr("Check for Updates")); + update->setToolTip(tr("Try to check or update all selected mods (all mods if none are selected)")); + connect(update, &QAction::triggered, this, &ModFolderPage::updateMods); + } + { + auto updateWithDeps = updateMenu->addAction(tr("Verify Dependencies")); + updateWithDeps->setToolTip( + tr("Try to update and check for missing dependencies all selected mods (all mods if none are selected)")); + connect(updateWithDeps, &QAction::triggered, this, [this] { updateMods(true); }); + } + ui->actionUpdateItem->setMenu(updateMenu); + + ui->actionUpdateItem->setToolTip(tr("Try to check or update all selected mods (all mods if none are selected)")); + connect(ui->actionUpdateItem, &QAction::triggered, this, &ModFolderPage::updateMods); + ui->actionsToolbar->insertActionBefore(ui->actionAddItem, ui->actionUpdateItem); ui->actionVisitItemPage->setToolTip(tr("Go to mod's home page")); ui->actionsToolbar->addAction(ui->actionVisitItemPage); connect(ui->actionVisitItemPage, &QAction::triggered, this, &ModFolderPage::visitModPages); - ui->actionRemoveItemMetadata->setToolTip(tr("Remove mod's metadata")); - ui->actionsToolbar->insertActionAfter(ui->actionRemoveItem, ui->actionRemoveItemMetadata); - connect(ui->actionRemoveItemMetadata, &QAction::triggered, this, &ModFolderPage::deleteModMetadata); + auto removeMenu = ui->actionRemoveItem->menu(); + if (removeMenu) { + removeMenu->clear(); + } else { + removeMenu = new QMenu(this); + } + { + auto remove = removeMenu->addAction("Remove"); + remove->setToolTip(tr("Remove selected item")); + connect(remove, &QAction::triggered, this, &ModFolderPage::removeItem); + } + auto actionRemoveItemMetadata = removeMenu->addAction(tr("Remove metadata")); + actionRemoveItemMetadata->setToolTip(tr("Remove mod's metadata")); + connect(actionRemoveItemMetadata, &QAction::triggered, this, &ModFolderPage::deleteModMetadata); + + ui->actionRemoveItem->setMenu(removeMenu); auto check_allow_update = [this] { return ui->treeView->selectionModel()->hasSelection() || !m_model->empty(); }; - connect(ui->treeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, [this, check_allow_update] { - ui->actionUpdateItem->setEnabled(check_allow_update()); - ui->actionUpdateDepsItem->setEnabled(check_allow_update()); + connect(ui->treeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, + [this, check_allow_update, actionRemoveItemMetadata] { + ui->actionUpdateItem->setEnabled(check_allow_update()); - auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection()).indexes(); - auto mods_list = m_model->selectedMods(selection); - auto selected = std::count_if(mods_list.cbegin(), mods_list.cend(), - [](Mod* v) { return v->metadata() != nullptr || v->homeurl().size() != 0; }); - if (selected <= 1) { - ui->actionVisitItemPage->setText(tr("Visit mod's page")); - ui->actionVisitItemPage->setToolTip(tr("Go to mod's home page")); + auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection()).indexes(); + auto mods_list = m_model->selectedMods(selection); + auto selected = std::count_if(mods_list.cbegin(), mods_list.cend(), + [](Mod* v) { return v->metadata() != nullptr || v->homeurl().size() != 0; }); + if (selected <= 1) { + ui->actionVisitItemPage->setText(tr("Visit mod's page")); + ui->actionVisitItemPage->setToolTip(tr("Go to mod's home page")); - ui->actionRemoveItemMetadata->setToolTip(tr("Remove mod's metadata")); - } else { - ui->actionVisitItemPage->setText(tr("Visit mods' pages")); - ui->actionVisitItemPage->setToolTip(tr("Go to the pages of the selected mods")); + actionRemoveItemMetadata->setToolTip(tr("Remove mod's metadata")); + } else { + ui->actionVisitItemPage->setText(tr("Visit mods' pages")); + ui->actionVisitItemPage->setToolTip(tr("Go to the pages of the selected mods")); - ui->actionRemoveItemMetadata->setToolTip(tr("Remove mods' metadata")); - } - ui->actionVisitItemPage->setEnabled(selected != 0); - ui->actionRemoveItemMetadata->setEnabled(selected != 0); - }); + actionRemoveItemMetadata->setToolTip(tr("Remove mods' metadata")); + } + ui->actionVisitItemPage->setEnabled(selected != 0); + actionRemoveItemMetadata->setEnabled(selected != 0); + }); - auto updateButtons = [this, check_allow_update] { - ui->actionUpdateItem->setEnabled(check_allow_update()); - ui->actionUpdateDepsItem->setEnabled(check_allow_update()); - }; + auto updateButtons = [this, check_allow_update] { ui->actionUpdateItem->setEnabled(check_allow_update()); }; connect(mods.get(), &ModFolderModel::rowsInserted, this, updateButtons); connect(mods.get(), &ModFolderModel::rowsRemoved, this, updateButtons); From 5d5adbd7da9bbead583ecec0904c5527508acd63 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Tue, 7 Nov 2023 09:48:07 +0200 Subject: [PATCH 33/56] add update menu conditionaly Signed-off-by: Trial97 --- launcher/ui/pages/instance/ModFolderPage.cpp | 36 +++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp index efe8092bb..a2fe19a87 100644 --- a/launcher/ui/pages/instance/ModFolderPage.cpp +++ b/launcher/ui/pages/instance/ModFolderPage.cpp @@ -84,25 +84,27 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr connect(ui->actionDownloadItem, &QAction::triggered, this, &ModFolderPage::installMods); - auto updateMenu = ui->actionUpdateItem->menu(); - if (updateMenu) { - updateMenu->clear(); - } else { - updateMenu = new QMenu(this); - } + if (!APPLICATION->settings()->get("ModDependenciesDisabled").toBool()) { // dependencies + auto updateMenu = ui->actionUpdateItem->menu(); + if (updateMenu) { + updateMenu->clear(); + } else { + updateMenu = new QMenu(this); + } - { - auto update = updateMenu->addAction(tr("Check for Updates")); - update->setToolTip(tr("Try to check or update all selected mods (all mods if none are selected)")); - connect(update, &QAction::triggered, this, &ModFolderPage::updateMods); + { + auto update = updateMenu->addAction(tr("Check for Updates")); + update->setToolTip(tr("Try to check or update all selected mods (all mods if none are selected)")); + connect(update, &QAction::triggered, this, &ModFolderPage::updateMods); + } + { + auto updateWithDeps = updateMenu->addAction(tr("Verify Dependencies")); + updateWithDeps->setToolTip( + tr("Try to update and check for missing dependencies all selected mods (all mods if none are selected)")); + connect(updateWithDeps, &QAction::triggered, this, [this] { updateMods(true); }); + } + ui->actionUpdateItem->setMenu(updateMenu); } - { - auto updateWithDeps = updateMenu->addAction(tr("Verify Dependencies")); - updateWithDeps->setToolTip( - tr("Try to update and check for missing dependencies all selected mods (all mods if none are selected)")); - connect(updateWithDeps, &QAction::triggered, this, [this] { updateMods(true); }); - } - ui->actionUpdateItem->setMenu(updateMenu); ui->actionUpdateItem->setToolTip(tr("Try to check or update all selected mods (all mods if none are selected)")); connect(ui->actionUpdateItem, &QAction::triggered, this, &ModFolderPage::updateMods); From c78d35d699bf204008da5eb73ed8c4efe510258d Mon Sep 17 00:00:00 2001 From: Trial97 Date: Tue, 7 Nov 2023 10:20:53 +0200 Subject: [PATCH 34/56] added additional minecraft java path for windows Signed-off-by: Trial97 --- launcher/java/JavaUtils.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/launcher/java/JavaUtils.cpp b/launcher/java/JavaUtils.cpp index 10bbb1f1b..615608ca3 100644 --- a/launcher/java/JavaUtils.cpp +++ b/launcher/java/JavaUtils.cpp @@ -34,6 +34,7 @@ */ #include +#include #include #include @@ -440,18 +441,26 @@ QStringList getMinecraftJavaBundle() { QString partialPath; QString executable = "java"; + QStringList processpaths; #if defined(Q_OS_OSX) partialPath = FS::PathCombine(QDir::homePath(), "Library/Application Support"); #elif defined(Q_OS_WIN32) partialPath = QProcessEnvironment::systemEnvironment().value("LOCALAPPDATA", ""); executable += "w.exe"; + + // add the following to the search + // C:\Users\USERNAME\AppData\Local\Packages\Microsoft.4297127D64EC6_8wekyb3d8bbwe\LocalCache\Local\runtime + auto minecraftInstaltionPath = + FS::PathCombine(QFileInfo(partialPath).absolutePath(), "Local", "Packages", "Microsoft.4297127D64EC6_8wekyb3d8bbwe"); + minecraftInstaltionPath = FS::PathCombine(minecraftInstaltionPath, "LocalCache", "Local", "runtime"); + processpaths << minecraftInstaltionPath; #else partialPath = QDir::homePath(); #endif - auto minecraftPath = FS::PathCombine(partialPath, ".minecraft", "runtime"); - QStringList javas; - QStringList processpaths{ minecraftPath }; + auto minecraftDataPath = FS::PathCombine(partialPath, ".minecraft", "runtime"); + processpaths << minecraftDataPath; + QStringList javas; while (!processpaths.isEmpty()) { auto dirPath = processpaths.takeFirst(); QDir dir(dirPath); From 8897f16d1dd2d0736d9d50a99f8395c1eb1f2ac0 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Tue, 7 Nov 2023 10:52:52 +0200 Subject: [PATCH 35/56] simplify microsoft login Signed-off-by: Trial97 --- launcher/ui/dialogs/MSALoginDialog.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/launcher/ui/dialogs/MSALoginDialog.cpp b/launcher/ui/dialogs/MSALoginDialog.cpp index 74fff9fd3..5dba84858 100644 --- a/launcher/ui/dialogs/MSALoginDialog.cpp +++ b/launcher/ui/dialogs/MSALoginDialog.cpp @@ -105,8 +105,17 @@ void MSALoginDialog::showVerificationUriAndCode(const QUrl& uri, const QString& QString urlString = uri.toString(); QString linkString = QString("%2").arg(urlString, urlString); - ui->label->setText( - tr("

Please open up %1 in a browser and put in the code %2 to proceed with login.

").arg(linkString, code)); + if (urlString == "https://www.microsoft.com/link" && !code.isEmpty()) { + urlString += QString("?otc=%1").arg(code); + DesktopServices::openUrl(urlString); + ui->label->setText( + tr("

Please login in the opened browser. If no browser was opened please follow the following instructions:

" + "

Please open up %1 in a browser and put in the code %2 to proceed with login.

") + .arg(linkString, code)); + } else { + ui->label->setText( + tr("

Please open up %1 in a browser and put in the code %2 to proceed with login.

").arg(linkString, code)); + } ui->actionButton->setVisible(true); connect(ui->actionButton, &QPushButton::clicked, [=]() { DesktopServices::openUrl(uri); From 9ada8d906d522ec92cee58dc016e3d51f33d963d Mon Sep 17 00:00:00 2001 From: Hazel Hofmann Date: Tue, 7 Nov 2023 14:54:04 +0100 Subject: [PATCH 36/56] Use same categories as main desktop entry --- launcher/FileSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp index 00a6ee539..bbd8d82e2 100644 --- a/launcher/FileSystem.cpp +++ b/launcher/FileSystem.cpp @@ -872,7 +872,7 @@ bool createShortcut(QString destination, QString target, QStringList args, QStri << "\n"; stream << "Type=Application" << "\n"; - stream << "Categories=Game" + stream << "Categories=Game;ActionGame;AdventureGame;Simulation;" << "\n"; stream << "Exec=\"" << target.toLocal8Bit() << "\"" << argstring.toLocal8Bit() << "\n"; stream << "Name=" << name.toLocal8Bit() << "\n"; From 1dea83580eb673e07d7864d56405008551a9bc26 Mon Sep 17 00:00:00 2001 From: Hazel Hofmann Date: Tue, 7 Nov 2023 15:05:56 +0100 Subject: [PATCH 37/56] DCO Remediation Commit for Hazel Hofmann I, Hazel Hofmann , hereby add my Signed-off-by to this commit: 9ada8d906d522ec92cee58dc016e3d51f33d963d Signed-off-by: Hazel Hofmann --- launcher/FileSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp index bbd8d82e2..469932374 100644 --- a/launcher/FileSystem.cpp +++ b/launcher/FileSystem.cpp @@ -872,7 +872,7 @@ bool createShortcut(QString destination, QString target, QStringList args, QStri << "\n"; stream << "Type=Application" << "\n"; - stream << "Categories=Game;ActionGame;AdventureGame;Simulation;" + stream << "Categories=Game;ActionGame;AdventureGame;Simulation" << "\n"; stream << "Exec=\"" << target.toLocal8Bit() << "\"" << argstring.toLocal8Bit() << "\n"; stream << "Name=" << name.toLocal8Bit() << "\n"; From 54187a505f500231a55cbceba26d6dc605fe6b30 Mon Sep 17 00:00:00 2001 From: Alexandru Ionut Tripon Date: Tue, 7 Nov 2023 20:39:12 +0200 Subject: [PATCH 38/56] Update launcher/ui/dialogs/MSALoginDialog.cpp Co-authored-by: Tayou Signed-off-by: Alexandru Ionut Tripon --- launcher/ui/dialogs/MSALoginDialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launcher/ui/dialogs/MSALoginDialog.cpp b/launcher/ui/dialogs/MSALoginDialog.cpp index 5dba84858..e36a574f3 100644 --- a/launcher/ui/dialogs/MSALoginDialog.cpp +++ b/launcher/ui/dialogs/MSALoginDialog.cpp @@ -109,8 +109,8 @@ void MSALoginDialog::showVerificationUriAndCode(const QUrl& uri, const QString& urlString += QString("?otc=%1").arg(code); DesktopServices::openUrl(urlString); ui->label->setText( - tr("

Please login in the opened browser. If no browser was opened please follow the following instructions:

" - "

Please open up %1 in a browser and put in the code %2 to proceed with login.

") + tr("

Please login in the opened browser. If no browser was opened please open up %1 in " + "a browser and put in the code %2 to proceed with login.

") .arg(linkString, code)); } else { ui->label->setText( From 4dc9e658750e5b0cab23ff7492db20fce6bc49d3 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Tue, 7 Nov 2023 20:41:45 +0200 Subject: [PATCH 39/56] Formated the suggestion Signed-off-by: Trial97 --- launcher/ui/dialogs/MSALoginDialog.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/launcher/ui/dialogs/MSALoginDialog.cpp b/launcher/ui/dialogs/MSALoginDialog.cpp index e36a574f3..adc1b9e74 100644 --- a/launcher/ui/dialogs/MSALoginDialog.cpp +++ b/launcher/ui/dialogs/MSALoginDialog.cpp @@ -108,10 +108,9 @@ void MSALoginDialog::showVerificationUriAndCode(const QUrl& uri, const QString& if (urlString == "https://www.microsoft.com/link" && !code.isEmpty()) { urlString += QString("?otc=%1").arg(code); DesktopServices::openUrl(urlString); - ui->label->setText( - tr("

Please login in the opened browser. If no browser was opened please open up %1 in " - "a browser and put in the code %2 to proceed with login.

") - .arg(linkString, code)); + ui->label->setText(tr("

Please login in the opened browser. If no browser was opened please open up %1 in " + "a browser and put in the code %2 to proceed with login.

") + .arg(linkString, code)); } else { ui->label->setText( tr("

Please open up %1 in a browser and put in the code %2 to proceed with login.

").arg(linkString, code)); From d4b479a186dfb3b1ede3d86258f4a9f50722fa5d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 7 Nov 2023 23:55:40 +0000 Subject: [PATCH 40/56] chore(deps): update korthout/backport-action action to v2.1.1 --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 6f2025551..e5443439d 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -24,7 +24,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - name: Create backport PRs - uses: korthout/backport-action@v2.1.0 + uses: korthout/backport-action@v2.1.1 with: # Config README: https://github.com/korthout/backport-action#backport-action pull_description: |- From 9d653f172a512e163e61dac2455e12fe1678dc7c Mon Sep 17 00:00:00 2001 From: Alexandru Ionut Tripon Date: Wed, 8 Nov 2023 08:56:48 +0200 Subject: [PATCH 41/56] Update launcher/ui/dialogs/MSALoginDialog.cpp Co-authored-by: seth Signed-off-by: Alexandru Ionut Tripon --- launcher/ui/dialogs/MSALoginDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/ui/dialogs/MSALoginDialog.cpp b/launcher/ui/dialogs/MSALoginDialog.cpp index adc1b9e74..7df423412 100644 --- a/launcher/ui/dialogs/MSALoginDialog.cpp +++ b/launcher/ui/dialogs/MSALoginDialog.cpp @@ -108,7 +108,7 @@ void MSALoginDialog::showVerificationUriAndCode(const QUrl& uri, const QString& if (urlString == "https://www.microsoft.com/link" && !code.isEmpty()) { urlString += QString("?otc=%1").arg(code); DesktopServices::openUrl(urlString); - ui->label->setText(tr("

Please login in the opened browser. If no browser was opened please open up %1 in " + ui->label->setText(tr("

Please login in the opened browser. If no browser was opened, please open up %1 in " "a browser and put in the code %2 to proceed with login.

") .arg(linkString, code)); } else { From 731363061521375fc363f203b43a65bc3a37434e Mon Sep 17 00:00:00 2001 From: Alexandru Ionut Tripon Date: Wed, 8 Nov 2023 09:01:31 +0200 Subject: [PATCH 42/56] Update launcher/java/JavaUtils.cpp Co-authored-by: seth Signed-off-by: Alexandru Ionut Tripon --- launcher/java/JavaUtils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/launcher/java/JavaUtils.cpp b/launcher/java/JavaUtils.cpp index 615608ca3..074bf54df 100644 --- a/launcher/java/JavaUtils.cpp +++ b/launcher/java/JavaUtils.cpp @@ -448,12 +448,12 @@ QStringList getMinecraftJavaBundle() partialPath = QProcessEnvironment::systemEnvironment().value("LOCALAPPDATA", ""); executable += "w.exe"; - // add the following to the search + // add the microsoft store version of the launcher to the search. the current path is: // C:\Users\USERNAME\AppData\Local\Packages\Microsoft.4297127D64EC6_8wekyb3d8bbwe\LocalCache\Local\runtime - auto minecraftInstaltionPath = + auto minecraftMSStorePath = FS::PathCombine(QFileInfo(partialPath).absolutePath(), "Local", "Packages", "Microsoft.4297127D64EC6_8wekyb3d8bbwe"); - minecraftInstaltionPath = FS::PathCombine(minecraftInstaltionPath, "LocalCache", "Local", "runtime"); - processpaths << minecraftInstaltionPath; + minecraftMSStorePath = FS::PathCombine(minecraftMSStorePath, "LocalCache", "Local", "runtime"); + processpaths << minecraftMSStorePath; #else partialPath = QDir::homePath(); #endif From a7bfe385ea24a68f791139246c788ef44611a862 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 8 Nov 2023 12:10:39 +0200 Subject: [PATCH 43/56] Renamed Remove Metadata button Signed-off-by: Trial97 --- launcher/ui/pages/instance/ModFolderPage.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp index a2fe19a87..2ce35c43d 100644 --- a/launcher/ui/pages/instance/ModFolderPage.cpp +++ b/launcher/ui/pages/instance/ModFolderPage.cpp @@ -125,7 +125,7 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr remove->setToolTip(tr("Remove selected item")); connect(remove, &QAction::triggered, this, &ModFolderPage::removeItem); } - auto actionRemoveItemMetadata = removeMenu->addAction(tr("Remove metadata")); + auto actionRemoveItemMetadata = removeMenu->addAction(tr("Reset update metadata")); actionRemoveItemMetadata->setToolTip(tr("Remove mod's metadata")); connect(actionRemoveItemMetadata, &QAction::triggered, this, &ModFolderPage::deleteModMetadata); @@ -145,12 +145,9 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr ui->actionVisitItemPage->setText(tr("Visit mod's page")); ui->actionVisitItemPage->setToolTip(tr("Go to mod's home page")); - actionRemoveItemMetadata->setToolTip(tr("Remove mod's metadata")); } else { ui->actionVisitItemPage->setText(tr("Visit mods' pages")); ui->actionVisitItemPage->setToolTip(tr("Go to the pages of the selected mods")); - - actionRemoveItemMetadata->setToolTip(tr("Remove mods' metadata")); } ui->actionVisitItemPage->setEnabled(selected != 0); actionRemoveItemMetadata->setEnabled(selected != 0); From ae62e48c7cf78aa585decc4cdb5b921006b1593c Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 8 Nov 2023 12:25:56 +0200 Subject: [PATCH 44/56] Moved some buttons around Signed-off-by: Trial97 --- launcher/ui/pages/instance/ModFolderPage.cpp | 62 ++++++++------------ 1 file changed, 25 insertions(+), 37 deletions(-) diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp index 2ce35c43d..08fd8ea5a 100644 --- a/launcher/ui/pages/instance/ModFolderPage.cpp +++ b/launcher/ui/pages/instance/ModFolderPage.cpp @@ -84,28 +84,33 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr connect(ui->actionDownloadItem, &QAction::triggered, this, &ModFolderPage::installMods); - if (!APPLICATION->settings()->get("ModDependenciesDisabled").toBool()) { // dependencies - auto updateMenu = ui->actionUpdateItem->menu(); - if (updateMenu) { - updateMenu->clear(); - } else { - updateMenu = new QMenu(this); - } - - { - auto update = updateMenu->addAction(tr("Check for Updates")); - update->setToolTip(tr("Try to check or update all selected mods (all mods if none are selected)")); - connect(update, &QAction::triggered, this, &ModFolderPage::updateMods); - } - { - auto updateWithDeps = updateMenu->addAction(tr("Verify Dependencies")); - updateWithDeps->setToolTip( - tr("Try to update and check for missing dependencies all selected mods (all mods if none are selected)")); - connect(updateWithDeps, &QAction::triggered, this, [this] { updateMods(true); }); - } - ui->actionUpdateItem->setMenu(updateMenu); + // update menu + auto updateMenu = ui->actionUpdateItem->menu(); + if (updateMenu) { + updateMenu->clear(); + } else { + updateMenu = new QMenu(this); } + { + auto update = updateMenu->addAction(tr("Check for Updates")); + update->setToolTip(tr("Try to check or update all selected mods (all mods if none are selected)")); + connect(update, &QAction::triggered, this, &ModFolderPage::updateMods); + } + if (!APPLICATION->settings()->get("ModDependenciesDisabled").toBool()) { // dependencies + + auto updateWithDeps = updateMenu->addAction(tr("Verify Dependencies")); + updateWithDeps->setToolTip( + tr("Try to update and check for missing dependencies all selected mods (all mods if none are selected)")); + connect(updateWithDeps, &QAction::triggered, this, [this] { updateMods(true); }); + } + auto actionRemoveItemMetadata = updateMenu->addAction(tr("Reset update metadata")); + actionRemoveItemMetadata->setToolTip(tr("Remove mod's metadata")); + connect(actionRemoveItemMetadata, &QAction::triggered, this, &ModFolderPage::deleteModMetadata); + actionRemoveItemMetadata->setEnabled(false); + + ui->actionUpdateItem->setMenu(updateMenu); + ui->actionUpdateItem->setToolTip(tr("Try to check or update all selected mods (all mods if none are selected)")); connect(ui->actionUpdateItem, &QAction::triggered, this, &ModFolderPage::updateMods); ui->actionsToolbar->insertActionBefore(ui->actionAddItem, ui->actionUpdateItem); @@ -114,23 +119,6 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr ui->actionsToolbar->addAction(ui->actionVisitItemPage); connect(ui->actionVisitItemPage, &QAction::triggered, this, &ModFolderPage::visitModPages); - auto removeMenu = ui->actionRemoveItem->menu(); - if (removeMenu) { - removeMenu->clear(); - } else { - removeMenu = new QMenu(this); - } - { - auto remove = removeMenu->addAction("Remove"); - remove->setToolTip(tr("Remove selected item")); - connect(remove, &QAction::triggered, this, &ModFolderPage::removeItem); - } - auto actionRemoveItemMetadata = removeMenu->addAction(tr("Reset update metadata")); - actionRemoveItemMetadata->setToolTip(tr("Remove mod's metadata")); - connect(actionRemoveItemMetadata, &QAction::triggered, this, &ModFolderPage::deleteModMetadata); - - ui->actionRemoveItem->setMenu(removeMenu); - auto check_allow_update = [this] { return ui->treeView->selectionModel()->hasSelection() || !m_model->empty(); }; connect(ui->treeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, From 6093399f5c861417d8af9503517d391ff58e7390 Mon Sep 17 00:00:00 2001 From: Desoroxxx Date: Wed, 8 Nov 2023 17:32:30 +0100 Subject: [PATCH 45/56] Update LauncherPage.ui Signed-off-by: Desoroxxx --- launcher/ui/pages/global/LauncherPage.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui index 32d89ee51..83897f7a7 100644 --- a/launcher/ui/pages/global/LauncherPage.ui +++ b/launcher/ui/pages/global/LauncherPage.ui @@ -189,10 +189,10 @@ - Disable automatically checking and installation of mod dependencies. + Disable the automatic detection, installation, and updating of mod dependencies. - Do not install mod dependencies + Disable automatic mod dependency management From 0f68a2dd616b24173369515046cdd008cf0f6834 Mon Sep 17 00:00:00 2001 From: TheKodeToad Date: Thu, 9 Nov 2023 16:38:26 +0000 Subject: [PATCH 46/56] Only open/close groups on left button Signed-off-by: TheKodeToad --- launcher/ui/instanceview/InstanceView.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/launcher/ui/instanceview/InstanceView.cpp b/launcher/ui/instanceview/InstanceView.cpp index 7530fdfba..e665097f4 100644 --- a/launcher/ui/instanceview/InstanceView.cpp +++ b/launcher/ui/instanceview/InstanceView.cpp @@ -278,12 +278,14 @@ void InstanceView::mousePressEvent(QMouseEvent* event) m_pressedAlreadySelected = selectionModel()->isSelected(m_pressedIndex); m_pressedPosition = geometryPos; - VisualGroup::HitResults hitResult; - m_pressedCategory = categoryAt(geometryPos, hitResult); - if (m_pressedCategory && hitResult & VisualGroup::CheckboxHit) { - setState(m_pressedCategory->collapsed ? ExpandingState : CollapsingState); - event->accept(); - return; + if (event->button() == Qt::LeftButton) { + VisualGroup::HitResults hitResult; + m_pressedCategory = categoryAt(geometryPos, hitResult); + if (m_pressedCategory && hitResult & VisualGroup::CheckboxHit) { + setState(m_pressedCategory->collapsed ? ExpandingState : CollapsingState); + event->accept(); + return; + } } if (index.isValid() && (index.flags() & Qt::ItemIsEnabled)) { @@ -366,10 +368,7 @@ void InstanceView::mouseReleaseEvent(QMouseEvent* event) VisualGroup::HitResults hitResult; - bool click = - (index == m_pressedIndex && index.isValid()) || (m_pressedCategory && m_pressedCategory == categoryAt(geometryPos, hitResult)); - - if (click && m_pressedCategory) { + if (event->button() == Qt::LeftButton && m_pressedCategory != nullptr && m_pressedCategory == categoryAt(geometryPos, hitResult)) { if (state() == ExpandingState) { m_pressedCategory->collapsed = false; emit groupStateChanged(m_pressedCategory->text, false); @@ -397,7 +396,7 @@ void InstanceView::mouseReleaseEvent(QMouseEvent* event) setState(NoState); - if (click) { + if (index == m_pressedIndex && index.isValid()) { if (event->button() == Qt::LeftButton) { emit clicked(index); } From 926942a973cd3f9df5467abcd438203f0279bcd4 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Fri, 10 Nov 2023 20:00:35 +0200 Subject: [PATCH 47/56] Fixed modrinth sort swap Signed-off-by: Trial97 --- launcher/modplatform/modrinth/ModrinthAPI.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launcher/modplatform/modrinth/ModrinthAPI.cpp b/launcher/modplatform/modrinth/ModrinthAPI.cpp index 8be963ecf..9777c2cfd 100644 --- a/launcher/modplatform/modrinth/ModrinthAPI.cpp +++ b/launcher/modplatform/modrinth/ModrinthAPI.cpp @@ -117,6 +117,6 @@ QList ModrinthAPI::getSortingMethods() const return { { 1, "relevance", QObject::tr("Sort by Relevance") }, { 2, "downloads", QObject::tr("Sort by Downloads") }, { 3, "follows", QObject::tr("Sort by Follows") }, - { 4, "newest", QObject::tr("Sort by Last Updated") }, - { 5, "updated", QObject::tr("Sort by Newest") } }; + { 4, "newest", QObject::tr("Sort by Newest") }, + { 5, "updated", QObject::tr("Sort by Last Updated") } }; } From cb648c180cb6d38aa1a8662851738cde7595e6e2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 12 Nov 2023 00:18:56 +0000 Subject: [PATCH 48/56] chore(nix): update lockfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'libnbtplusplus': 'github:PrismLauncher/libnbtplusplus/a5e8fd52b8bf4ab5d5bcc042b2a247867589985f' (2023-07-22) → 'github:PrismLauncher/libnbtplusplus/23b955121b8217c1c348a9ed2483167a6f3ff4ad' (2023-11-06) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/9d5d25bbfe8c0297ebe85324addcb5020ed1a454' (2023-11-04) → 'github:nixos/nixpkgs/ec750fd01963ab6b20ee1f0cb488754e8036d89d' (2023-11-07) • Updated input 'pre-commit-hooks': 'github:cachix/pre-commit-hooks.nix/dec10399e5b56aa95fcd530e0338be72ad6462a0' (2023-11-01) → 'github:cachix/pre-commit-hooks.nix/ea758da1a6dcde6dc36db348ed690d09b9864128' (2023-11-06) --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index a520c27e5..70c8cba4f 100644 --- a/flake.lock +++ b/flake.lock @@ -76,11 +76,11 @@ "libnbtplusplus": { "flake": false, "locked": { - "lastModified": 1690036783, - "narHash": "sha256-A5kTgICnx+Qdq3Fir/bKTfdTt/T1NQP2SC+nhN1ENug=", + "lastModified": 1699286814, + "narHash": "sha256-yy0q+bky80LtK1GWzz7qpM+aAGrOqLuewbid8WT1ilk=", "owner": "PrismLauncher", "repo": "libnbtplusplus", - "rev": "a5e8fd52b8bf4ab5d5bcc042b2a247867589985f", + "rev": "23b955121b8217c1c348a9ed2483167a6f3ff4ad", "type": "github" }, "original": { @@ -106,11 +106,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1699094435, - "narHash": "sha256-YLZ5/KKZ1PyLrm2MO8UxRe4H3M0/oaYqNhSlq6FDeeA=", + "lastModified": 1699343069, + "narHash": "sha256-s7BBhyLA6MI6FuJgs4F/SgpntHBzz40/qV0xLPW6A1Q=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9d5d25bbfe8c0297ebe85324addcb5020ed1a454", + "rev": "ec750fd01963ab6b20ee1f0cb488754e8036d89d", "type": "github" }, "original": { @@ -153,11 +153,11 @@ ] }, "locked": { - "lastModified": 1698852633, - "narHash": "sha256-Hsc/cCHud8ZXLvmm8pxrXpuaPEeNaaUttaCvtdX/Wug=", + "lastModified": 1699271226, + "narHash": "sha256-8Jt1KW3xTjolD6c6OjJm9USx/jmL+VVmbooADCkdDfU=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "dec10399e5b56aa95fcd530e0338be72ad6462a0", + "rev": "ea758da1a6dcde6dc36db348ed690d09b9864128", "type": "github" }, "original": { From 32a8d9b9c6df7c0c4373d22f9e30edb634c90774 Mon Sep 17 00:00:00 2001 From: Alexandru Ionut Tripon Date: Mon, 13 Nov 2023 09:23:56 +0200 Subject: [PATCH 49/56] Update launcher/ui/pages/instance/ModFolderPage.cpp Co-authored-by: TheKodeToad Signed-off-by: Alexandru Ionut Tripon --- launcher/ui/pages/instance/ModFolderPage.cpp | 23 ++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp index 08fd8ea5a..ce67324a3 100644 --- a/launcher/ui/pages/instance/ModFolderPage.cpp +++ b/launcher/ui/pages/instance/ModFolderPage.cpp @@ -92,18 +92,19 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr updateMenu = new QMenu(this); } - { - auto update = updateMenu->addAction(tr("Check for Updates")); - update->setToolTip(tr("Try to check or update all selected mods (all mods if none are selected)")); - connect(update, &QAction::triggered, this, &ModFolderPage::updateMods); - } - if (!APPLICATION->settings()->get("ModDependenciesDisabled").toBool()) { // dependencies + auto update = updateMenu->addAction(tr("Check for Updates")); + update->setToolTip(tr("Try to check or update all selected mods (all mods if none are selected)")); + connect(update, &QAction::triggered, this, &ModFolderPage::updateMods); - auto updateWithDeps = updateMenu->addAction(tr("Verify Dependencies")); - updateWithDeps->setToolTip( - tr("Try to update and check for missing dependencies all selected mods (all mods if none are selected)")); - connect(updateWithDeps, &QAction::triggered, this, [this] { updateMods(true); }); - } + auto updateWithDeps = updateMenu->addAction(tr("Verify Dependencies")); + updateWithDeps->setToolTip( + tr("Try to update and check for missing dependencies all selected mods (all mods if none are selected)")); + connect(updateWithDeps, &QAction::triggered, this, [this] { updateMods(true); }); + + auto depsDisabled = APPLICATION->settings()->getSetting("ModDependenciesDisabled"); + updateWithDeps->setVisible(!depsDisabled->get().toBool()); + connect(depsDisabled.get(), &Setting::SettingChanged, this, + [](const Setting& setting, QVariant value) { updateWithDeps->setVisible(!value.toBool()); }); auto actionRemoveItemMetadata = updateMenu->addAction(tr("Reset update metadata")); actionRemoveItemMetadata->setToolTip(tr("Remove mod's metadata")); connect(actionRemoveItemMetadata, &QAction::triggered, this, &ModFolderPage::deleteModMetadata); From 0e57eeca69554178bdd1817ccb01be2286e48110 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Mon, 13 Nov 2023 09:28:59 +0200 Subject: [PATCH 50/56] Added missing variable from lambda capture Signed-off-by: Trial97 --- launcher/ui/pages/instance/ModFolderPage.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp index ce67324a3..a38e608f2 100644 --- a/launcher/ui/pages/instance/ModFolderPage.cpp +++ b/launcher/ui/pages/instance/ModFolderPage.cpp @@ -104,7 +104,8 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr auto depsDisabled = APPLICATION->settings()->getSetting("ModDependenciesDisabled"); updateWithDeps->setVisible(!depsDisabled->get().toBool()); connect(depsDisabled.get(), &Setting::SettingChanged, this, - [](const Setting& setting, QVariant value) { updateWithDeps->setVisible(!value.toBool()); }); + [updateWithDeps](const Setting& setting, QVariant value) { updateWithDeps->setVisible(!value.toBool()); }); + auto actionRemoveItemMetadata = updateMenu->addAction(tr("Reset update metadata")); actionRemoveItemMetadata->setToolTip(tr("Remove mod's metadata")); connect(actionRemoveItemMetadata, &QAction::triggered, this, &ModFolderPage::deleteModMetadata); From 361329d5d15d5963af35c23f0d131e51bc97a6f8 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Tue, 14 Nov 2023 23:21:53 +0200 Subject: [PATCH 51/56] Made resource columns resizable Signed-off-by: Trial97 --- launcher/minecraft/mod/ModFolderModel.cpp | 6 ++-- .../minecraft/mod/ResourceFolderModel.cpp | 29 +++++-------------- launcher/minecraft/mod/ResourceFolderModel.h | 7 ++--- .../minecraft/mod/ResourcePackFolderModel.cpp | 4 +-- .../minecraft/mod/TexturePackFolderModel.cpp | 3 +- launcher/ui/pages/global/AccountListPage.cpp | 1 + .../pages/instance/ExternalResourcesPage.cpp | 4 ++- launcher/ui/widgets/ModListView.cpp | 6 ++-- 8 files changed, 24 insertions(+), 36 deletions(-) diff --git a/launcher/minecraft/mod/ModFolderModel.cpp b/launcher/minecraft/mod/ModFolderModel.cpp index 11f7cd0f1..fc543202f 100644 --- a/launcher/minecraft/mod/ModFolderModel.cpp +++ b/launcher/minecraft/mod/ModFolderModel.cpp @@ -37,9 +37,9 @@ #include "ModFolderModel.h" #include -#include #include #include +#include #include #include #include @@ -65,8 +65,8 @@ ModFolderModel::ModFolderModel(const QString& dir, BaseInstance* instance, bool m_column_names = QStringList({ "Enable", "Image", "Name", "Version", "Last Modified", "Provider" }); m_column_names_translated = QStringList({ tr("Enable"), tr("Image"), tr("Name"), tr("Version"), tr("Last Modified"), tr("Provider") }); m_column_sort_keys = { SortType::ENABLED, SortType::NAME, SortType::NAME, SortType::VERSION, SortType::DATE, SortType::PROVIDER }; - m_column_resize_modes = { QHeaderView::ResizeToContents, QHeaderView::Interactive, QHeaderView::Stretch, - QHeaderView::ResizeToContents, QHeaderView::ResizeToContents, QHeaderView::ResizeToContents }; + m_column_resize_modes = { QHeaderView::Interactive, QHeaderView::Interactive, QHeaderView::Stretch, + QHeaderView::Interactive, QHeaderView::Interactive, QHeaderView::Interactive }; m_columnsHideable = { false, true, false, true, true, true }; } diff --git a/launcher/minecraft/mod/ResourceFolderModel.cpp b/launcher/minecraft/mod/ResourceFolderModel.cpp index 0503b660b..4a3ee9922 100644 --- a/launcher/minecraft/mod/ResourceFolderModel.cpp +++ b/launcher/minecraft/mod/ResourceFolderModel.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -516,36 +517,22 @@ void ResourceFolderModel::setupHeaderAction(QAction* act, int column) act->setText(columnNames().at(column)); } -void ResourceFolderModel::saveHiddenColumn(int column, bool hidden) +void ResourceFolderModel::saveColumns(QTreeView* tree) { - auto const setting_name = QString("UI/%1_Page/HiddenColumns").arg(id()); + auto const setting_name = QString("UI/%1_Page/Columns").arg(id()); auto setting = (m_instance->settings()->contains(setting_name)) ? m_instance->settings()->getSetting(setting_name) : m_instance->settings()->registerSetting(setting_name); - auto hiddenColumns = setting->get().toStringList(); - auto name = columnNames(false).at(column); - auto index = hiddenColumns.indexOf(name); - if (index >= 0 && !hidden) { - hiddenColumns.removeAt(index); - } else if (index < 0 && hidden) { - hiddenColumns.append(name); - } - setting->set(hiddenColumns); + setting->set(tree->header()->saveState()); } -void ResourceFolderModel::loadHiddenColumns(QTreeView* tree) +void ResourceFolderModel::loadColumns(QTreeView* tree) { - auto const setting_name = QString("UI/%1_Page/HiddenColumns").arg(id()); + auto const setting_name = QString("UI/%1_Page/Columns").arg(id()); auto setting = (m_instance->settings()->contains(setting_name)) ? m_instance->settings()->getSetting(setting_name) : m_instance->settings()->registerSetting(setting_name); - auto hiddenColumns = setting->get().toStringList(); - auto col_names = columnNames(false); - for (auto col_name : hiddenColumns) { - auto index = col_names.indexOf(col_name); - if (index >= 0) - tree->setColumnHidden(index, true); - } + tree->header()->restoreState(setting->get().toByteArray()); } QMenu* ResourceFolderModel::createHeaderContextMenu(QTreeView* tree) @@ -570,7 +557,7 @@ QMenu* ResourceFolderModel::createHeaderContextMenu(QTreeView* tree) if (m_column_resize_modes.at(c) == QHeaderView::ResizeToContents) tree->resizeColumnToContents(c); } - saveHiddenColumn(col, !toggled); + saveColumns(tree); }); menu->addAction(act); diff --git a/launcher/minecraft/mod/ResourceFolderModel.h b/launcher/minecraft/mod/ResourceFolderModel.h index 60b8879c0..b3f6d9a58 100644 --- a/launcher/minecraft/mod/ResourceFolderModel.h +++ b/launcher/minecraft/mod/ResourceFolderModel.h @@ -117,8 +117,8 @@ class ResourceFolderModel : public QAbstractListModel { [[nodiscard]] QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; void setupHeaderAction(QAction* act, int column); - void saveHiddenColumn(int column, bool hidden); - void loadHiddenColumns(QTreeView* tree); + void saveColumns(QTreeView* tree); + void loadColumns(QTreeView* tree); QMenu* createHeaderContextMenu(QTreeView* tree); /** This creates a proxy model to filter / sort the model for a UI. @@ -201,8 +201,7 @@ class ResourceFolderModel : public QAbstractListModel { QList m_column_sort_keys = { SortType::ENABLED, SortType::NAME, SortType::DATE }; QStringList m_column_names = { "Enable", "Name", "Last Modified" }; QStringList m_column_names_translated = { tr("Enable"), tr("Name"), tr("Last Modified") }; - QList m_column_resize_modes = { QHeaderView::ResizeToContents, QHeaderView::Stretch, - QHeaderView::ResizeToContents }; + QList m_column_resize_modes = { QHeaderView::Interactive, QHeaderView::Stretch, QHeaderView::Interactive }; QList m_columnsHideable = { false, false, true }; QDir m_dir; diff --git a/launcher/minecraft/mod/ResourcePackFolderModel.cpp b/launcher/minecraft/mod/ResourcePackFolderModel.cpp index efe1cc5dd..693b8af05 100644 --- a/launcher/minecraft/mod/ResourcePackFolderModel.cpp +++ b/launcher/minecraft/mod/ResourcePackFolderModel.cpp @@ -52,8 +52,8 @@ ResourcePackFolderModel::ResourcePackFolderModel(const QString& dir, BaseInstanc m_column_names = QStringList({ "Enable", "Image", "Name", "Pack Format", "Last Modified" }); m_column_names_translated = QStringList({ tr("Enable"), tr("Image"), tr("Name"), tr("Pack Format"), tr("Last Modified") }); m_column_sort_keys = { SortType::ENABLED, SortType::NAME, SortType::NAME, SortType::PACK_FORMAT, SortType::DATE }; - m_column_resize_modes = { QHeaderView::ResizeToContents, QHeaderView::Interactive, QHeaderView::Stretch, QHeaderView::ResizeToContents, - QHeaderView::ResizeToContents }; + m_column_resize_modes = { QHeaderView::Interactive, QHeaderView::Interactive, QHeaderView::Stretch, QHeaderView::Interactive, + QHeaderView::Interactive }; m_columnsHideable = { false, true, false, true, true }; } diff --git a/launcher/minecraft/mod/TexturePackFolderModel.cpp b/launcher/minecraft/mod/TexturePackFolderModel.cpp index e39be1fb9..f210501c7 100644 --- a/launcher/minecraft/mod/TexturePackFolderModel.cpp +++ b/launcher/minecraft/mod/TexturePackFolderModel.cpp @@ -47,8 +47,7 @@ TexturePackFolderModel::TexturePackFolderModel(const QString& dir, BaseInstance* m_column_names = QStringList({ "Enable", "Image", "Name", "Last Modified" }); m_column_names_translated = QStringList({ tr("Enable"), tr("Image"), tr("Name"), tr("Last Modified") }); m_column_sort_keys = { SortType::ENABLED, SortType::NAME, SortType::NAME, SortType::DATE }; - m_column_resize_modes = { QHeaderView::ResizeToContents, QHeaderView::Interactive, QHeaderView::Stretch, - QHeaderView::ResizeToContents }; + m_column_resize_modes = { QHeaderView::Interactive, QHeaderView::Interactive, QHeaderView::Stretch, QHeaderView::Interactive }; m_columnsHideable = { false, true, false, true }; } diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp index 3a21cdd9b..2fd8a0402 100644 --- a/launcher/ui/pages/global/AccountListPage.cpp +++ b/launcher/ui/pages/global/AccountListPage.cpp @@ -231,6 +231,7 @@ void AccountListPage::updateButtonStates() ui->actionNoDefault->setEnabled(true); ui->actionNoDefault->setChecked(false); } + ui->listView->resizeColumnToContents(3); } void AccountListPage::on_actionUploadSkin_triggered() diff --git a/launcher/ui/pages/instance/ExternalResourcesPage.cpp b/launcher/ui/pages/instance/ExternalResourcesPage.cpp index 1a8fafa9b..b04c7250c 100644 --- a/launcher/ui/pages/instance/ExternalResourcesPage.cpp +++ b/launcher/ui/pages/instance/ExternalResourcesPage.cpp @@ -42,6 +42,7 @@ #include "minecraft/mod/ResourceFolderModel.h" #include "ui/GuiUtil.h" +#include #include #include #include @@ -95,7 +96,8 @@ ExternalResourcesPage::ExternalResourcesPage(BaseInstance* instance, std::shared connect(viewHeader, &QHeaderView::customContextMenuRequested, this, &ExternalResourcesPage::ShowHeaderContextMenu); - m_model->loadHiddenColumns(ui->treeView); + m_model->loadColumns(ui->treeView); + connect(ui->treeView->header(), &QHeaderView::sectionResized, this, [this] { m_model->saveColumns(ui->treeView); }); } ExternalResourcesPage::~ExternalResourcesPage() diff --git a/launcher/ui/widgets/ModListView.cpp b/launcher/ui/widgets/ModListView.cpp index c72d4c522..a38c7c86a 100644 --- a/launcher/ui/widgets/ModListView.cpp +++ b/launcher/ui/widgets/ModListView.cpp @@ -48,14 +48,14 @@ void ModListView::setModel(QAbstractItemModel* model) return; } if (!string.size()) { - head->setSectionResizeMode(0, QHeaderView::ResizeToContents); + head->setSectionResizeMode(0, QHeaderView::Interactive); head->setSectionResizeMode(1, QHeaderView::Stretch); for (int i = 2; i < head->count(); i++) - head->setSectionResizeMode(i, QHeaderView::ResizeToContents); + head->setSectionResizeMode(i, QHeaderView::Interactive); } else { head->setSectionResizeMode(0, QHeaderView::Stretch); for (int i = 1; i < head->count(); i++) - head->setSectionResizeMode(i, QHeaderView::ResizeToContents); + head->setSectionResizeMode(i, QHeaderView::Interactive); } } From 1a06a1424b6fc848bd7904123251aefb229ca0e5 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Sat, 18 Nov 2023 10:53:38 +0200 Subject: [PATCH 52/56] Added custom env vars to pre/post launch commands Signed-off-by: Trial97 --- launcher/minecraft/MinecraftInstance.cpp | 34 +++++++++++------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/launcher/minecraft/MinecraftInstance.cpp b/launcher/minecraft/MinecraftInstance.cpp index 7cb4100ea..e2769f2f4 100644 --- a/launcher/minecraft/MinecraftInstance.cpp +++ b/launcher/minecraft/MinecraftInstance.cpp @@ -565,6 +565,22 @@ QProcessEnvironment MinecraftInstance::createEnvironment() for (auto it = variables.begin(); it != variables.end(); ++it) { env.insert(it.key(), it.value()); } + // custom env + + auto insertEnv = [&env](QMap envMap) { + if (envMap.isEmpty()) + return; + + for (auto iter = envMap.begin(); iter != envMap.end(); iter++) + env.insert(iter.key(), iter.value().toString()); + }; + + bool overrideEnv = settings()->get("OverrideEnv").toBool(); + + if (!overrideEnv) + insertEnv(APPLICATION->settings()->get("Env").toMap()); + else + insertEnv(settings()->get("Env").toMap()); return env; } @@ -606,24 +622,6 @@ QProcessEnvironment MinecraftInstance::createLaunchEnvironment() env.insert("__GLX_VENDOR_LIBRARY_NAME", "nvidia"); } #endif - - // custom env - - auto insertEnv = [&env](QMap envMap) { - if (envMap.isEmpty()) - return; - - for (auto iter = envMap.begin(); iter != envMap.end(); iter++) - env.insert(iter.key(), iter.value().toString()); - }; - - bool overrideEnv = settings()->get("OverrideEnv").toBool(); - - if (!overrideEnv) - insertEnv(APPLICATION->settings()->get("Env").toMap()); - else - insertEnv(settings()->get("Env").toMap()); - return env; } From 69a49e85d07e3c625ee4967357a3ee4358a34371 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 19 Nov 2023 00:19:30 +0000 Subject: [PATCH 53/56] chore(nix): update lockfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:nixos/nixpkgs/ec750fd01963ab6b20ee1f0cb488754e8036d89d' (2023-11-07) → 'github:nixos/nixpkgs/7414e9ee0b3e9903c24d3379f577a417f0aae5f1' (2023-11-16) • Updated input 'pre-commit-hooks': 'github:cachix/pre-commit-hooks.nix/ea758da1a6dcde6dc36db348ed690d09b9864128' (2023-11-06) → 'github:cachix/pre-commit-hooks.nix/e558068cba67b23b4fbc5537173dbb43748a17e8' (2023-11-15) --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 70c8cba4f..3422af0ac 100644 --- a/flake.lock +++ b/flake.lock @@ -106,11 +106,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1699343069, - "narHash": "sha256-s7BBhyLA6MI6FuJgs4F/SgpntHBzz40/qV0xLPW6A1Q=", + "lastModified": 1700108881, + "narHash": "sha256-+Lqybl8kj0+nD/IlAWPPG/RDTa47gff9nbei0u7BntE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ec750fd01963ab6b20ee1f0cb488754e8036d89d", + "rev": "7414e9ee0b3e9903c24d3379f577a417f0aae5f1", "type": "github" }, "original": { @@ -153,11 +153,11 @@ ] }, "locked": { - "lastModified": 1699271226, - "narHash": "sha256-8Jt1KW3xTjolD6c6OjJm9USx/jmL+VVmbooADCkdDfU=", + "lastModified": 1700064067, + "narHash": "sha256-1ZWNDzhu8UlVCK7+DUN9dVQfiHX1bv6OQP9VxstY/gs=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "ea758da1a6dcde6dc36db348ed690d09b9864128", + "rev": "e558068cba67b23b4fbc5537173dbb43748a17e8", "type": "github" }, "original": { From e99926ea9437c780e40ad9f3bc844043a7a2be1d Mon Sep 17 00:00:00 2001 From: Trial97 Date: Sun, 19 Nov 2023 02:30:19 +0200 Subject: [PATCH 54/56] Added more open folder actions Signed-off-by: Trial97 --- launcher/DesktopServices.cpp | 5 +--- launcher/ui/MainWindow.cpp | 16 ++++++++--- launcher/ui/MainWindow.h | 2 ++ launcher/ui/MainWindow.ui | 51 +++++++++++++++++++++++++++++------- 4 files changed, 57 insertions(+), 17 deletions(-) diff --git a/launcher/DesktopServices.cpp b/launcher/DesktopServices.cpp index 004e5e085..17eb7c2df 100644 --- a/launcher/DesktopServices.cpp +++ b/launcher/DesktopServices.cpp @@ -108,12 +108,9 @@ bool openDirectory(const QString& path, [[maybe_unused]] bool ensureExists) #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) if (!isSandbox()) { return IndirectOpen(f); - } else { - return f(); } -#else - return f(); #endif + return f(); } bool openFile(const QString& path) diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 1da982dad..7b4d1c8a5 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1198,17 +1198,27 @@ void MainWindow::on_actionViewCentralModsFolder_triggered() void MainWindow::on_actionViewIconThemeFolder_triggered() { - DesktopServices::openDirectory(APPLICATION->themeManager()->getIconThemesFolder().path()); + DesktopServices::openDirectory(APPLICATION->themeManager()->getIconThemesFolder().path(), true); } void MainWindow::on_actionViewWidgetThemeFolder_triggered() { - DesktopServices::openDirectory(APPLICATION->themeManager()->getApplicationThemesFolder().path()); + DesktopServices::openDirectory(APPLICATION->themeManager()->getApplicationThemesFolder().path(), true); } void MainWindow::on_actionViewCatPackFolder_triggered() { - DesktopServices::openDirectory(APPLICATION->themeManager()->getCatPacksFolder().path()); + DesktopServices::openDirectory(APPLICATION->themeManager()->getCatPacksFolder().path(), true); +} + +void MainWindow::on_actionViewIconsFolder_triggered() +{ + DesktopServices::openDirectory(APPLICATION->icons()->getDirectory(), true); +} + +void MainWindow::on_actionViewLogsFolder_triggered() +{ + DesktopServices::openDirectory("logs", true); } void MainWindow::refreshInstances() diff --git a/launcher/ui/MainWindow.h b/launcher/ui/MainWindow.h index 0b7287404..d2e154643 100644 --- a/launcher/ui/MainWindow.h +++ b/launcher/ui/MainWindow.h @@ -117,6 +117,8 @@ class MainWindow : public QMainWindow { void on_actionViewIconThemeFolder_triggered(); void on_actionViewWidgetThemeFolder_triggered(); void on_actionViewCatPackFolder_triggered(); + void on_actionViewIconsFolder_triggered(); + void on_actionViewLogsFolder_triggered(); void on_actionViewSelectedInstFolder_triggered(); diff --git a/launcher/ui/MainWindow.ui b/launcher/ui/MainWindow.ui index 91b2c2703..1ee3a5632 100644 --- a/launcher/ui/MainWindow.ui +++ b/launcher/ui/MainWindow.ui @@ -194,6 +194,9 @@ + + + @@ -545,10 +548,10 @@ .. - View &Instance Folder + &Instances - Open the instance folder in a file browser. + Open the instances folder in a file browser.
@@ -557,7 +560,7 @@ .. - View Launcher &Root Folder + Launcher &Root Open the launcher's root folder in a file browser. @@ -569,12 +572,36 @@ .. - View &Central Mods Folder + &Central Mods Open the central mods folder in a file browser. + + + + .. + + + Instance Icons + + + Open the instance icons folder in a file browser. + + + + + + .. + + + Logs + + + Open the logs folder in a file browser. + + Themes @@ -718,10 +745,10 @@ .. - View &Widget Themes Folder + &Widget Themes - View Widget Theme Folder + Open the widget themes folder in a file browser. @@ -730,18 +757,22 @@ .. - View I&con Theme Folder + I&con Theme - View Icon Theme Folder + Open the icon theme folder in a file browser. - + + .. - View Cat Packs Folder + Cat Packs + + + Open the cat packs folder in a file browser. From e3b7aed76b12610773d177f5019e622dd4366485 Mon Sep 17 00:00:00 2001 From: guihkx <626206+guihkx@users.noreply.github.com> Date: Sun, 19 Nov 2023 11:08:52 -0300 Subject: [PATCH 55/56] chore: sync local flatpak manifest with flathub's Signed-off-by: guihkx <626206+guihkx@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- flatpak/org.prismlauncher.PrismLauncher.yml | 5 ++++- flatpak/patches/gamemode.patch | 12 ++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 flatpak/patches/gamemode.patch diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8077ea59a..4fb2d6794 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -594,7 +594,7 @@ jobs: flatpak: runs-on: ubuntu-latest container: - image: bilelmoussaoui/flatpak-github-actions:kde-5.15-22.08 + image: bilelmoussaoui/flatpak-github-actions:kde-5.15-23.08 options: --privileged steps: - name: Checkout diff --git a/flatpak/org.prismlauncher.PrismLauncher.yml b/flatpak/org.prismlauncher.PrismLauncher.yml index 46b6da36a..89727751e 100644 --- a/flatpak/org.prismlauncher.PrismLauncher.yml +++ b/flatpak/org.prismlauncher.PrismLauncher.yml @@ -1,6 +1,6 @@ id: org.prismlauncher.PrismLauncher runtime: org.kde.Platform -runtime-version: "5.15-22.08" +runtime-version: "5.15-23.08" sdk: org.kde.Sdk sdk-extensions: - org.freedesktop.Sdk.Extension.openjdk17 @@ -113,6 +113,9 @@ modules: version-query: .tag_name url-query: .tarball_url timestamp-query: .published_at + # from https://github.com/flathub/net.gaijin.WarThunder/blob/7ea6f7a9f84b9c77150c003a7059dc03f8dcbc7f/gamemode.patch + - type: patch + path: patches/gamemode.patch cleanup: - /include - /lib/pkgconfig diff --git a/flatpak/patches/gamemode.patch b/flatpak/patches/gamemode.patch new file mode 100644 index 000000000..3cc0d7412 --- /dev/null +++ b/flatpak/patches/gamemode.patch @@ -0,0 +1,12 @@ +diff -ruN a/common/common-pidfds.c b/common/common-pidfds.c +--- a/common/common-pidfds.c 2021-02-18 20:00:12.000000000 +0100 ++++ b/common/common-pidfds.c 2023-09-07 08:57:42.954362763 +0200 +@@ -58,6 +58,8 @@ + { + return (int)syscall(__NR_pidfd_open, pid, flags); + } ++#else ++#include + #endif + + /* pidfd functions */ From d1c33392e7b7e59e7a76abec646aba9fcfa10d22 Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 22 Nov 2023 19:03:06 +0000 Subject: [PATCH 56/56] chore: disable x86_64-darwin in garnix this is currently broken on garnix's end, but hopefully we will be able to enable this again in the future Signed-off-by: seth Signed-off-by: Sefa Eyeoglu --- garnix.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/garnix.yaml b/garnix.yaml index 3bf145248..6cf8f7214 100644 --- a/garnix.yaml +++ b/garnix.yaml @@ -1,5 +1,6 @@ builds: - exclude: [] + exclude: + - "*.x86_64-darwin.*" include: - "checks.x86_64-linux.*" - "devShells.*.*"