From 4f3328e71cd6478513509d476de86378b8441586 Mon Sep 17 00:00:00 2001 From: kb1000 Date: Tue, 23 Mar 2021 21:54:48 +0100 Subject: [PATCH 01/10] NOISSUE disable datapacks button in the world screen if no world is selected --- application/pages/instance/WorldListPage.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/application/pages/instance/WorldListPage.cpp b/application/pages/instance/WorldListPage.cpp index d18c5355..119cff3e 100644 --- a/application/pages/instance/WorldListPage.cpp +++ b/application/pages/instance/WorldListPage.cpp @@ -314,6 +314,7 @@ void WorldListPage::worldChanged(const QModelIndex ¤t, const QModelIndex & ui->actionRemove->setEnabled(enable); ui->actionCopy->setEnabled(enable); ui->actionRename->setEnabled(enable); + ui->actionDatapacks->setEnabled(enable); bool hasIcon = !index.data(WorldList::IconFileRole).isNull(); ui->actionReset_Icon->setEnabled(enable && hasIcon); } From 9d7ba275ab52c63c3ab29a94c10e1eb9f0ae5a60 Mon Sep 17 00:00:00 2001 From: kb1000 Date: Tue, 23 Mar 2021 22:57:39 +0100 Subject: [PATCH 02/10] NOISSUE print information about whether the system GLFW or OpenAL workarounds are active to the instance log --- api/logic/minecraft/MinecraftInstance.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/api/logic/minecraft/MinecraftInstance.cpp b/api/logic/minecraft/MinecraftInstance.cpp index b0343316..37cdece7 100644 --- a/api/logic/minecraft/MinecraftInstance.cpp +++ b/api/logic/minecraft/MinecraftInstance.cpp @@ -526,11 +526,23 @@ QStringList MinecraftInstance::verboseDescription(AuthSessionPtr session) out << ""; } + auto settings = this->settings(); + bool nativeOpenAL = settings->get("UseNativeOpenAL").toBool(); + bool nativeGLFW = settings->get("UseNativeGLFW").toBool(); + if (nativeOpenAL || nativeGLFW) + { + if (nativeOpenAL) + out << "Using system OpenAL."; + if (nativeGLFW) + out << "Using system GLFW."; + out << ""; + } + // libraries and class path. { out << "Libraries:"; QStringList jars, nativeJars; - auto javaArchitecture = settings()->get("JavaArchitecture").toString(); + auto javaArchitecture = settings->get("JavaArchitecture").toString(); profile->getLibraryFiles(javaArchitecture, jars, nativeJars, getLocalLibraryPath(), binRoot()); auto printLibFile = [&](const QString & path) { @@ -616,14 +628,14 @@ QStringList MinecraftInstance::verboseDescription(AuthSessionPtr session) out << ""; QString windowParams; - if (settings()->get("LaunchMaximized").toBool()) + if (settings->get("LaunchMaximized").toBool()) { out << "Window size: max (if available)"; } else { - auto width = settings()->get("MinecraftWinWidth").toInt(); - auto height = settings()->get("MinecraftWinHeight").toInt(); + auto width = settings->get("MinecraftWinWidth").toInt(); + auto height = settings->get("MinecraftWinHeight").toInt(); out << "Window size: " + QString::number(width) + " x " + QString::number(height); } out << ""; From 7acad35c3f749771e26aaa32c658d8b42250ca0d Mon Sep 17 00:00:00 2001 From: kb1000 Date: Tue, 23 Mar 2021 23:05:10 +0100 Subject: [PATCH 03/10] NOISSUE fix MOC warning complaining about an unused MOC file include --- application/pages/instance/GameOptionsPage.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/application/pages/instance/GameOptionsPage.cpp b/application/pages/instance/GameOptionsPage.cpp index 5555fc79..782f2ab3 100644 --- a/application/pages/instance/GameOptionsPage.cpp +++ b/application/pages/instance/GameOptionsPage.cpp @@ -35,6 +35,3 @@ void GameOptionsPage::closedImpl() { // m_model->unobserve(); } - -#include "GameOptionsPage.moc" - From a0cb1a0d427087c84690224b37c2c9d0fba4f6cb Mon Sep 17 00:00:00 2001 From: kb1000 Date: Wed, 24 Mar 2021 00:59:43 +0100 Subject: [PATCH 04/10] NOISSUE rename Twitch to flame internally for consistency and to CurseForge for user displayed strings --- api/logic/Env.cpp | 2 +- application/CMakeLists.txt | 12 +-- application/dialogs/NewInstanceDialog.cpp | 8 +- application/dialogs/NewInstanceDialog.h | 4 +- .../TwitchData.h => flame/FlameData.h} | 4 +- .../TwitchModel.cpp => flame/FlameModel.cpp} | 18 ++--- .../TwitchModel.h => flame/FlameModel.h} | 5 +- .../TwitchPage.cpp => flame/FlamePage.cpp} | 36 ++++----- .../TwitchPage.h => flame/FlamePage.h} | 26 +++---- .../TwitchPage.ui => flame/FlamePage.ui} | 74 ++++++++++++------- application/resources/multimc/multimc.qrc | 5 +- .../resources/multimc/scalable/twitch.svg | 63 ---------------- 12 files changed, 106 insertions(+), 151 deletions(-) rename application/pages/modplatform/{twitch/TwitchData.h => flame/FlameData.h} (90%) rename application/pages/modplatform/{twitch/TwitchModel.cpp => flame/FlameModel.cpp} (92%) rename application/pages/modplatform/{twitch/TwitchModel.h => flame/FlameModel.h} (95%) rename application/pages/modplatform/{twitch/TwitchPage.cpp => flame/FlamePage.cpp} (69%) rename application/pages/modplatform/{twitch/TwitchPage.h => flame/FlamePage.h} (75%) rename application/pages/modplatform/{twitch/TwitchPage.ui => flame/FlamePage.ui} (62%) delete mode 100644 application/resources/multimc/scalable/twitch.svg diff --git a/api/logic/Env.cpp b/api/logic/Env.cpp index 42a1cff7..71b49d95 100644 --- a/api/logic/Env.cpp +++ b/api/logic/Env.cpp @@ -100,7 +100,7 @@ void Env::initHttpMetaCache() m_metacache->addBase("FTBPacks", QDir("cache/FTBPacks").absolutePath()); m_metacache->addBase("ModpacksCHPacks", QDir("cache/ModpacksCHPacks").absolutePath()); m_metacache->addBase("TechnicPacks", QDir("cache/TechnicPacks").absolutePath()); - m_metacache->addBase("TwitchPacks", QDir("cache/TwitchPacks").absolutePath()); + m_metacache->addBase("FlamePacks", QDir("cache/FlamePacks").absolutePath()); m_metacache->addBase("skins", QDir("accounts/skins").absolutePath()); m_metacache->addBase("root", QDir::currentPath()); m_metacache->addBase("translations", QDir("translations").absolutePath()); diff --git a/application/CMakeLists.txt b/application/CMakeLists.txt index a81327e3..afd13574 100644 --- a/application/CMakeLists.txt +++ b/application/CMakeLists.txt @@ -145,11 +145,11 @@ SET(MULTIMC_SOURCES pages/modplatform/legacy_ftb/ListModel.h pages/modplatform/legacy_ftb/ListModel.cpp - pages/modplatform/twitch/TwitchData.h - pages/modplatform/twitch/TwitchModel.cpp - pages/modplatform/twitch/TwitchModel.h - pages/modplatform/twitch/TwitchPage.cpp - pages/modplatform/twitch/TwitchPage.h + pages/modplatform/flame/FlameData.h + pages/modplatform/flame/FlameModel.cpp + pages/modplatform/flame/FlameModel.h + pages/modplatform/flame/FlamePage.cpp + pages/modplatform/flame/FlamePage.h pages/modplatform/technic/TechnicModel.cpp pages/modplatform/technic/TechnicModel.h @@ -276,7 +276,7 @@ SET(MULTIMC_UIS pages/modplatform/atlauncher/AtlPage.ui pages/modplatform/ftb/FtbPage.ui pages/modplatform/legacy_ftb/Page.ui - pages/modplatform/twitch/TwitchPage.ui + pages/modplatform/flame/FlamePage.ui pages/modplatform/technic/TechnicPage.ui pages/modplatform/ImportPage.ui diff --git a/application/dialogs/NewInstanceDialog.cpp b/application/dialogs/NewInstanceDialog.cpp index d70cbffe..112e46ff 100644 --- a/application/dialogs/NewInstanceDialog.cpp +++ b/application/dialogs/NewInstanceDialog.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include @@ -124,17 +124,17 @@ void NewInstanceDialog::accept() QList NewInstanceDialog::getPages() { importPage = new ImportPage(this); - twitchPage = new TwitchPage(this); + flamePage = new FlamePage(this); auto technicPage = new TechnicPage(this); return { new VanillaPage(this), importPage, new AtlPage(this), + flamePage, new FtbPage(this), new LegacyFTB::Page(this), - technicPage, - twitchPage + technicPage }; } diff --git a/application/dialogs/NewInstanceDialog.h b/application/dialogs/NewInstanceDialog.h index 88ed00e5..f8d96dbf 100644 --- a/application/dialogs/NewInstanceDialog.h +++ b/application/dialogs/NewInstanceDialog.h @@ -29,7 +29,7 @@ class NewInstanceDialog; class PageContainer; class QDialogButtonBox; class ImportPage; -class TwitchPage; +class FlamePage; class NewInstanceDialog : public QDialog, public BasePageProvider { @@ -68,7 +68,7 @@ private: QString InstIconKey; ImportPage *importPage = nullptr; - TwitchPage *twitchPage = nullptr; + FlamePage *flamePage = nullptr; std::unique_ptr creationTask; bool importIcon = false; diff --git a/application/pages/modplatform/twitch/TwitchData.h b/application/pages/modplatform/flame/FlameData.h similarity index 90% rename from application/pages/modplatform/twitch/TwitchData.h rename to application/pages/modplatform/flame/FlameData.h index dd000b84..9245ba8a 100644 --- a/application/pages/modplatform/twitch/TwitchData.h +++ b/application/pages/modplatform/flame/FlameData.h @@ -3,7 +3,7 @@ #include #include -namespace Twitch { +namespace Flame { struct ModpackAuthor { QString name; @@ -35,4 +35,4 @@ struct Modpack }; } -Q_DECLARE_METATYPE(Twitch::Modpack) +Q_DECLARE_METATYPE(Flame::Modpack) diff --git a/application/pages/modplatform/twitch/TwitchModel.cpp b/application/pages/modplatform/flame/FlameModel.cpp similarity index 92% rename from application/pages/modplatform/twitch/TwitchModel.cpp rename to application/pages/modplatform/flame/FlameModel.cpp index 5c6c7858..cd3109e0 100644 --- a/application/pages/modplatform/twitch/TwitchModel.cpp +++ b/application/pages/modplatform/flame/FlameModel.cpp @@ -1,4 +1,4 @@ -#include "TwitchModel.h" +#include "FlameModel.h" #include "MultiMC.h" #include @@ -10,7 +10,7 @@ #include #include -namespace Twitch { +namespace Flame { ListModel::ListModel(QObject *parent) : QAbstractListModel(parent) { @@ -99,8 +99,8 @@ void ListModel::requestLogo(QString logo, QString url) return; } - MetaEntryPtr entry = ENV.metacache()->resolveEntry("TwitchPacks", QString("logos/%1").arg(logo.section(".", 0, 0))); - NetJob *job = new NetJob(QString("Twitch Icon Download %1").arg(logo)); + MetaEntryPtr entry = ENV.metacache()->resolveEntry("FlamePacks", QString("logos/%1").arg(logo.section(".", 0, 0))); + NetJob *job = new NetJob(QString("Flame Icon Download %1").arg(logo)); job->addNetAction(Net::Download::makeCached(QUrl(url), entry)); auto fullPath = entry->getFullPath(); @@ -127,7 +127,7 @@ void ListModel::getLogo(const QString &logo, const QString &logoUrl, LogoCallbac { if(m_logoMap.contains(logo)) { - callback(ENV.metacache()->resolveEntry("TwitchPacks", QString("logos/%1").arg(logo.section(".", 0, 0)))->getFullPath()); + callback(ENV.metacache()->resolveEntry("FlamePacks", QString("logos/%1").arg(logo.section(".", 0, 0)))->getFullPath()); } else { @@ -158,7 +158,7 @@ void ListModel::fetchMore(const QModelIndex& parent) void ListModel::performPaginatedSearch() { - NetJob *netJob = new NetJob("Twitch::Search"); + NetJob *netJob = new NetJob("Flame::Search"); auto searchUrl = QString( "https://addons-ecs.forgesvc.net/api/v2/addon/search?" "categoryId=0&" @@ -198,14 +198,14 @@ void ListModel::searchWithTerm(const QString& term) performPaginatedSearch(); } -void Twitch::ListModel::searchRequestFinished() +void Flame::ListModel::searchRequestFinished() { jobPtr.reset(); QJsonParseError parse_error; QJsonDocument doc = QJsonDocument::fromJson(response, &parse_error); if(parse_error.error != QJsonParseError::NoError) { - qWarning() << "Error while parsing JSON response from Twitch at " << parse_error.offset << " reason: " << parse_error.errorString(); + qWarning() << "Error while parsing JSON response from CurseForge at " << parse_error.offset << " reason: " << parse_error.errorString(); qWarning() << response; return; } @@ -292,7 +292,7 @@ void Twitch::ListModel::searchRequestFinished() endInsertRows(); } -void Twitch::ListModel::searchRequestFailed(QString reason) +void Flame::ListModel::searchRequestFailed(QString reason) { jobPtr.reset(); diff --git a/application/pages/modplatform/twitch/TwitchModel.h b/application/pages/modplatform/flame/FlameModel.h similarity index 95% rename from application/pages/modplatform/twitch/TwitchModel.h rename to application/pages/modplatform/flame/FlameModel.h index ad355c64..b4dded76 100644 --- a/application/pages/modplatform/twitch/TwitchModel.h +++ b/application/pages/modplatform/flame/FlameModel.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include @@ -16,9 +15,9 @@ #include #include -#include "TwitchData.h" +#include "FlameData.h" -namespace Twitch { +namespace Flame { typedef QMap LogoMap; diff --git a/application/pages/modplatform/twitch/TwitchPage.cpp b/application/pages/modplatform/flame/FlamePage.cpp similarity index 69% rename from application/pages/modplatform/twitch/TwitchPage.cpp rename to application/pages/modplatform/flame/FlamePage.cpp index 1e9f9dbb..3889f15a 100644 --- a/application/pages/modplatform/twitch/TwitchPage.cpp +++ b/application/pages/modplatform/flame/FlamePage.cpp @@ -1,29 +1,29 @@ -#include "TwitchPage.h" -#include "ui_TwitchPage.h" +#include "FlamePage.h" +#include "ui_FlamePage.h" #include "MultiMC.h" #include "dialogs/NewInstanceDialog.h" #include -#include "TwitchModel.h" +#include "FlameModel.h" #include -TwitchPage::TwitchPage(NewInstanceDialog* dialog, QWidget *parent) - : QWidget(parent), ui(new Ui::TwitchPage), dialog(dialog) +FlamePage::FlamePage(NewInstanceDialog* dialog, QWidget *parent) + : QWidget(parent), ui(new Ui::FlamePage), dialog(dialog) { ui->setupUi(this); - connect(ui->searchButton, &QPushButton::clicked, this, &TwitchPage::triggerSearch); + connect(ui->searchButton, &QPushButton::clicked, this, &FlamePage::triggerSearch); ui->searchEdit->installEventFilter(this); - model = new Twitch::ListModel(this); + model = new Flame::ListModel(this); ui->packView->setModel(model); - connect(ui->packView->selectionModel(), &QItemSelectionModel::currentChanged, this, &TwitchPage::onSelectionChanged); + connect(ui->packView->selectionModel(), &QItemSelectionModel::currentChanged, this, &FlamePage::onSelectionChanged); } -TwitchPage::~TwitchPage() +FlamePage::~FlamePage() { delete ui; } -bool TwitchPage::eventFilter(QObject* watched, QEvent* event) +bool FlamePage::eventFilter(QObject* watched, QEvent* event) { if (watched == ui->searchEdit && event->type() == QEvent::KeyPress) { QKeyEvent* keyEvent = static_cast(event); @@ -36,22 +36,22 @@ bool TwitchPage::eventFilter(QObject* watched, QEvent* event) return QWidget::eventFilter(watched, event); } -bool TwitchPage::shouldDisplay() const +bool FlamePage::shouldDisplay() const { return true; } -void TwitchPage::openedImpl() +void FlamePage::openedImpl() { suggestCurrent(); } -void TwitchPage::triggerSearch() +void FlamePage::triggerSearch() { model->searchWithTerm(ui->searchEdit->text()); } -void TwitchPage::onSelectionChanged(QModelIndex first, QModelIndex second) +void FlamePage::onSelectionChanged(QModelIndex first, QModelIndex second) { if(!first.isValid()) { @@ -63,7 +63,7 @@ void TwitchPage::onSelectionChanged(QModelIndex first, QModelIndex second) return; } - current = model->data(first, Qt::UserRole).value(); + current = model->data(first, Qt::UserRole).value(); QString text = ""; QString name = current.name; @@ -72,7 +72,7 @@ void TwitchPage::onSelectionChanged(QModelIndex first, QModelIndex second) else text = "" + name + ""; if (!current.authors.empty()) { - auto authorToStr = [](Twitch::ModpackAuthor & author) { + auto authorToStr = [](Flame::ModpackAuthor & author) { if(author.url.isEmpty()) { return author.name; } @@ -90,7 +90,7 @@ void TwitchPage::onSelectionChanged(QModelIndex first, QModelIndex second) suggestCurrent(); } -void TwitchPage::suggestCurrent() +void FlamePage::suggestCurrent() { if(!isOpened) { @@ -103,7 +103,7 @@ void TwitchPage::suggestCurrent() dialog->setSuggestedPack(current.name, new InstanceImportTask(current.latestFile.downloadUrl)); QString editedLogoName; - editedLogoName = "twitch_" + current.logoName.section(".", 0, 0); + editedLogoName = "curseforge_" + current.logoName.section(".", 0, 0); model->getLogo(current.logoName, current.logoUrl, [this, editedLogoName](QString logo) { dialog->setSuggestedIconFromFile(logo, editedLogoName); diff --git a/application/pages/modplatform/twitch/TwitchPage.h b/application/pages/modplatform/flame/FlamePage.h similarity index 75% rename from application/pages/modplatform/twitch/TwitchPage.h rename to application/pages/modplatform/flame/FlamePage.h index 093900ff..e50186f5 100644 --- a/application/pages/modplatform/twitch/TwitchPage.h +++ b/application/pages/modplatform/flame/FlamePage.h @@ -20,41 +20,41 @@ #include "pages/BasePage.h" #include #include "tasks/Task.h" -#include "TwitchData.h" +#include "FlameData.h" namespace Ui { -class TwitchPage; +class FlamePage; } class NewInstanceDialog; -namespace Twitch { +namespace Flame { class ListModel; } -class TwitchPage : public QWidget, public BasePage +class FlamePage : public QWidget, public BasePage { Q_OBJECT public: - explicit TwitchPage(NewInstanceDialog* dialog, QWidget *parent = 0); - virtual ~TwitchPage(); + explicit FlamePage(NewInstanceDialog* dialog, QWidget *parent = 0); + virtual ~FlamePage(); virtual QString displayName() const override { - return tr("Twitch"); + return tr("CurseForge"); } virtual QIcon icon() const override { - return MMC->getThemedIcon("twitch"); + return MMC->getThemedIcon("flame"); } virtual QString id() const override { - return "twitch"; + return "flame"; } virtual QString helpPage() const override { - return "Twitch-platform"; + return "Flame-platform"; } virtual bool shouldDisplay() const override; @@ -70,8 +70,8 @@ private slots: void onSelectionChanged(QModelIndex first, QModelIndex second); private: - Ui::TwitchPage *ui = nullptr; + Ui::FlamePage *ui = nullptr; NewInstanceDialog* dialog = nullptr; - Twitch::ListModel* model = nullptr; - Twitch::Modpack current; + Flame::ListModel* model = nullptr; + Flame::Modpack current; }; diff --git a/application/pages/modplatform/twitch/TwitchPage.ui b/application/pages/modplatform/flame/FlamePage.ui similarity index 62% rename from application/pages/modplatform/twitch/TwitchPage.ui rename to application/pages/modplatform/flame/FlamePage.ui index c78d8ce0..21e23f1f 100644 --- a/application/pages/modplatform/twitch/TwitchPage.ui +++ b/application/pages/modplatform/flame/FlamePage.ui @@ -1,7 +1,7 @@ - TwitchPage - + FlamePage + 0 @@ -10,34 +10,36 @@ 745 - - - - - - - - Search - + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Search + + + + - - - - - 0 - 0 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - + Qt::ScrollBarAlwaysOff @@ -53,6 +55,22 @@ + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + diff --git a/application/resources/multimc/multimc.qrc b/application/resources/multimc/multimc.qrc index 4e95869e..249e8e28 100644 --- a/application/resources/multimc/multimc.qrc +++ b/application/resources/multimc/multimc.qrc @@ -11,8 +11,9 @@ scalable/reddit-alien.svg - - scalable/twitch.svg + + 32x32/instances/flame.png + 128x128/instances/flame.png scalable/technic.svg diff --git a/application/resources/multimc/scalable/twitch.svg b/application/resources/multimc/scalable/twitch.svg deleted file mode 100644 index 80999380..00000000 --- a/application/resources/multimc/scalable/twitch.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - image/svg+xml - - Glitch - - - - - - - - Glitch - - From b8ee9a2a8e30dcdc6e8ec0b4343c427d616c6110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Fri, 26 Mar 2021 01:46:23 +0100 Subject: [PATCH 05/10] NOISSUE update ubuntu packaging bits --- application/package/ubuntu/README.md | 4 ++-- application/package/ubuntu/multimc/DEBIAN/control | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/package/ubuntu/README.md b/application/package/ubuntu/README.md index 5c0f4eeb..892abd12 100644 --- a/application/package/ubuntu/README.md +++ b/application/package/ubuntu/README.md @@ -6,9 +6,9 @@ It contains a `.desktop` file, an icon, and a simple script that does the heavy This is also the source for the files in the [RPM package](../rpm). If you rename, create or delete files here, you'll likely also have to update the RPM spec file there. # How to build this? -You need dpkg utils. Rename the `multimc` folder to `multimc_1.3-1` and then run: +You need dpkg utils. Rename the `multimc` folder to `multimc_1.5-1` and then run: ``` -fakeroot dpkg-deb --build multimc_1.3-1 +fakeroot dpkg-deb --build multimc_1.5-1 ``` Replace the version with whatever is appropriate. diff --git a/application/package/ubuntu/multimc/DEBIAN/control b/application/package/ubuntu/multimc/DEBIAN/control index 509dfe3c..3e0f570c 100644 --- a/application/package/ubuntu/multimc/DEBIAN/control +++ b/application/package/ubuntu/multimc/DEBIAN/control @@ -1,5 +1,5 @@ Package: multimc -Version: 1.4-1 +Version: 1.5-1 Architecture: all Maintainer: Petr Mrázek Section: games From 73af0f271adba6a4165e0ed36c9ae436f849f9c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Fri, 26 Mar 2021 01:47:19 +0100 Subject: [PATCH 06/10] NOISSUE fix build - missing includes in RWStorage.h --- api/logic/RWStorage.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/logic/RWStorage.h b/api/logic/RWStorage.h index 5d792367..3028388e 100644 --- a/api/logic/RWStorage.h +++ b/api/logic/RWStorage.h @@ -1,6 +1,9 @@ #pragma once #include #include +#include +#include + template class RWStorage { From ba13e33ccc5e86d3dfdcca34595309479727fa53 Mon Sep 17 00:00:00 2001 From: phit <2097483+phit@users.noreply.github.com> Date: Wed, 24 Mar 2021 19:44:26 +0100 Subject: [PATCH 07/10] GH-3633 assume latest MC version, if CurseForge pack supports multiple right now these are unused anyway --- application/pages/modplatform/flame/FlameModel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/pages/modplatform/flame/FlameModel.cpp b/application/pages/modplatform/flame/FlameModel.cpp index cd3109e0..6d9dbda7 100644 --- a/application/pages/modplatform/flame/FlameModel.cpp +++ b/application/pages/modplatform/flame/FlameModel.cpp @@ -263,11 +263,12 @@ void Flame::ListModel::searchRequestFinished() } pack.latestFile.addonId = pack.addonId; pack.latestFile.fileId = id; - // FIXME: what to do when there's more than one, or there's no version? auto versionArray = file.value("gameVersion").toArray(); - if(versionArray.size() != 1) { + if(versionArray.size() < 1) { continue; } + + // pick the latest version supported pack.latestFile.mcVersion = versionArray[0].toString(); pack.latestFile.version = file.value("displayName").toString(); pack.latestFile.downloadUrl = file.value("downloadUrl").toString(); From 34bf68847998cdfff1360d6ed04339d36894c00d Mon Sep 17 00:00:00 2001 From: KGB-8375 <60853993+KGB-8375@users.noreply.github.com> Date: Wed, 24 Mar 2021 13:36:48 -0400 Subject: [PATCH 08/10] GH-3666 Fix multi-monitor dpi scaling on windows Disable qt 5.6 DPI scaling and use windows' builtin DPI scaling, which works much better on multi-monitor setups --- application/main.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/application/main.cpp b/application/main.cpp index b0360c7e..e29f3453 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -4,6 +4,10 @@ #include #include +#ifdef Q_OS_WIN + #include +#endif + // #define BREAK_INFINITE_LOOP // #define BREAK_EXCEPTION // #define BREAK_RETURN @@ -29,7 +33,19 @@ int main(int argc, char *argv[]) #endif #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + #ifdef Q_OS_WIN + BOOL (__stdcall *pFn)(void); + HINSTANCE hInstance=LoadLibrary("user32.dll"); + if(hInstance) { + pFn = (BOOL (__stdcall*)(void))GetProcAddress(hInstance, "SetProcessDPIAware"); + if(pFn) + pFn(); + FreeLibrary(hInstance); + } + QApplication::setAttribute(Qt::AA_DisableHighDpiScaling); + #else + QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + #endif QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); #endif From 8e6400e8d8c3a2ec1b734c4405b27dd2b547a835 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Fri, 26 Mar 2021 20:03:57 +0000 Subject: [PATCH 09/10] NOISSUE Fix edgecase where new searches won't be processed This resolves an issue with the modpacks.ch search functionality, in which a search issued while one is currently in progress won't be made and the UI won't allow for the search to be made after. Reproduction Steps: 1. Open the FTB pane in the Add Instance Dialog 2. Perform a search while MMC is still performing the initial search The search won't be performed, the existing search will have been aborted, and you are unable to try the search again (without trying a different search in the meantime). This was caused by 2 things: 1. A search cannot be re-attempted, and this logic doesn't consider failures. 2. The failure slot wasn't called when the NetJob was aborted, so the search would never be performed - but the term would be stored as if it had (trigering point 1). I have resolved this by doing 2 things: 1. If the failure slot is called, set a searchState of Failed. Allow search re-attempts in this case. 2. If there is a present NetJob, abort and reset it. The immediately continue with the search. --- .../pages/modplatform/ftb/FtbListModel.cpp | 29 +++++++------------ .../pages/modplatform/ftb/FtbListModel.h | 3 +- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/application/pages/modplatform/ftb/FtbListModel.cpp b/application/pages/modplatform/ftb/FtbListModel.cpp index 63236827..98973f2e 100644 --- a/application/pages/modplatform/ftb/FtbListModel.cpp +++ b/application/pages/modplatform/ftb/FtbListModel.cpp @@ -106,21 +106,22 @@ void ListModel::getLogo(const QString &logo, const QString &logoUrl, LogoCallbac void ListModel::searchWithTerm(const QString &term) { - if(currentSearchTerm == term && currentSearchTerm.isNull() == term.isNull()) { + if(searchState != Failed && currentSearchTerm == term && currentSearchTerm.isNull() == term.isNull()) { + // unless the search has failed, then there is no need to perform an identical search. return; } currentSearchTerm = term; + if(jobPtr) { jobPtr->abort(); - searchState = ResetRequested; - return; - } - else { - beginResetModel(); - modpacks.clear(); - endResetModel(); - searchState = None; + jobPtr.reset(); } + + beginResetModel(); + modpacks.clear(); + endResetModel(); + searchState = None; + performSearch(); } @@ -154,15 +155,7 @@ void ListModel::searchRequestFailed(QString reason) jobPtr.reset(); remainingPacks.clear(); - if(searchState == ResetRequested) { - beginResetModel(); - modpacks.clear(); - endResetModel(); - - performSearch(); - } else { - searchState = Finished; - } + searchState = Failed; } void ListModel::requestPack() diff --git a/application/pages/modplatform/ftb/FtbListModel.h b/application/pages/modplatform/ftb/FtbListModel.h index 9c057d73..de94e6ba 100644 --- a/application/pages/modplatform/ftb/FtbListModel.h +++ b/application/pages/modplatform/ftb/FtbListModel.h @@ -57,7 +57,8 @@ private: None, CanPossiblyFetchMore, ResetRequested, - Finished + Finished, + Failed, } searchState = None; NetJobPtr jobPtr; int currentPack; From 43cf647642e448eab755c2df310d0b029ac66b44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 28 Mar 2021 19:46:01 +0200 Subject: [PATCH 10/10] Revert "GH-3666 Fix multi-monitor dpi scaling on windows" This reverts commit 34bf68847998cdfff1360d6ed04339d36894c00d. --- application/main.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/application/main.cpp b/application/main.cpp index e29f3453..b0360c7e 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -4,10 +4,6 @@ #include #include -#ifdef Q_OS_WIN - #include -#endif - // #define BREAK_INFINITE_LOOP // #define BREAK_EXCEPTION // #define BREAK_RETURN @@ -33,19 +29,7 @@ int main(int argc, char *argv[]) #endif #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) - #ifdef Q_OS_WIN - BOOL (__stdcall *pFn)(void); - HINSTANCE hInstance=LoadLibrary("user32.dll"); - if(hInstance) { - pFn = (BOOL (__stdcall*)(void))GetProcAddress(hInstance, "SetProcessDPIAware"); - if(pFn) - pFn(); - FreeLibrary(hInstance); - } - QApplication::setAttribute(Qt::AA_DisableHighDpiScaling); - #else - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - #endif + QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); #endif