aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.yml4
-rw-r--r--launcher/pages/modplatform/atlauncher/AtlPage.cpp6
-rw-r--r--launcher/pages/modplatform/atlauncher/AtlPage.h1
-rw-r--r--launcher/pages/modplatform/atlauncher/AtlPage.ui17
-rw-r--r--launcher/pages/modplatform/ftb/FtbFilterModel.cpp14
-rw-r--r--launcher/pages/modplatform/ftb/FtbFilterModel.h2
-rw-r--r--launcher/pages/modplatform/ftb/FtbListModel.cpp47
-rw-r--r--launcher/pages/modplatform/ftb/FtbListModel.h16
-rw-r--r--launcher/pages/modplatform/ftb/FtbPage.cpp11
-rw-r--r--launcher/pages/modplatform/ftb/FtbPage.h3
-rw-r--r--launcher/pages/modplatform/ftb/FtbPage.ui15
-rw-r--r--launcher/translations/TranslationsModel.cpp2
-rw-r--r--libraries/README.md57
-rw-r--r--secrets/multimc.rc29
14 files changed, 94 insertions, 130 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index 5b8d858e..72986e94 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -8,9 +8,9 @@ body:
If you need help with running Minecraft, please visit us [on our Discord](https://discord.gg/multimc) before making a bug report.
Before submitting a bug report, please make sure you have read this *entire* form, and that:
- * You have read the [FAQ](https://github.com/MultiMC/MultiMC5/wiki/FAQ) and it has not answered your question
+ * You have read the [FAQ](https://github.com/MultiMC/Launcher/wiki/FAQ) and it has not answered your question
* Your bug is not caused by Minecraft or any mods you have installed.
- * Your issue has not been reported before, [make sure to use the search function!](https://github.com/MultiMC/MultiMC5/issues)
+ * Your issue has not been reported before, [make sure to use the search function!](https://github.com/MultiMC/Launcher/issues)
**Do not forget to give your issue a descriptive title.** "Bug in the instance screen" makes it hard to distinguish issues at a glance.
- type: dropdown
diff --git a/launcher/pages/modplatform/atlauncher/AtlPage.cpp b/launcher/pages/modplatform/atlauncher/AtlPage.cpp
index e59e5fe1..0367bc48 100644
--- a/launcher/pages/modplatform/atlauncher/AtlPage.cpp
+++ b/launcher/pages/modplatform/atlauncher/AtlPage.cpp
@@ -31,7 +31,6 @@ AtlPage::AtlPage(NewInstanceDialog* dialog, QWidget *parent)
ui->sortByBox->setCurrentText(filterModel->translateCurrentSorting());
connect(ui->searchEdit, &QLineEdit::textChanged, this, &AtlPage::triggerSearch);
- connect(ui->resetButton, &QPushButton::clicked, this, &AtlPage::resetSearch);
connect(ui->sortByBox, &QComboBox::currentTextChanged, this, &AtlPage::onSortingSelectionChanged);
connect(ui->packView->selectionModel(), &QItemSelectionModel::currentChanged, this, &AtlPage::onSelectionChanged);
connect(ui->versionSelectionBox, &QComboBox::currentTextChanged, this, &AtlPage::onVersionSelectionChanged);
@@ -85,11 +84,6 @@ void AtlPage::triggerSearch()
filterModel->setSearchTerm(ui->searchEdit->text());
}
-void AtlPage::resetSearch()
-{
- ui->searchEdit->setText("");
-}
-
void AtlPage::onSortingSelectionChanged(QString data)
{
auto toSet = filterModel->getAvailableSortings().value(data);
diff --git a/launcher/pages/modplatform/atlauncher/AtlPage.h b/launcher/pages/modplatform/atlauncher/AtlPage.h
index ed872053..84c40656 100644
--- a/launcher/pages/modplatform/atlauncher/AtlPage.h
+++ b/launcher/pages/modplatform/atlauncher/AtlPage.h
@@ -67,7 +67,6 @@ private:
private slots:
void triggerSearch();
- void resetSearch();
void onSortingSelectionChanged(QString data);
diff --git a/launcher/pages/modplatform/atlauncher/AtlPage.ui b/launcher/pages/modplatform/atlauncher/AtlPage.ui
index f16c24b8..9085766a 100644
--- a/launcher/pages/modplatform/atlauncher/AtlPage.ui
+++ b/launcher/pages/modplatform/atlauncher/AtlPage.ui
@@ -15,15 +15,15 @@
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="0">
<widget class="QTreeView" name="packView">
+ <property name="alternatingRowColors">
+ <bool>true</bool>
+ </property>
<property name="iconSize">
<size>
<width>96</width>
<height>48</height>
</size>
</property>
- <property name="alternatingRowColors">
- <bool>true</bool>
- </property>
</widget>
</item>
<item row="1" column="1">
@@ -68,25 +68,20 @@
</item>
</layout>
</item>
- <item row="0" column="1">
- <widget class="QPushButton" name="resetButton">
- <property name="text">
- <string>Reset</string>
- </property>
- </widget>
- </item>
<item row="0" column="0">
<widget class="QLineEdit" name="searchEdit">
<property name="placeholderText">
<string>Search and filter ...</string>
</property>
+ <property name="clearButtonEnabled">
+ <bool>true</bool>
+ </property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>searchEdit</tabstop>
- <tabstop>resetButton</tabstop>
<tabstop>packView</tabstop>
<tabstop>packDescription</tabstop>
<tabstop>sortByBox</tabstop>
diff --git a/launcher/pages/modplatform/ftb/FtbFilterModel.cpp b/launcher/pages/modplatform/ftb/FtbFilterModel.cpp
index dec3a017..793b8769 100644
--- a/launcher/pages/modplatform/ftb/FtbFilterModel.cpp
+++ b/launcher/pages/modplatform/ftb/FtbFilterModel.cpp
@@ -36,9 +36,21 @@ FilterModel::Sorting FilterModel::getCurrentSorting()
return currentSorting;
}
+void FilterModel::setSearchTerm(const QString& term)
+{
+ searchTerm = term.trimmed();
+ invalidate();
+}
+
bool FilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
{
- return true;
+ if (searchTerm.isEmpty()) {
+ return true;
+ }
+
+ auto index = sourceModel()->index(sourceRow, 0, sourceParent);
+ auto pack = sourceModel()->data(index, Qt::UserRole).value<ModpacksCH::Modpack>();
+ return pack.name.contains(searchTerm, Qt::CaseInsensitive);
}
bool FilterModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
diff --git a/launcher/pages/modplatform/ftb/FtbFilterModel.h b/launcher/pages/modplatform/ftb/FtbFilterModel.h
index 4fe2a274..2e712c7d 100644
--- a/launcher/pages/modplatform/ftb/FtbFilterModel.h
+++ b/launcher/pages/modplatform/ftb/FtbFilterModel.h
@@ -19,6 +19,7 @@ public:
QString translateCurrentSorting();
void setSorting(Sorting sorting);
Sorting getCurrentSorting();
+ void setSearchTerm(const QString& term);
protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
@@ -27,6 +28,7 @@ protected:
private:
QMap<QString, Sorting> sortings;
Sorting currentSorting;
+ QString searchTerm { "" };
};
diff --git a/launcher/pages/modplatform/ftb/FtbListModel.cpp b/launcher/pages/modplatform/ftb/FtbListModel.cpp
index 7da4c066..c4c2c83e 100644
--- a/launcher/pages/modplatform/ftb/FtbListModel.cpp
+++ b/launcher/pages/modplatform/ftb/FtbListModel.cpp
@@ -74,24 +74,6 @@ QVariant ListModel::data(const QModelIndex &index, int role) const
return QVariant();
}
-void ListModel::performSearch()
-{
- auto *netJob = new NetJob("Ftb::Search");
- QString searchUrl;
- if(currentSearchTerm.isEmpty()) {
- searchUrl = BuildConfig.MODPACKSCH_API_BASE_URL + "public/modpack/all";
- }
- else {
- searchUrl = QString(BuildConfig.MODPACKSCH_API_BASE_URL + "public/modpack/search/25?term=%1")
- .arg(currentSearchTerm);
- }
- netJob->addNetAction(Net::Download::makeByteArray(QUrl(searchUrl), &response));
- jobPtr = netJob;
- jobPtr->start();
- QObject::connect(netJob, &NetJob::succeeded, this, &ListModel::searchRequestFinished);
- QObject::connect(netJob, &NetJob::failed, this, &ListModel::searchRequestFailed);
-}
-
void ListModel::getLogo(const QString &logo, const QString &logoUrl, LogoCallback callback)
{
if(m_logoMap.contains(logo))
@@ -104,28 +86,23 @@ void ListModel::getLogo(const QString &logo, const QString &logoUrl, LogoCallbac
}
}
-void ListModel::searchWithTerm(const QString &term)
+void ListModel::request()
{
- 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();
- jobPtr.reset();
- }
-
beginResetModel();
modpacks.clear();
endResetModel();
- searchState = None;
- performSearch();
+ auto *netJob = new NetJob("Ftb::Request");
+ auto url = QString(BuildConfig.MODPACKSCH_API_BASE_URL + "public/modpack/all");
+ netJob->addNetAction(Net::Download::makeByteArray(QUrl(url), &response));
+ jobPtr = netJob;
+ jobPtr->start();
+
+ QObject::connect(netJob, &NetJob::succeeded, this, &ListModel::requestFinished);
+ QObject::connect(netJob, &NetJob::failed, this, &ListModel::requestFailed);
}
-void ListModel::searchRequestFinished()
+void ListModel::requestFinished()
{
jobPtr.reset();
remainingPacks.clear();
@@ -150,12 +127,10 @@ void ListModel::searchRequestFinished()
}
}
-void ListModel::searchRequestFailed(QString reason)
+void ListModel::requestFailed(QString reason)
{
jobPtr.reset();
remainingPacks.clear();
-
- searchState = Failed;
}
void ListModel::requestPack()
diff --git a/launcher/pages/modplatform/ftb/FtbListModel.h b/launcher/pages/modplatform/ftb/FtbListModel.h
index de94e6ba..2d6e91da 100644
--- a/launcher/pages/modplatform/ftb/FtbListModel.h
+++ b/launcher/pages/modplatform/ftb/FtbListModel.h
@@ -30,13 +30,13 @@ public:
int columnCount(const QModelIndex &parent) const override;
QVariant data(const QModelIndex &index, int role) const override;
+ void request();
+
void getLogo(const QString &logo, const QString &logoUrl, LogoCallback callback);
- void searchWithTerm(const QString & term);
private slots:
- void performSearch();
- void searchRequestFinished();
- void searchRequestFailed(QString reason);
+ void requestFinished();
+ void requestFailed(QString reason);
void requestPack();
void packRequestFinished();
@@ -52,14 +52,6 @@ private:
QList<ModpacksCH::Modpack> modpacks;
LogoMap m_logoMap;
- QString currentSearchTerm;
- enum SearchState {
- None,
- CanPossiblyFetchMore,
- ResetRequested,
- Finished,
- Failed,
- } searchState = None;
NetJobPtr jobPtr;
int currentPack;
QList<int> remainingPacks;
diff --git a/launcher/pages/modplatform/ftb/FtbPage.cpp b/launcher/pages/modplatform/ftb/FtbPage.cpp
index b7f35c5d..bafcfac9 100644
--- a/launcher/pages/modplatform/ftb/FtbPage.cpp
+++ b/launcher/pages/modplatform/ftb/FtbPage.cpp
@@ -32,7 +32,7 @@ FtbPage::FtbPage(NewInstanceDialog* dialog, QWidget *parent)
}
ui->sortByBox->setCurrentText(filterModel->translateCurrentSorting());
- connect(ui->searchButton, &QPushButton::clicked, this, &FtbPage::triggerSearch);
+ connect(ui->searchEdit, &QLineEdit::textChanged, this, &FtbPage::triggerSearch);
connect(ui->sortByBox, &QComboBox::currentTextChanged, this, &FtbPage::onSortingSelectionChanged);
connect(ui->packView->selectionModel(), &QItemSelectionModel::currentChanged, this, &FtbPage::onSelectionChanged);
connect(ui->versionSelectionBox, &QComboBox::currentTextChanged, this, &FtbPage::onVersionSelectionChanged);
@@ -63,7 +63,12 @@ bool FtbPage::shouldDisplay() const
void FtbPage::openedImpl()
{
- triggerSearch();
+ if(!initialised)
+ {
+ listModel->request();
+ initialised = true;
+ }
+
suggestCurrent();
}
@@ -96,7 +101,7 @@ void FtbPage::suggestCurrent()
void FtbPage::triggerSearch()
{
- listModel->searchWithTerm(ui->searchEdit->text());
+ filterModel->setSearchTerm(ui->searchEdit->text());
}
void FtbPage::onSortingSelectionChanged(QString data)
diff --git a/launcher/pages/modplatform/ftb/FtbPage.h b/launcher/pages/modplatform/ftb/FtbPage.h
index da121913..0a4a6cea 100644
--- a/launcher/pages/modplatform/ftb/FtbPage.h
+++ b/launcher/pages/modplatform/ftb/FtbPage.h
@@ -65,6 +65,7 @@ private:
private slots:
void triggerSearch();
+
void onSortingSelectionChanged(QString data);
void onSelectionChanged(QModelIndex first, QModelIndex second);
void onVersionSelectionChanged(QString data);
@@ -77,4 +78,6 @@ private:
ModpacksCH::Modpack selected;
QString selectedVersion;
+
+ bool initialised { false };
};
diff --git a/launcher/pages/modplatform/ftb/FtbPage.ui b/launcher/pages/modplatform/ftb/FtbPage.ui
index 135afc6d..e9c783e3 100644
--- a/launcher/pages/modplatform/ftb/FtbPage.ui
+++ b/launcher/pages/modplatform/ftb/FtbPage.ui
@@ -36,12 +36,8 @@
<property name="placeholderText">
<string>Search and filter ...</string>
</property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QPushButton" name="searchButton">
- <property name="text">
- <string>Search</string>
+ <property name="clearButtonEnabled">
+ <bool>true</bool>
</property>
</widget>
</item>
@@ -49,15 +45,15 @@
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QTreeView" name="packView">
+ <property name="alternatingRowColors">
+ <bool>true</bool>
+ </property>
<property name="iconSize">
<size>
<width>48</width>
<height>48</height>
</size>
</property>
- <property name="alternatingRowColors">
- <bool>true</bool>
- </property>
</widget>
</item>
<item row="0" column="1">
@@ -76,7 +72,6 @@
</widget>
<tabstops>
<tabstop>searchEdit</tabstop>
- <tabstop>searchButton</tabstop>
<tabstop>versionSelectionBox</tabstop>
</tabstops>
<resources/>
diff --git a/launcher/translations/TranslationsModel.cpp b/launcher/translations/TranslationsModel.cpp
index 0093e9b8..29a952b0 100644
--- a/launcher/translations/TranslationsModel.cpp
+++ b/launcher/translations/TranslationsModel.cpp
@@ -182,7 +182,7 @@ void readIndex(const QString & path, QMap<QString, Language>& languages)
auto toplevel_doc = Json::requireDocument(data);
auto doc = Json::requireObject(toplevel_doc);
auto file_type = Json::requireString(doc, "file_type");
- if(file_type != "LAUNCHER-TRANSLATION-INDEX")
+ if(file_type != "MMC-TRANSLATION-INDEX")
{
qCritical() << "Translations Download Failed: index file is of unknown file type" << file_type;
return;
diff --git a/libraries/README.md b/libraries/README.md
index ac861148..39505881 100644
--- a/libraries/README.md
+++ b/libraries/README.md
@@ -9,6 +9,13 @@ This library has served as a base for some (much more full-featured and advanced
Copyright belongs to Petr Mrázek, unless explicitly stated otherwise in the source files. Available under the Apache 2.0 license.
+## ganalytics
+A Google Analytics library for Qt.
+
+BSD licensed, derived from [qt-google-analytics](https://github.com/HSAnet/qt-google-analytics).
+
+Modifications include better handling of IP anonymization (can be enabled) and general improvements of the API (application handles persistence and ID generation instead of the library).
+
## hoedown
Hoedown is a revived fork of Sundown, the Markdown parser based on the original code of the Upskirt library by Natacha Porté.
@@ -24,6 +31,13 @@ Simple Java tool that prints the JVM details - version and platform bitness.
Do what you want with it. It is so trivial that noone cares.
+## Katabasis
+Oauth2 library customized for Microsoft authentication.
+
+This is a fork of the [O2 library](https://github.com/pipacs/o2).
+
+MIT licensed.
+
## launcher
Java launcher part for Minecraft.
@@ -127,41 +141,48 @@ See [github repo](https://github.com/ljfa-ag/libnbtplusplus).
Available either under LGPL version 3 or later.
-## pack200
-Unpacks pack200 archives (squished, compression-optimized Java jars). This format is only used by Forge to save bandwidth.
+## LocalPeer
+Library for making only one instance of the application run at all times.
-A horrible little thing extracted from the depths of the OpenJDK codebase. Please don't look at it, or you will praise Cthulhu for his clean code for the rest of your days.
+BSD licensed, derived from [QtSingleApplication](https://github.com/qtproject/qt-solutions/tree/master/qtsingleapplication).
-Available under GPL 2 with classpath exception.
+Changes are made to make the code more generic and useful in less usual conditions.
-## rainbow
-Color functions extracted from [KGuiAddons](https://inqlude.org/libraries/kguiaddons.html). Used for adaptive text coloring.
+## optional-bare
-Available either under LGPL version 2.1 or later.
+A simple single-file header-only version of a C++17-like optional for default-constructible, copyable types, for C++98 and later.
-## xz-embedded
-Tiny implementation of LZMA2 de/compression. This format is only used by Forge to save bandwidth.
+Imported from: https://github.com/martinmoene/optional-bare/commit/0bb1d183bcee1e854c4ea196b533252c51f98b81
-Public domain.
+Boost Software License - Version 1.0
-## LocalPeer
-Library for making only one instance of the application run at all times.
+## quazip
-BSD licensed, derived from [QtSingleApplication](https://github.com/qtproject/qt-solutions/tree/master/qtsingleapplication).
+A zip manipulation library, forked for MultiMC's use.
-Changes are made to make the code more generic and useful in less usual conditions.
+LGPL 2.1
+## rainbow
+Color functions extracted from [KGuiAddons](https://inqlude.org/libraries/kguiaddons.html). Used for adaptive text coloring.
-## ganalytics
-A Google Analytics library for Qt.
+Available either under LGPL version 2.1 or later.
-BSD licensed, derived from [qt-google-analytics](https://github.com/HSAnet/qt-google-analytics).
+## systeminfo
-Modifications include better handling of IP anonymization (can be enabled) and general improvements of the API (application handles persistence and ID generation instead of the library).
+A MultiMC-specific library for probing system information.
+
+Apache 2.0
## tomlc99
+
A TOML language parser. Used by Forge 1.14+ to store mod metadata.
See [github repo](https://github.com/cktan/tomlc99).
Licenced under the MIT licence.
+
+## xz-embedded
+
+Tiny implementation of LZMA2 de/compression. This format is only used by Forge to save bandwidth.
+
+Public domain.
diff --git a/secrets/multimc.rc b/secrets/multimc.rc
deleted file mode 100644
index e7340f2a..00000000
--- a/secrets/multimc.rc
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-
-IDI_ICON1 ICON DISCARDABLE "MultiMC.ico"
-1 RT_MANIFEST "MultiMC.manifest"
-
-VS_VERSION_INFO VERSIONINFO
-FILEVERSION 1,0,0,0
-FILEOS VOS_NT_WINDOWS32
-FILETYPE VFT_APP
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "000004b0"
- BEGIN
- VALUE "CompanyName", "MultiMC Contributors"
- VALUE "FileDescription", "MultiMC Launcher"
- VALUE "FileVersion", "1.0.0.0"
- VALUE "ProductName", "MultiMC"
- VALUE "ProductVersion", "5"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x0000, 0x04b0 // Unicode
- END
-END