diff options
23 files changed, 124 insertions, 133 deletions
@@ -75,7 +75,7 @@ You can use IDEs like KDevelop or QtCreator to open the CMake project if you wan ### Loading the project in Qt Creator (optional) 1. Open Qt Creator. 2. Choose `File->Open File or Project`. -3. Navigate to the MultiMC5 source folder you cloned and choose CMakeLists.txt. +3. Navigate to the Launcher source folder you cloned and choose CMakeLists.txt. 4. Read the instructions that just popped up about a build location and choose one. 5. You should see "Run CMake" in the window. - Make sure that Generator is set to "Unix Generator (Desktop Qt 5.6.x GCC 64bit)". @@ -83,7 +83,7 @@ You can use IDEs like KDevelop or QtCreator to open the CMake project if you wan - You'll see warnings and it might not be clear that it succeeded until you scroll to the bottom of the window. - Hit "Finish" if CMake ran successfully. 6. Cross your fingers and press the Run button (bottom left of Qt Creator). - - If the project builds successfully it will run and the MultiMC5 window will pop up. + - If the project builds successfully it will run and the Launcher window will pop up. **If this doesn't work for you, let us know on IRC ([Esper/#MultiMC](http://webchat.esper.net/?nick=&channels=MultiMC))!** @@ -132,7 +132,7 @@ Ensure that OpenSSL, zlib, Java and CMake are on `PATH`. ### Loading the project 1. Open Qt Creator, 2. Choose File->Open File or Project, -3. Navigate to the MultiMC5 source folder you cloned and choose CMakeLists.txt, +3. Navigate to the Launcher source folder you cloned and choose CMakeLists.txt, 4. Read the instructions that just popped up about a build location and choose one, 5. If you chose not to add CMake to the system PATH, tell Qt Creator where you installed it, - Otherwise you can skip this step. @@ -142,7 +142,7 @@ Ensure that OpenSSL, zlib, Java and CMake are on `PATH`. - You'll see warnings and it might not be clear that it succeeded until you scroll to the bottom of the window. - Hit "Finish" if CMake ran successfully. 7. Cross your fingers and press the Run button (bottom left of Qt Creator)! - - If the project builds successfully it will run and the MultiMC5 window will pop up, + - If the project builds successfully it will run and the Launcher window will pop up, - Test OpenSSL by making an instance and trying to log in. If Qt Creator couldn't find OpenSSL during the CMake stage, login will fail and you'll get an error. The following .dlls are needed for the app to run (copy them to build directory if you want to be able to move the build to another pc): @@ -166,7 +166,7 @@ zlib1.dll **These build instructions worked for me (Drayshak) on a fresh Windows 8 x64 Professional install. If they don't work for you, let us know on IRC ([Esper/#MultiMC](http://webchat.esper.net/?nick=&channels=MultiMC))!** ### Compile from command line on Windows 1. If you installed Qt with the web installer, there should be a shortcut called `Qt 5.4 for Desktop (MinGW 4.9 32-bit)` in the Start menu on Windows 7 and 10. Best way to find it is to search for it. Do note you cannot just use cmd.exe, you have to use the shortcut, otherwise the proper MinGW software will not be on the PATH. -2. Once that is open, change into your user directory, and clone MultiMC by doing `git clone --recursive https://github.com/MultiMC/MultiMC5.git`, and change directory to the folder you cloned to. +2. Once that is open, change into your user directory, and clone MultiMC by doing `git clone --recursive https://github.com/MultiMC/Launcher.git`, and change directory to the folder you cloned to. 3. Make a build directory, and change directory to the directory and do `cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=C:\Path\that\makes\sense\for\you`. By default, it will install to C:\Program Files (x86), which you might not want, if you want a local installation. If you want to install it to that directory, make sure to run the command window as administrator. 3. Do `mingw32-make -jX`, where X is the number of cores your CPU has plus one. 4. Now to wait for it to compile. This could take some time. Hopefully it compiles properly. @@ -186,8 +186,8 @@ zlib1.dll Pick an installation path - this is where the final `.app` will be constructed when you run `make install`. Supply it as the `CMAKE_INSTALL_PREFIX` argument during CMake configuration. ``` -git clone --recursive https://github.com/MultiMC/MultiMC5.git -cd MultiMC5 +git clone --recursive https://github.com/MultiMC/Launcher.git +cd Launcher mkdir build cd build cmake \ diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 5c45273b..d67dcdbf 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -84,6 +84,10 @@ set(CORE_SOURCES # A Recursive file system watcher RecursiveFileSystemWatcher.h RecursiveFileSystemWatcher.cpp + + # Time + MMCTime.h + MMCTime.cpp ) add_unit_test(FileSystem diff --git a/launcher/Launcher.cpp b/launcher/Launcher.cpp index 9a1d1ca3..e5deb791 100644 --- a/launcher/Launcher.cpp +++ b/launcher/Launcher.cpp @@ -644,6 +644,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv) // Game time m_settings->registerSetting("ShowGameTime", true); + m_settings->registerSetting("ShowGlobalGameTime", true); m_settings->registerSetting("RecordGameTime", true); // Minecraft launch method diff --git a/launcher/MMCTime.cpp b/launcher/MMCTime.cpp new file mode 100644 index 00000000..fa26e0b9 --- /dev/null +++ b/launcher/MMCTime.cpp @@ -0,0 +1,21 @@ +#include <MMCTime.h> + +#include <QObject> + +QString Time::prettifyDuration(int64_t duration) { + int seconds = (int) (duration % 60); + duration /= 60; + int minutes = (int) (duration % 60); + duration /= 60; + int hours = (int) (duration % 24); + int days = (int) (duration / 24); + if((hours == 0)&&(days == 0)) + { + return QObject::tr("%1m %2s").arg(minutes).arg(seconds); + } + if (days == 0) + { + return QObject::tr("%1h %2m").arg(hours).arg(minutes); + } + return QObject::tr("%1d %2h %3m").arg(days).arg(hours).arg(minutes); +} diff --git a/launcher/MMCTime.h b/launcher/MMCTime.h new file mode 100644 index 00000000..728a5abb --- /dev/null +++ b/launcher/MMCTime.h @@ -0,0 +1,9 @@ +#pragma once + +#include <QString> + +namespace Time { + +QString prettifyDuration(int64_t duration); + +} diff --git a/launcher/MainWindow.cpp b/launcher/MainWindow.cpp index c3cc6b8d..0c414285 100644 --- a/launcher/MainWindow.cpp +++ b/launcher/MainWindow.cpp @@ -88,6 +88,7 @@ #include "UpdateController.h" #include "KonamiCode.h" #include <InstanceCopyTask.h> +#include "MMCTime.h" namespace { QString profileInUseFilter(const QString & profile, bool used) @@ -747,7 +748,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow connect(LAUNCHER, &Launcher::globalSettingsClosed, this, &MainWindow::globalSettingsClosed); m_statusLeft = new QLabel(tr("No instance selected"), this); - m_statusCenter = new QLabel(tr("Total playtime: 0s."), this); + m_statusCenter = new QLabel(tr("Total playtime: 0s"), this); statusBar()->addPermanentWidget(m_statusLeft, 1); statusBar()->addPermanentWidget(m_statusCenter, 0); @@ -1609,6 +1610,7 @@ void MainWindow::globalSettingsClosed() proxymodel->invalidate(); proxymodel->sort(0); updateToolsMenu(); + updateStatusCenter(); update(); } @@ -1926,15 +1928,10 @@ void MainWindow::checkInstancePathForProblems() void MainWindow::updateStatusCenter() { - int timeplayed = LAUNCHER->instances()->getTotalPlayTime(); - int minutesTotal = timeplayed / 60; - int seconds = timeplayed % 60; - int minutes = minutesTotal % 60; - int hours = minutesTotal / 60; - if(hours != 0) - m_statusCenter->setText(tr("Total playtime: %1h %2m %3s").arg(hours).arg(minutes).arg(seconds)); - else if(minutes != 0) - m_statusCenter->setText(tr("Total playtime: %1m %2s").arg(minutes).arg(seconds)); - else if(seconds != 0) - m_statusCenter->setText(tr("Total playtime: %1s").arg(seconds)); + m_statusCenter->setVisible(LAUNCHER->settings()->get("ShowGlobalGameTime").toBool()); + + int timePlayed = LAUNCHER->instances()->getTotalPlayTime(); + if (timePlayed > 0) { + m_statusCenter->setText(tr("Total playtime: %1").arg(Time::prettifyDuration(timePlayed))); + } } diff --git a/launcher/minecraft/MinecraftInstance.cpp b/launcher/minecraft/MinecraftInstance.cpp index 11c4dec1..2982a340 100644 --- a/launcher/minecraft/MinecraftInstance.cpp +++ b/launcher/minecraft/MinecraftInstance.cpp @@ -10,6 +10,7 @@ #include <pathmatcher/MultiMatcher.h> #include <FileSystem.h> #include <java/JavaVersion.h> +#include "MMCTime.h" #include "launch/LaunchTask.h" #include "launch/steps/LookupServerAddress.h" @@ -766,25 +767,6 @@ QString MinecraftInstance::getLogFileRoot() return gameRoot(); } -QString MinecraftInstance::prettifyTimeDuration(int64_t duration) -{ - int seconds = (int) (duration % 60); - duration /= 60; - int minutes = (int) (duration % 60); - duration /= 60; - int hours = (int) (duration % 24); - int days = (int) (duration / 24); - if((hours == 0)&&(days == 0)) - { - return tr("%1m %2s").arg(minutes).arg(seconds); - } - if (days == 0) - { - return tr("%1h %2m").arg(hours).arg(minutes); - } - return tr("%1d %2h %3m").arg(days).arg(hours).arg(minutes); -} - QString MinecraftInstance::getStatusbarDescription() { QStringList traits; @@ -798,11 +780,11 @@ QString MinecraftInstance::getStatusbarDescription() if(m_settings->get("ShowGameTime").toBool()) { if (lastTimePlayed() > 0) { - description.append(tr(", last played for %1").arg(prettifyTimeDuration(lastTimePlayed()))); + description.append(tr(", last played for %1").arg(Time::prettifyDuration(lastTimePlayed()))); } if (totalTimePlayed() > 0) { - description.append(tr(", total played for %1").arg(prettifyTimeDuration(totalTimePlayed()))); + description.append(tr(", total played for %1").arg(Time::prettifyDuration(totalTimePlayed()))); } } if(hasCrashed()) diff --git a/launcher/minecraft/MinecraftInstance.h b/launcher/minecraft/MinecraftInstance.h index cdfd350b..b11270e6 100644 --- a/launcher/minecraft/MinecraftInstance.h +++ b/launcher/minecraft/MinecraftInstance.h @@ -118,9 +118,6 @@ protected: QStringList validLaunchMethods(); QString launchMethod(); -private: - QString prettifyTimeDuration(int64_t duration); - protected: // data std::shared_ptr<PackProfile> m_components; mutable std::shared_ptr<ModFolderModel> m_loader_mod_list; diff --git a/launcher/pages/global/MinecraftPage.cpp b/launcher/pages/global/MinecraftPage.cpp index 2830dc7c..342941f4 100644 --- a/launcher/pages/global/MinecraftPage.cpp +++ b/launcher/pages/global/MinecraftPage.cpp @@ -54,7 +54,6 @@ void MinecraftPage::on_maximizedCheckBox_clicked(bool checked) updateCheckboxStuff(); } - void MinecraftPage::applySettings() { auto s = LAUNCHER->settings(); @@ -70,6 +69,7 @@ void MinecraftPage::applySettings() // Game time s->set("ShowGameTime", ui->showGameTime->isChecked()); + s->set("ShowGlobalGameTime", ui->showGlobalGameTime->isChecked()); s->set("RecordGameTime", ui->recordGameTime->isChecked()); } @@ -86,5 +86,6 @@ void MinecraftPage::loadSettings() ui->useNativeGLFWCheck->setChecked(s->get("UseNativeGLFW").toBool()); ui->showGameTime->setChecked(s->get("ShowGameTime").toBool()); + ui->showGlobalGameTime->setChecked(s->get("ShowGlobalGameTime").toBool()); ui->recordGameTime->setChecked(s->get("RecordGameTime").toBool()); } diff --git a/launcher/pages/global/MinecraftPage.ui b/launcher/pages/global/MinecraftPage.ui index 2abd4bd4..857b8cfb 100644 --- a/launcher/pages/global/MinecraftPage.ui +++ b/launcher/pages/global/MinecraftPage.ui @@ -148,6 +148,13 @@ </widget> </item> <item> + <widget class="QCheckBox" name="showGlobalGameTime"> + <property name="text"> + <string>Show time spent playing across all instances</string> + </property> + </widget> + </item> + <item> <widget class="QCheckBox" name="recordGameTime"> <property name="text"> <string>Record time spent playing instances</string> diff --git a/launcher/pages/instance/InstanceSettingsPage.ui b/launcher/pages/instance/InstanceSettingsPage.ui index e569ce56..35cd7335 100644 --- a/launcher/pages/instance/InstanceSettingsPage.ui +++ b/launcher/pages/instance/InstanceSettingsPage.ui @@ -416,9 +416,9 @@ </item> </layout> </widget> - <widget class="QWidget" name="miscellanousPage"> + <widget class="QWidget" name="miscellaneousPage"> <attribute name="title"> - <string>Miscellanous</string> + <string>Miscellaneous</string> </attribute> <layout class="QVBoxLayout" name="verticalLayout_9"> <item> @@ -489,7 +489,7 @@ </widget> </item> <item> - <spacer name="verticalSpacerMiscellanous"> + <spacer name="verticalSpacerMiscellaneous"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> diff --git a/launcher/pages/modplatform/atlauncher/AtlPage.cpp b/launcher/pages/modplatform/atlauncher/AtlPage.cpp index e59e5fe1..cdf5cc86 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); @@ -71,7 +70,7 @@ void AtlPage::suggestCurrent() return; } - dialog->setSuggestedPack(selected.name, new ATLauncher::PackInstallTask(this, selected.safeName, selectedVersion)); + dialog->setSuggestedPack(selected.name + " " + selectedVersion, new ATLauncher::PackInstallTask(this, selected.safeName, selectedVersion)); auto editedLogoName = selected.safeName; auto url = QString(BuildConfig.ATL_DOWNLOAD_SERVER_URL + "launcher/images/%1.png").arg(selected.safeName.toLower()); listModel->getLogo(selected.safeName, url, [this, editedLogoName](QString logo) @@ -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..620a56d8 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(); } @@ -80,7 +85,7 @@ void FtbPage::suggestCurrent() return; } - dialog->setSuggestedPack(selected.name, new ModpacksCH::PackInstallTask(selected, selectedVersion)); + dialog->setSuggestedPack(selected.name + " " + selectedVersion, new ModpacksCH::PackInstallTask(selected, selectedVersion)); for(auto art : selected.art) { if(art.type == "square") { QString editedLogoName; @@ -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/widgets/JavaSettingsWidget.cpp b/launcher/widgets/JavaSettingsWidget.cpp index 0e292bb8..11f0653a 100644 --- a/launcher/widgets/JavaSettingsWidget.cpp +++ b/launcher/widgets/JavaSettingsWidget.cpp @@ -74,7 +74,7 @@ void JavaSettingsWidget::setupUi() m_minMemSpinBox = new QSpinBox(m_memoryGroupBox); m_minMemSpinBox->setObjectName(QStringLiteral("minMemSpinBox")); - m_minMemSpinBox->setSuffix(QStringLiteral(" MB")); + m_minMemSpinBox->setSuffix(QStringLiteral(" MiB")); m_minMemSpinBox->setMinimum(128); m_minMemSpinBox->setMaximum(m_availableMemory); m_minMemSpinBox->setSingleStep(128); @@ -87,7 +87,7 @@ void JavaSettingsWidget::setupUi() m_maxMemSpinBox = new QSpinBox(m_memoryGroupBox); m_maxMemSpinBox->setObjectName(QStringLiteral("maxMemSpinBox")); - m_maxMemSpinBox->setSuffix(QStringLiteral(" MB")); + m_maxMemSpinBox->setSuffix(QStringLiteral(" MiB")); m_maxMemSpinBox->setMinimum(128); m_maxMemSpinBox->setMaximum(m_availableMemory); m_maxMemSpinBox->setSingleStep(128); @@ -102,7 +102,7 @@ void JavaSettingsWidget::setupUi() m_permGenSpinBox = new QSpinBox(m_memoryGroupBox); m_permGenSpinBox->setObjectName(QStringLiteral("permGenSpinBox")); - m_permGenSpinBox->setSuffix(QStringLiteral(" MB")); + m_permGenSpinBox->setSuffix(QStringLiteral(" MiB")); m_permGenSpinBox->setMinimum(64); m_permGenSpinBox->setMaximum(m_availableMemory); m_permGenSpinBox->setSingleStep(8); diff --git a/notsecrets/CMakeLists.txt b/notsecrets/CMakeLists.txt index 2369d046..b5dd3cf8 100644 --- a/notsecrets/CMakeLists.txt +++ b/notsecrets/CMakeLists.txt @@ -11,7 +11,7 @@ set(Launcher_Name "${Launcher_CommonName}" PARENT_SCOPE) set(Launcher_DisplayName "${Launcher_CommonName} 5" PARENT_SCOPE) set(Launcher_UserAgent "${Launcher_CommonName}/5.0" PARENT_SCOPE) set(Launcher_ConfigFile "devlauncher.cfg" PARENT_SCOPE) -set(Launcher_Git "https://github.com/MultiMC/MultiMC5" PARENT_SCOPE) +set(Launcher_Git "https://github.com/MultiMC/Launcher" PARENT_SCOPE) set(Launcher_Branding_ICNS "notsecrets/Launcher.icns" PARENT_SCOPE) set(Launcher_Branding_WindowsRC "notsecrets/launcher.rc" PARENT_SCOPE) |