Merge remote-tracking branch 'upstream/develop' into resource-meta
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
@@ -780,6 +780,9 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
||||
// FTBApp instances
|
||||
m_settings->registerSetting("FTBAppInstancesPath", "");
|
||||
|
||||
// Custom Technic Client ID
|
||||
m_settings->registerSetting("TechnicClientID", "");
|
||||
|
||||
// Init page provider
|
||||
{
|
||||
m_globalSettingsProvider = std::make_shared<GenericPageProvider>(tr("Settings"));
|
||||
@@ -1022,7 +1025,8 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
||||
}
|
||||
|
||||
// notify user if /tmp is mounted with `noexec` (#1693)
|
||||
{
|
||||
QString jvmArgs = m_settings->get("JvmArgs").toString();
|
||||
if (jvmArgs.indexOf("java.io.tmpdir") == -1) { /* java.io.tmpdir is a valid workaround, so don't annoy */
|
||||
bool is_tmp_noexec = false;
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
@@ -1042,7 +1046,11 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
||||
if (is_tmp_noexec) {
|
||||
auto infoMsg =
|
||||
tr("Your /tmp directory is currently mounted with the 'noexec' flag enabled.\n"
|
||||
"Some versions of Minecraft may not launch.\n");
|
||||
"Some versions of Minecraft may not launch.\n"
|
||||
"\n"
|
||||
"You may solve this issue by remounting /tmp as 'exec' or setting "
|
||||
"the java.io.tmpdir JVM argument to a writeable directory in a "
|
||||
"filesystem where the 'exec' flag is set (e.g., /home/user/.local/tmp)\n");
|
||||
auto msgBox = new QMessageBox(QMessageBox::Information, tr("Incompatible system configuration"), infoMsg, QMessageBox::Ok);
|
||||
msgBox->setDefaultButton(QMessageBox::Ok);
|
||||
msgBox->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
@@ -964,6 +964,9 @@ SET(LAUNCHER_SOURCES
|
||||
ui/pages/modplatform/ShaderPackPage.cpp
|
||||
ui/pages/modplatform/ShaderPackModel.cpp
|
||||
|
||||
|
||||
ui/pages/modplatform/ModpackProviderBasePage.h
|
||||
|
||||
ui/pages/modplatform/atlauncher/AtlFilterModel.cpp
|
||||
ui/pages/modplatform/atlauncher/AtlFilterModel.h
|
||||
ui/pages/modplatform/atlauncher/AtlListModel.cpp
|
||||
|
||||
@@ -153,6 +153,7 @@ bool collectFileListRecursively(const QString& rootDir, const QString& subDir, Q
|
||||
|
||||
#if defined(LAUNCHER_APPLICATION)
|
||||
class ExportToZipTask : public Task {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ExportToZipTask(QString outputPath,
|
||||
QDir dir,
|
||||
@@ -207,6 +208,7 @@ class ExportToZipTask : public Task {
|
||||
};
|
||||
|
||||
class ExtractZipTask : public Task {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ExtractZipTask(QString input, QDir outputDir, QString subdirectory = "")
|
||||
: ExtractZipTask(std::make_shared<QuaZip>(input), outputDir, subdirectory)
|
||||
|
||||
@@ -140,9 +140,9 @@ QVariant VersionProxyModel::headerData(int section, Qt::Orientation orientation,
|
||||
case Path:
|
||||
return tr("Filesystem path to this version");
|
||||
case JavaName:
|
||||
return tr("The alternative name of the java version");
|
||||
return tr("The alternative name of the Java version");
|
||||
case JavaMajor:
|
||||
return tr("The java major version");
|
||||
return tr("The Java major version");
|
||||
case Time:
|
||||
return tr("Release date of this version");
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ void ArchiveDownloadTask::executeTask()
|
||||
|
||||
void ArchiveDownloadTask::extractJava(QString input)
|
||||
{
|
||||
setStatus(tr("Extracting java"));
|
||||
setStatus(tr("Extracting Java"));
|
||||
if (input.endsWith("tar")) {
|
||||
setStatus(tr("Extracting Java (Progress is not reported for tar archives)"));
|
||||
QFile in(input);
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "tasks/Task.h"
|
||||
|
||||
class FlamePackExportTask : public Task {
|
||||
Q_OBJECT
|
||||
public:
|
||||
FlamePackExportTask(const QString& name,
|
||||
const QString& version,
|
||||
|
||||
@@ -74,6 +74,7 @@ void PackFetchTask::fetchPrivate(const QStringList& toFetch)
|
||||
auto data = std::make_shared<QByteArray>();
|
||||
NetJob* job = new NetJob("Fetching private pack", m_network);
|
||||
job->addNetAction(Net::ApiDownload::makeByteArray(privatePackBaseUrl.arg(packCode), data));
|
||||
job->setAskRetry(false);
|
||||
|
||||
QObject::connect(job, &NetJob::succeeded, this, [this, job, data, packCode] {
|
||||
ModpackList packs;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "tasks/Task.h"
|
||||
|
||||
class ModrinthPackExportTask : public Task {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ModrinthPackExportTask(const QString& name,
|
||||
const QString& version,
|
||||
|
||||
@@ -212,9 +212,9 @@ void V1::updateModIndex(const QDir& index_dir, Mod& mod)
|
||||
auto tbl = toml::table{ { "name", mod.name.toStdString() },
|
||||
{ "filename", mod.filename.toStdString() },
|
||||
{ "side", sideToString(mod.side).toStdString() },
|
||||
{ "loaders", loaders },
|
||||
{ "mcVersions", mcVersions },
|
||||
{ "releaseType", mod.releaseType.toString().toStdString() },
|
||||
{ "x-prismlauncher-loaders", loaders },
|
||||
{ "x-prismlauncher-mc-versions", mcVersions },
|
||||
{ "x-prismlauncher-release-type", mod.releaseType.toString().toStdString() },
|
||||
{ "download",
|
||||
toml::table{
|
||||
{ "mode", mod.mode.toStdString() },
|
||||
@@ -299,15 +299,15 @@ auto V1::getIndexForMod(const QDir& index_dir, QString slug) -> Mod
|
||||
mod.name = stringEntry(table, "name");
|
||||
mod.filename = stringEntry(table, "filename");
|
||||
mod.side = stringToSide(stringEntry(table, "side"));
|
||||
mod.releaseType = ModPlatform::IndexedVersionType(stringEntry(table, "releaseType"));
|
||||
if (auto loaders = table["loaders"]; loaders && loaders.is_array()) {
|
||||
mod.releaseType = ModPlatform::IndexedVersionType(stringEntry(table, "x-prismlauncher-release-type"));
|
||||
if (auto loaders = table["x-prismlauncher-loaders"]; loaders && loaders.is_array()) {
|
||||
for (auto&& loader : *loaders.as_array()) {
|
||||
if (loader.is_string()) {
|
||||
mod.loaders |= ModPlatform::getModLoaderFromString(QString::fromStdString(loader.as_string()->value_or("")));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (auto versions = table["mcVersions"]; versions && versions.is_array()) {
|
||||
if (auto versions = table["x-prismlauncher-mc-versions"]; versions && versions.is_array()) {
|
||||
for (auto&& version : *versions.as_array()) {
|
||||
if (version.is_string()) {
|
||||
auto ver = QString::fromStdString(version.as_string()->value_or(""));
|
||||
|
||||
@@ -235,7 +235,6 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||
}
|
||||
|
||||
ui->actionViewJavaFolder->setEnabled(BuildConfig.JAVA_DOWNLOADER_ENABLED);
|
||||
|
||||
}
|
||||
|
||||
// add the toolbar toggles to the view menu
|
||||
|
||||
@@ -798,7 +798,7 @@
|
||||
<string>Java</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open the java folder in a file browser. Only available if the built-in Java downloader is used.</string>
|
||||
<string>Open the Java folder in a file browser. Only available if the built-in Java downloader is used.</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "ui/widgets/VersionSelectWidget.h"
|
||||
|
||||
class InstallLoaderPage : public VersionSelectWidget, public BasePage {
|
||||
Q_OBJECT
|
||||
public:
|
||||
InstallLoaderPage(const QString& id,
|
||||
const QString& iconName,
|
||||
@@ -164,3 +165,4 @@ void InstallLoaderDialog::done(int result)
|
||||
|
||||
QDialog::done(result);
|
||||
}
|
||||
#include "InstallLoaderDialog.moc"
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "NewInstanceDialog.h"
|
||||
#include "Application.h"
|
||||
#include "ui/pages/modplatform/ModpackProviderBasePage.h"
|
||||
#include "ui/pages/modplatform/import_ftb/ImportFTBPage.h"
|
||||
#include "ui_NewInstanceDialog.h"
|
||||
|
||||
@@ -140,6 +141,8 @@ NewInstanceDialog::NewInstanceDialog(const QString& initialGroup,
|
||||
auto geometry = screen->availableSize();
|
||||
resize(width(), qMin(geometry.height() - 50, 710));
|
||||
}
|
||||
|
||||
connect(m_container, &PageContainer::selectedPageChanged, this, &NewInstanceDialog::selectedPageChanged);
|
||||
}
|
||||
|
||||
void NewInstanceDialog::reject()
|
||||
@@ -316,3 +319,16 @@ void NewInstanceDialog::importIconNow()
|
||||
}
|
||||
APPLICATION->settings()->set("NewInstanceGeometry", saveGeometry().toBase64());
|
||||
}
|
||||
|
||||
void NewInstanceDialog::selectedPageChanged(BasePage* previous, BasePage* selected)
|
||||
{
|
||||
auto prevPage = dynamic_cast<ModpackProviderBasePage*>(previous);
|
||||
if (prevPage) {
|
||||
m_searchTerm = prevPage->getSerachTerm();
|
||||
}
|
||||
|
||||
auto nextPage = dynamic_cast<ModpackProviderBasePage*>(selected);
|
||||
if (nextPage) {
|
||||
nextPage->setSearchTerm(m_searchTerm);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ class NewInstanceDialog : public QDialog, public BasePageProvider {
|
||||
private slots:
|
||||
void on_iconButton_clicked();
|
||||
void on_instNameTextBox_textChanged(const QString& arg1);
|
||||
void selectedPageChanged(BasePage* previous, BasePage* selected);
|
||||
|
||||
private:
|
||||
Ui::NewInstanceDialog* ui = nullptr;
|
||||
@@ -98,5 +99,7 @@ class NewInstanceDialog : public QDialog, public BasePageProvider {
|
||||
|
||||
QString importVersion;
|
||||
|
||||
QString m_searchTerm;
|
||||
|
||||
void importIconNow();
|
||||
};
|
||||
|
||||
@@ -258,7 +258,9 @@ void ResourceDownloadDialog::selectedPageChanged(BasePage* previous, BasePage* s
|
||||
}
|
||||
|
||||
// Same effect as having a global search bar
|
||||
selectedPage()->setSearchTerm(prev_page->getSearchTerm());
|
||||
ResourcePage* result = dynamic_cast<ResourcePage*>(selected);
|
||||
Q_ASSERT(result != nullptr);
|
||||
result->setSearchTerm(prev_page->getSearchTerm());
|
||||
}
|
||||
|
||||
ModDownloadDialog::ModDownloadDialog(QWidget* parent, const std::shared_ptr<ModFolderModel>& mods, BaseInstance* instance)
|
||||
|
||||
@@ -57,13 +57,13 @@ class InstallJavaPage : public QWidget, public BasePage {
|
||||
|
||||
majorVersionSelect = new VersionSelectWidget(this);
|
||||
majorVersionSelect->selectCurrent();
|
||||
majorVersionSelect->setEmptyString(tr("No java versions are currently available in the meta."));
|
||||
majorVersionSelect->setEmptyErrorString(tr("Couldn't load or download the java version lists!"));
|
||||
majorVersionSelect->setEmptyString(tr("No Java versions are currently available in the meta."));
|
||||
majorVersionSelect->setEmptyErrorString(tr("Couldn't load or download the Java version lists!"));
|
||||
horizontalLayout->addWidget(majorVersionSelect, 1);
|
||||
|
||||
javaVersionSelect = new VersionSelectWidget(this);
|
||||
javaVersionSelect->setEmptyString(tr("No java versions are currently available for your OS."));
|
||||
javaVersionSelect->setEmptyErrorString(tr("Couldn't load or download the java version lists!"));
|
||||
javaVersionSelect->setEmptyString(tr("No Java versions are currently available for your OS."));
|
||||
javaVersionSelect->setEmptyErrorString(tr("Couldn't load or download the Java version lists!"));
|
||||
horizontalLayout->addWidget(javaVersionSelect, 4);
|
||||
connect(majorVersionSelect, &VersionSelectWidget::selectedVersionChanged, this, &InstallJavaPage::setSelectedVersion);
|
||||
connect(majorVersionSelect, &VersionSelectWidget::selectedVersionChanged, this, &InstallJavaPage::selectionChanged);
|
||||
|
||||
@@ -143,6 +143,7 @@ void APIPage::loadSettings()
|
||||
ui->modrinthToken->setText(modrinthToken);
|
||||
QString customUserAgent = s->get("UserAgentOverride").toString();
|
||||
ui->userAgentLineEdit->setText(customUserAgent);
|
||||
ui->technicClientID->setText(s->get("TechnicClientID").toString());
|
||||
}
|
||||
|
||||
void APIPage::applySettings()
|
||||
@@ -172,6 +173,7 @@ void APIPage::applySettings()
|
||||
QString modrinthToken = ui->modrinthToken->text();
|
||||
s->set("ModrinthToken", modrinthToken);
|
||||
s->set("UserAgentOverride", ui->userAgentLineEdit->text());
|
||||
s->set("TechnicClientID", ui->technicClientID->text());
|
||||
}
|
||||
|
||||
bool APIPage::apply()
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
<width>841</width>
|
||||
<height>620</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
@@ -288,6 +288,36 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Technic Client ID</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>Note: you only need to set this to access private data.</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="technicClientID">
|
||||
<property name="placeholderText">
|
||||
<string>(None)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Enter a custom GUID client ID for Technic here.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
||||
@@ -67,8 +67,8 @@ JavaPage::JavaPage(QWidget* parent) : QWidget(parent), ui(new Ui::JavaPage)
|
||||
ui->managedJavaList->initialize(new JavaInstallList(this, true));
|
||||
ui->managedJavaList->setResizeOn(2);
|
||||
ui->managedJavaList->selectCurrent();
|
||||
ui->managedJavaList->setEmptyString(tr("No managed java versions are installed"));
|
||||
ui->managedJavaList->setEmptyErrorString(tr("Couldn't load the managed java list!"));
|
||||
ui->managedJavaList->setEmptyString(tr("No managed Java versions are installed"));
|
||||
ui->managedJavaList->setEmptyErrorString(tr("Couldn't load the managed Java list!"));
|
||||
connect(ui->autodetectJavaCheckBox, &QCheckBox::stateChanged, this, [this] {
|
||||
ui->autodownloadCheckBox->setEnabled(ui->autodetectJavaCheckBox->isChecked());
|
||||
if (!ui->autodetectJavaCheckBox->isChecked())
|
||||
|
||||
@@ -234,7 +234,7 @@ bool LogPage::apply()
|
||||
|
||||
bool LogPage::shouldDisplay() const
|
||||
{
|
||||
return m_instance->isRunning() || m_proxy->rowCount() > 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void LogPage::on_btnPaste_clicked()
|
||||
|
||||
@@ -73,6 +73,7 @@ class ModFolderPage : public ExternalResourcesPage {
|
||||
};
|
||||
|
||||
class CoreModFolderPage : public ModFolderPage {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CoreModFolderPage(BaseInstance* inst, std::shared_ptr<ModFolderModel> mods, QWidget* parent = 0);
|
||||
virtual ~CoreModFolderPage() = default;
|
||||
@@ -86,6 +87,7 @@ class CoreModFolderPage : public ModFolderPage {
|
||||
};
|
||||
|
||||
class NilModFolderPage : public ModFolderPage {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit NilModFolderPage(BaseInstance* inst, std::shared_ptr<ModFolderModel> mods, QWidget* parent = 0);
|
||||
virtual ~NilModFolderPage() = default;
|
||||
|
||||
29
launcher/ui/pages/modplatform/ModpackProviderBasePage.h
Normal file
29
launcher/ui/pages/modplatform/ModpackProviderBasePage.h
Normal file
@@ -0,0 +1,29 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
/*
|
||||
* Prism Launcher - Minecraft Launcher
|
||||
* Copyright (c) 2023 Trial97 <alexandru.tripon97@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ui/pages/BasePage.h"
|
||||
|
||||
class ModpackProviderBasePage : public BasePage {
|
||||
public:
|
||||
/** Programatically set the term in the search bar. */
|
||||
virtual void setSearchTerm(QString) = 0;
|
||||
/** Get the current term in the search bar. */
|
||||
[[nodiscard]] virtual QString getSerachTerm() const = 0;
|
||||
};
|
||||
@@ -164,3 +164,13 @@ void AtlPage::onVersionSelectionChanged(QString version)
|
||||
selectedVersion = version;
|
||||
suggestCurrent();
|
||||
}
|
||||
|
||||
void AtlPage::setSearchTerm(QString term)
|
||||
{
|
||||
ui->searchEdit->setText(term);
|
||||
}
|
||||
|
||||
QString AtlPage::getSerachTerm() const
|
||||
{
|
||||
return ui->searchEdit->text();
|
||||
}
|
||||
|
||||
@@ -42,8 +42,7 @@
|
||||
#include <QWidget>
|
||||
|
||||
#include "Application.h"
|
||||
#include "tasks/Task.h"
|
||||
#include "ui/pages/BasePage.h"
|
||||
#include "ui/pages/modplatform/ModpackProviderBasePage.h"
|
||||
|
||||
namespace Ui {
|
||||
class AtlPage;
|
||||
@@ -51,7 +50,7 @@ class AtlPage;
|
||||
|
||||
class NewInstanceDialog;
|
||||
|
||||
class AtlPage : public QWidget, public BasePage {
|
||||
class AtlPage : public QWidget, public ModpackProviderBasePage {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@@ -66,6 +65,11 @@ class AtlPage : public QWidget, public BasePage {
|
||||
|
||||
void openedImpl() override;
|
||||
|
||||
/** Programatically set the term in the search bar. */
|
||||
virtual void setSearchTerm(QString) override;
|
||||
/** Get the current term in the search bar. */
|
||||
[[nodiscard]] virtual QString getSerachTerm() const override;
|
||||
|
||||
private:
|
||||
void suggestCurrent();
|
||||
|
||||
|
||||
@@ -299,3 +299,12 @@ void FlamePage::updateUi()
|
||||
ui->packDescription->setHtml(StringUtils::htmlListPatch(text + current.description));
|
||||
ui->packDescription->flush();
|
||||
}
|
||||
QString FlamePage::getSerachTerm() const
|
||||
{
|
||||
return ui->searchEdit->text();
|
||||
}
|
||||
|
||||
void FlamePage::setSearchTerm(QString term)
|
||||
{
|
||||
ui->searchEdit->setText(term);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include <Application.h>
|
||||
#include <modplatform/flame/FlamePackIndex.h>
|
||||
#include <QTimer>
|
||||
#include "ui/pages/BasePage.h"
|
||||
#include "ui/pages/modplatform/ModpackProviderBasePage.h"
|
||||
#include "ui/widgets/ProgressWidget.h"
|
||||
|
||||
namespace Ui {
|
||||
@@ -53,7 +53,7 @@ namespace Flame {
|
||||
class ListModel;
|
||||
}
|
||||
|
||||
class FlamePage : public QWidget, public BasePage {
|
||||
class FlamePage : public QWidget, public ModpackProviderBasePage {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@@ -72,6 +72,11 @@ class FlamePage : public QWidget, public BasePage {
|
||||
|
||||
bool eventFilter(QObject* watched, QEvent* event) override;
|
||||
|
||||
/** Programatically set the term in the search bar. */
|
||||
virtual void setSearchTerm(QString) override;
|
||||
/** Get the current term in the search bar. */
|
||||
[[nodiscard]] virtual QString getSerachTerm() const override;
|
||||
|
||||
private:
|
||||
void suggestCurrent();
|
||||
|
||||
|
||||
@@ -135,4 +135,13 @@ void ImportFTBPage::triggerSearch()
|
||||
currentModel->setSearchTerm(ui->searchEdit->text());
|
||||
}
|
||||
|
||||
void ImportFTBPage::setSearchTerm(QString term)
|
||||
{
|
||||
ui->searchEdit->setText(term);
|
||||
}
|
||||
|
||||
QString ImportFTBPage::getSerachTerm() const
|
||||
{
|
||||
return ui->searchEdit->text();
|
||||
}
|
||||
} // namespace FTBImportAPP
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include <Application.h>
|
||||
#include "modplatform/import_ftb/PackHelpers.h"
|
||||
#include "ui/pages/BasePage.h"
|
||||
#include "ui/pages/modplatform/ModpackProviderBasePage.h"
|
||||
#include "ui/pages/modplatform/import_ftb/ListModel.h"
|
||||
|
||||
class NewInstanceDialog;
|
||||
@@ -35,7 +35,7 @@ namespace Ui {
|
||||
class ImportFTBPage;
|
||||
}
|
||||
|
||||
class ImportFTBPage : public QWidget, public BasePage {
|
||||
class ImportFTBPage : public QWidget, public ModpackProviderBasePage {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@@ -49,6 +49,11 @@ class ImportFTBPage : public QWidget, public BasePage {
|
||||
void openedImpl() override;
|
||||
void retranslate() override;
|
||||
|
||||
/** Programatically set the term in the search bar. */
|
||||
virtual void setSearchTerm(QString) override;
|
||||
/** Get the current term in the search bar. */
|
||||
[[nodiscard]] virtual QString getSerachTerm() const override;
|
||||
|
||||
private:
|
||||
void suggestCurrent();
|
||||
void onPackSelectionChanged(Modpack* pack = nullptr);
|
||||
|
||||
@@ -369,4 +369,13 @@ void Page::triggerSearch()
|
||||
currentModel->setSearchTerm(ui->searchEdit->text());
|
||||
}
|
||||
|
||||
void Page::setSearchTerm(QString term)
|
||||
{
|
||||
ui->searchEdit->setText(term);
|
||||
}
|
||||
|
||||
QString Page::getSerachTerm() const
|
||||
{
|
||||
return ui->searchEdit->text();
|
||||
}
|
||||
} // namespace LegacyFTB
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#include "QObjectPtr.h"
|
||||
#include "modplatform/legacy_ftb/PackFetchTask.h"
|
||||
#include "modplatform/legacy_ftb/PackHelpers.h"
|
||||
#include "ui/pages/BasePage.h"
|
||||
#include "ui/pages/modplatform/ModpackProviderBasePage.h"
|
||||
|
||||
class NewInstanceDialog;
|
||||
|
||||
@@ -57,7 +57,7 @@ class ListModel;
|
||||
class FilterModel;
|
||||
class PrivatePackManager;
|
||||
|
||||
class Page : public QWidget, public BasePage {
|
||||
class Page : public QWidget, public ModpackProviderBasePage {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@@ -71,6 +71,11 @@ class Page : public QWidget, public BasePage {
|
||||
void openedImpl() override;
|
||||
void retranslate() override;
|
||||
|
||||
/** Programatically set the term in the search bar. */
|
||||
virtual void setSearchTerm(QString) override;
|
||||
/** Get the current term in the search bar. */
|
||||
[[nodiscard]] virtual QString getSerachTerm() const override;
|
||||
|
||||
private:
|
||||
void suggestCurrent();
|
||||
void onPackSelectionChanged(Modpack* pack = nullptr);
|
||||
|
||||
@@ -351,3 +351,13 @@ void ModrinthPage::onVersionSelectionChanged(int index)
|
||||
selectedVersion = ui->versionSelectionBox->currentData().toString();
|
||||
suggestCurrent();
|
||||
}
|
||||
|
||||
void ModrinthPage::setSearchTerm(QString term)
|
||||
{
|
||||
ui->searchEdit->setText(term);
|
||||
}
|
||||
|
||||
QString ModrinthPage::getSerachTerm() const
|
||||
{
|
||||
return ui->searchEdit->text();
|
||||
}
|
||||
|
||||
@@ -38,9 +38,9 @@
|
||||
|
||||
#include "Application.h"
|
||||
#include "ui/dialogs/NewInstanceDialog.h"
|
||||
#include "ui/pages/BasePage.h"
|
||||
|
||||
#include "modplatform/modrinth/ModrinthPackManifest.h"
|
||||
#include "ui/pages/modplatform/ModpackProviderBasePage.h"
|
||||
#include "ui/widgets/ProgressWidget.h"
|
||||
|
||||
#include <QTimer>
|
||||
@@ -54,7 +54,7 @@ namespace Modrinth {
|
||||
class ModpackListModel;
|
||||
}
|
||||
|
||||
class ModrinthPage : public QWidget, public BasePage {
|
||||
class ModrinthPage : public QWidget, public ModpackProviderBasePage {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@@ -78,6 +78,11 @@ class ModrinthPage : public QWidget, public BasePage {
|
||||
void openedImpl() override;
|
||||
bool eventFilter(QObject* watched, QEvent* event) override;
|
||||
|
||||
/** Programatically set the term in the search bar. */
|
||||
virtual void setSearchTerm(QString) override;
|
||||
/** Get the current term in the search bar. */
|
||||
[[nodiscard]] virtual QString getSerachTerm() const override;
|
||||
|
||||
private slots:
|
||||
void onSelectionChanged(QModelIndex first, QModelIndex second);
|
||||
void onVersionSelectionChanged(int index);
|
||||
|
||||
@@ -154,6 +154,10 @@ void Technic::ListModel::performSearch()
|
||||
QString("%1search?build=%2&q=%3").arg(BuildConfig.TECHNIC_API_BASE_URL, BuildConfig.TECHNIC_API_BUILD, currentSearchTerm);
|
||||
searchMode = List;
|
||||
}
|
||||
auto clientId = APPLICATION->settings()->get("TechnicClientID").toString();
|
||||
if (!clientId.isEmpty()) {
|
||||
searchUrl += "?cid=" + clientId;
|
||||
}
|
||||
netJob->addNetAction(Net::ApiDownload::makeByteArray(QUrl(searchUrl), response));
|
||||
jobPtr = netJob;
|
||||
jobPtr->start();
|
||||
|
||||
@@ -342,3 +342,13 @@ void TechnicPage::onVersionSelectionChanged(QString version)
|
||||
selectedVersion = version;
|
||||
selectVersion();
|
||||
}
|
||||
|
||||
void TechnicPage::setSearchTerm(QString term)
|
||||
{
|
||||
ui->searchEdit->setText(term);
|
||||
}
|
||||
|
||||
QString TechnicPage::getSerachTerm() const
|
||||
{
|
||||
return ui->searchEdit->text();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include <Application.h>
|
||||
#include "TechnicData.h"
|
||||
#include "net/NetJob.h"
|
||||
#include "ui/pages/BasePage.h"
|
||||
#include "ui/pages/modplatform/ModpackProviderBasePage.h"
|
||||
#include "ui/widgets/ProgressWidget.h"
|
||||
|
||||
namespace Ui {
|
||||
@@ -54,7 +54,7 @@ namespace Technic {
|
||||
class ListModel;
|
||||
}
|
||||
|
||||
class TechnicPage : public QWidget, public BasePage {
|
||||
class TechnicPage : public QWidget, public ModpackProviderBasePage {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@@ -71,6 +71,11 @@ class TechnicPage : public QWidget, public BasePage {
|
||||
|
||||
bool eventFilter(QObject* watched, QEvent* event) override;
|
||||
|
||||
/** Programatically set the term in the search bar. */
|
||||
virtual void setSearchTerm(QString) override;
|
||||
/** Get the current term in the search bar. */
|
||||
[[nodiscard]] virtual QString getSerachTerm() const override;
|
||||
|
||||
private:
|
||||
void suggestCurrent();
|
||||
void metadataLoaded();
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>We've added a feature to automatically download the correct Java version for each version of Minecraft(this can be changed in the Java Settings). Would you like to enable or disable this feature?</string>
|
||||
<string>We've added a feature to automatically download the correct Java version for each version of Minecraft (this can be changed in the Java Settings). Would you like to enable or disable this feature?</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
|
||||
@@ -83,6 +83,6 @@ void JavaWizardPage::retranslate()
|
||||
{
|
||||
setTitle(tr("Java"));
|
||||
setSubTitle(
|
||||
tr("Please select how much memory to allocate to instances and if Prism Launcher should manage java automatically or manually."));
|
||||
tr("Please select how much memory to allocate to instances and if Prism Launcher should manage Java automatically or manually."));
|
||||
m_java_widget->retranslate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user