#include "tasks/ConcurrentTask.h"
-SequentialTask::SequentialTask(QObject* parent, QString task_name) : ConcurrentTask(parent, task_name, 1) {}
+SequentialTask::SequentialTask(QString task_name) : ConcurrentTask(task_name, 1) {}
void SequentialTask::subTaskFailed(Task::Ptr task, const QString& msg)
{
diff --git a/launcher/tasks/SequentialTask.h b/launcher/tasks/SequentialTask.h
index a7c101ab4..77cd4387f 100644
--- a/launcher/tasks/SequentialTask.h
+++ b/launcher/tasks/SequentialTask.h
@@ -47,7 +47,7 @@
class SequentialTask : public ConcurrentTask {
Q_OBJECT
public:
- explicit SequentialTask(QObject* parent = nullptr, QString task_name = "");
+ explicit SequentialTask(QString task_name = "");
~SequentialTask() override = default;
protected slots:
diff --git a/launcher/tasks/Task.cpp b/launcher/tasks/Task.cpp
index b17096ca7..1871c5df8 100644
--- a/launcher/tasks/Task.cpp
+++ b/launcher/tasks/Task.cpp
@@ -40,7 +40,7 @@
Q_LOGGING_CATEGORY(taskLogC, "launcher.task")
-Task::Task(QObject* parent, bool show_debug) : QObject(parent), m_show_debug(show_debug)
+Task::Task(bool show_debug) : m_show_debug(show_debug)
{
m_uid = QUuid::createUuid();
setAutoDelete(false);
diff --git a/launcher/tasks/Task.h b/launcher/tasks/Task.h
index 883408c97..e712700a1 100644
--- a/launcher/tasks/Task.h
+++ b/launcher/tasks/Task.h
@@ -87,7 +87,7 @@ class Task : public QObject, public QRunnable {
enum class State { Inactive, Running, Succeeded, Failed, AbortedByUser };
public:
- explicit Task(QObject* parent = 0, bool show_debug_log = true);
+ explicit Task(bool show_debug_log = true);
virtual ~Task() = default;
bool isRunning() const;
diff --git a/launcher/ui/dialogs/AboutDialog.cpp b/launcher/ui/dialogs/AboutDialog.cpp
index d086704c4..fb9a5c298 100644
--- a/launcher/ui/dialogs/AboutDialog.cpp
+++ b/launcher/ui/dialogs/AboutDialog.cpp
@@ -102,7 +102,7 @@ QString getCreditsHtml()
stream << QString("d-513 %1
\n").arg(getGitHub("d-513"));
stream << QString("txtsd %1
\n").arg(getWebsite("https://ihavea.quest"));
stream << QString("timoreo %1
\n").arg(getGitHub("timoreo22"));
- stream << QString("Ezekiel Smith (ZekeSmith) %1
\n").arg(getGitHub("ZekeSmith"));
+ stream << QString("ZekeZ %1
\n").arg(getGitHub("ZekeZDev"));
stream << QString("cozyGalvinism %1
\n").arg(getGitHub("cozyGalvinism"));
stream << QString("DioEgizio %1
\n").arg(getGitHub("DioEgizio"));
stream << QString("flowln %1
\n").arg(getGitHub("flowln"));
@@ -126,7 +126,7 @@ QString getCreditsHtml()
stream << "" << QObject::tr("With thanks to", "About Credits") << "
\n";
stream << QString("Boba %1
\n").arg(getWebsite("https://bobaonline.neocities.org/"));
- stream << QString("Davi Rafael %1
\n").arg(getWebsite("https://auti.one/"));
+ stream << QString("AutiOne %1
\n").arg(getWebsite("https://auti.one/"));
stream << QString("Fulmine %1
\n").arg(getWebsite("https://fulmine.xyz/"));
stream << QString("ely %1
\n").arg(getGitHub("elyrodso"));
stream << QString("gon sawa %1
\n").arg(getGitHub("gonsawa"));
diff --git a/launcher/ui/dialogs/BlockedModsDialog.cpp b/launcher/ui/dialogs/BlockedModsDialog.cpp
index 5c93053d1..b3b6d2bcc 100644
--- a/launcher/ui/dialogs/BlockedModsDialog.cpp
+++ b/launcher/ui/dialogs/BlockedModsDialog.cpp
@@ -46,11 +46,13 @@ BlockedModsDialog::BlockedModsDialog(QWidget* parent, const QString& title, cons
: QDialog(parent), ui(new Ui::BlockedModsDialog), m_mods(mods), m_hash_type(hash_type)
{
m_hashing_task = shared_qobject_ptr(
- new ConcurrentTask(this, "MakeHashesTask", APPLICATION->settings()->get("NumberOfConcurrentTasks").toInt()));
+ new ConcurrentTask("MakeHashesTask", APPLICATION->settings()->get("NumberOfConcurrentTasks").toInt()));
connect(m_hashing_task.get(), &Task::finished, this, &BlockedModsDialog::hashTaskFinished);
ui->setupUi(this);
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
m_openMissingButton = ui->buttonBox->addButton(tr("Open Missing"), QDialogButtonBox::ActionRole);
connect(m_openMissingButton, &QPushButton::clicked, this, [this]() { openAll(true); });
diff --git a/launcher/ui/dialogs/CopyInstanceDialog.cpp b/launcher/ui/dialogs/CopyInstanceDialog.cpp
index 770741a61..e5c2c301b 100644
--- a/launcher/ui/dialogs/CopyInstanceDialog.cpp
+++ b/launcher/ui/dialogs/CopyInstanceDialog.cpp
@@ -109,6 +109,9 @@ CopyInstanceDialog::CopyInstanceDialog(InstancePtr original, QWidget* parent)
auto HelpButton = ui->buttonBox->button(QDialogButtonBox::Help);
connect(HelpButton, &QPushButton::clicked, this, &CopyInstanceDialog::help);
+ HelpButton->setText(tr("Help"));
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
}
CopyInstanceDialog::~CopyInstanceDialog()
diff --git a/launcher/ui/dialogs/EditAccountDialog.cpp b/launcher/ui/dialogs/EditAccountDialog.cpp
index 58036fd82..9d0175bbc 100644
--- a/launcher/ui/dialogs/EditAccountDialog.cpp
+++ b/launcher/ui/dialogs/EditAccountDialog.cpp
@@ -15,6 +15,7 @@
#include "EditAccountDialog.h"
#include
+#include
#include
#include "ui_EditAccountDialog.h"
@@ -27,6 +28,9 @@ EditAccountDialog::EditAccountDialog(const QString& text, QWidget* parent, int f
ui->userTextBox->setEnabled(flags & UsernameField);
ui->passTextBox->setEnabled(flags & PasswordField);
+
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
}
EditAccountDialog::~EditAccountDialog()
diff --git a/launcher/ui/dialogs/ExportInstanceDialog.cpp b/launcher/ui/dialogs/ExportInstanceDialog.cpp
index 9f2b3ac42..d25cd32b6 100644
--- a/launcher/ui/dialogs/ExportInstanceDialog.cpp
+++ b/launcher/ui/dialogs/ExportInstanceDialog.cpp
@@ -51,6 +51,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -85,6 +86,9 @@ ExportInstanceDialog::ExportInstanceDialog(InstancePtr instance, QWidget* parent
auto headerView = ui->treeView->header();
headerView->setSectionResizeMode(QHeaderView::ResizeToContents);
headerView->setSectionResizeMode(0, QHeaderView::Stretch);
+
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
}
ExportInstanceDialog::~ExportInstanceDialog()
diff --git a/launcher/ui/dialogs/ExportPackDialog.cpp b/launcher/ui/dialogs/ExportPackDialog.cpp
index 0278c6cb0..ed79a741f 100644
--- a/launcher/ui/dialogs/ExportPackDialog.cpp
+++ b/launcher/ui/dialogs/ExportPackDialog.cpp
@@ -103,6 +103,9 @@ ExportPackDialog::ExportPackDialog(InstancePtr instance, QWidget* parent, ModPla
QHeaderView* headerView = ui->files->header();
headerView->setSectionResizeMode(QHeaderView::ResizeToContents);
headerView->setSectionResizeMode(0, QHeaderView::Stretch);
+
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
}
ExportPackDialog::~ExportPackDialog()
diff --git a/launcher/ui/dialogs/ExportToModListDialog.cpp b/launcher/ui/dialogs/ExportToModListDialog.cpp
index 908743ab0..c2ba68f7a 100644
--- a/launcher/ui/dialogs/ExportToModListDialog.cpp
+++ b/launcher/ui/dialogs/ExportToModListDialog.cpp
@@ -64,6 +64,9 @@ ExportToModListDialog::ExportToModListDialog(QString name, QList mods, QWi
this->ui->finalText->selectAll();
this->ui->finalText->copy();
});
+
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Save)->setText(tr("Save"));
triggerImp();
}
diff --git a/launcher/ui/dialogs/IconPickerDialog.cpp b/launcher/ui/dialogs/IconPickerDialog.cpp
index a196fd587..a7b44eab0 100644
--- a/launcher/ui/dialogs/IconPickerDialog.cpp
+++ b/launcher/ui/dialogs/IconPickerDialog.cpp
@@ -63,6 +63,9 @@ IconPickerDialog::IconPickerDialog(QWidget* parent) : QDialog(parent), ui(new Ui
auto buttonAdd = ui->buttonBox->addButton(tr("Add Icon"), QDialogButtonBox::ResetRole);
buttonRemove = ui->buttonBox->addButton(tr("Remove Icon"), QDialogButtonBox::ResetRole);
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
+
connect(buttonAdd, SIGNAL(clicked(bool)), SLOT(addNewIcon()));
connect(buttonRemove, SIGNAL(clicked(bool)), SLOT(removeSelectedIcon()));
diff --git a/launcher/ui/dialogs/ImportResourceDialog.cpp b/launcher/ui/dialogs/ImportResourceDialog.cpp
index 84b692730..e3a1e9a6c 100644
--- a/launcher/ui/dialogs/ImportResourceDialog.cpp
+++ b/launcher/ui/dialogs/ImportResourceDialog.cpp
@@ -45,6 +45,9 @@ ImportResourceDialog::ImportResourceDialog(QString file_path, PackedResourceType
ui->label->setText(
tr("Choose the instance you would like to import this %1 to.").arg(ResourceUtils::getPackedTypeName(m_resource_type)));
ui->label_file_path->setText(tr("File: %1").arg(m_file_path));
+
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
}
void ImportResourceDialog::activated(QModelIndex index)
diff --git a/launcher/ui/dialogs/InstallLoaderDialog.cpp b/launcher/ui/dialogs/InstallLoaderDialog.cpp
index 8e5463b31..7082125f2 100644
--- a/launcher/ui/dialogs/InstallLoaderDialog.cpp
+++ b/launcher/ui/dialogs/InstallLoaderDialog.cpp
@@ -104,6 +104,8 @@ InstallLoaderDialog::InstallLoaderDialog(std::shared_ptr profile, c
buttons->setOrientation(Qt::Horizontal);
buttons->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
+ buttons->button(QDialogButtonBox::Ok)->setText(tr("Ok"));
+ buttons->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
buttonLayout->addWidget(buttons);
diff --git a/launcher/ui/dialogs/MSALoginDialog.cpp b/launcher/ui/dialogs/MSALoginDialog.cpp
index 1490cc158..f7748142e 100644
--- a/launcher/ui/dialogs/MSALoginDialog.cpp
+++ b/launcher/ui/dialogs/MSALoginDialog.cpp
@@ -68,6 +68,8 @@ MSALoginDialog::MSALoginDialog(QWidget* parent) : QDialog(parent), ui(new Ui::MS
}
}
});
+
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
}
int MSALoginDialog::exec()
@@ -83,7 +85,7 @@ int MSALoginDialog::exec()
connect(m_authflow_task.get(), &AuthFlow::authorizeWithBrowserWithExtra, this, &MSALoginDialog::authorizeWithBrowserWithExtra);
connect(ui->buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, m_authflow_task.get(), &Task::abort);
- m_devicecode_task.reset(new AuthFlow(m_account->accountData(), AuthFlow::Action::DeviceCode, this));
+ m_devicecode_task.reset(new AuthFlow(m_account->accountData(), AuthFlow::Action::DeviceCode));
connect(m_devicecode_task.get(), &Task::failed, this, &MSALoginDialog::onTaskFailed);
connect(m_devicecode_task.get(), &Task::succeeded, this, &QDialog::accept);
connect(m_devicecode_task.get(), &Task::aborted, this, &MSALoginDialog::reject);
diff --git a/launcher/ui/dialogs/ModUpdateDialog.cpp b/launcher/ui/dialogs/ModUpdateDialog.cpp
index f906cfcea..81f544a90 100644
--- a/launcher/ui/dialogs/ModUpdateDialog.cpp
+++ b/launcher/ui/dialogs/ModUpdateDialog.cpp
@@ -8,6 +8,7 @@
#include "minecraft/mod/tasks/GetModDependenciesTask.h"
#include "modplatform/ModIndex.h"
#include "modplatform/flame/FlameAPI.h"
+#include "tasks/SequentialTask.h"
#include "ui_ReviewMessageBox.h"
#include "Markdown.h"
@@ -45,8 +46,7 @@ ModUpdateDialog::ModUpdateDialog(QWidget* parent,
, m_parent(parent)
, m_mod_model(mods)
, m_candidates(search_for)
- , m_second_try_metadata(
- new ConcurrentTask(nullptr, "Second Metadata Search", APPLICATION->settings()->get("NumberOfConcurrentTasks").toInt()))
+ , m_second_try_metadata(new ConcurrentTask("Second Metadata Search", APPLICATION->settings()->get("NumberOfConcurrentTasks").toInt()))
, m_instance(instance)
, m_include_deps(includeDeps)
{
@@ -89,7 +89,7 @@ void ModUpdateDialog::checkCandidates()
auto versions = mcVersions(m_instance);
auto loadersList = mcLoadersList(m_instance);
- SequentialTask check_task(m_parent, tr("Checking for updates"));
+ SequentialTask check_task(tr("Checking for updates"));
if (!m_modrinth_to_update.empty()) {
m_modrinth_check_task.reset(new ModrinthCheckUpdate(m_modrinth_to_update, versions, loadersList, m_mod_model));
@@ -187,7 +187,7 @@ void ModUpdateDialog::checkCandidates()
}
if (m_include_deps && !APPLICATION->settings()->get("ModDependenciesDisabled").toBool()) { // dependencies
- auto depTask = makeShared(this, m_instance, m_mod_model.get(), selectedVers);
+ auto depTask = makeShared(m_instance, m_mod_model.get(), selectedVers);
connect(depTask.get(), &Task::failed, this,
[&](QString reason) { CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->exec(); });
@@ -261,7 +261,7 @@ auto ModUpdateDialog::ensureMetadata() -> bool
{
auto index_dir = indexDir();
- SequentialTask seq(m_parent, tr("Looking for metadata"));
+ SequentialTask seq(tr("Looking for metadata"));
// A better use of data structures here could remove the need for this QHash
QHash should_try_others;
@@ -403,9 +403,15 @@ void ModUpdateDialog::onMetadataFailed(Mod* mod, bool try_others, ModPlatform::R
connect(task.get(), &EnsureMetadataTask::metadataReady, [this](Mod* candidate) { onMetadataEnsured(candidate); });
connect(task.get(), &EnsureMetadataTask::metadataFailed, [this](Mod* candidate) { onMetadataFailed(candidate, false); });
connect(task.get(), &EnsureMetadataTask::failed,
- [this](QString reason) { CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->exec(); });
-
- m_second_try_metadata->addTask(task);
+ [this](const QString& reason) { CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->exec(); });
+ if (task->getHashingTask()) {
+ auto seq = makeShared();
+ seq->addTask(task->getHashingTask());
+ seq->addTask(task);
+ m_second_try_metadata->addTask(seq);
+ } else {
+ m_second_try_metadata->addTask(task);
+ }
} else {
QString reason{ tr("Couldn't find a valid version on the selected mod provider(s)") };
@@ -418,7 +424,7 @@ void ModUpdateDialog::appendMod(CheckUpdateTask::UpdatableMod const& info, QStri
auto item_top = new QTreeWidgetItem(ui->modTreeWidget);
item_top->setCheckState(0, info.enabled ? Qt::CheckState::Checked : Qt::CheckState::Unchecked);
if (!info.enabled) {
- item_top->setToolTip(0, tr("Mod was disabled as it may be already instaled."));
+ item_top->setToolTip(0, tr("Mod was disabled as it may be already installed."));
}
item_top->setText(0, info.name);
item_top->setExpanded(true);
diff --git a/launcher/ui/dialogs/NewComponentDialog.cpp b/launcher/ui/dialogs/NewComponentDialog.cpp
index b47b85ff1..b5f8ff889 100644
--- a/launcher/ui/dialogs/NewComponentDialog.cpp
+++ b/launcher/ui/dialogs/NewComponentDialog.cpp
@@ -68,6 +68,9 @@ NewComponentDialog::NewComponentDialog(const QString& initialName, const QString
ui->nameTextBox->setFocus();
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
+
originalPlaceholderText = ui->uidTextBox->placeholderText();
updateDialogState();
}
diff --git a/launcher/ui/dialogs/NewInstanceDialog.cpp b/launcher/ui/dialogs/NewInstanceDialog.cpp
index 8477721f0..6501ebd3b 100644
--- a/launcher/ui/dialogs/NewInstanceDialog.cpp
+++ b/launcher/ui/dialogs/NewInstanceDialog.cpp
@@ -110,16 +110,19 @@ NewInstanceDialog::NewInstanceDialog(const QString& initialGroup,
auto OkButton = m_buttons->button(QDialogButtonBox::Ok);
OkButton->setDefault(true);
OkButton->setAutoDefault(true);
+ OkButton->setText(tr("OK"));
connect(OkButton, &QPushButton::clicked, this, &NewInstanceDialog::accept);
auto CancelButton = m_buttons->button(QDialogButtonBox::Cancel);
CancelButton->setDefault(false);
CancelButton->setAutoDefault(false);
+ CancelButton->setText(tr("Cancel"));
connect(CancelButton, &QPushButton::clicked, this, &NewInstanceDialog::reject);
auto HelpButton = m_buttons->button(QDialogButtonBox::Help);
HelpButton->setDefault(false);
HelpButton->setAutoDefault(false);
+ HelpButton->setText(tr("Help"));
connect(HelpButton, &QPushButton::clicked, m_container, &PageContainer::help);
if (!url.isEmpty()) {
diff --git a/launcher/ui/dialogs/OfflineLoginDialog.cpp b/launcher/ui/dialogs/OfflineLoginDialog.cpp
index b9d1c2915..d8fbc04fd 100644
--- a/launcher/ui/dialogs/OfflineLoginDialog.cpp
+++ b/launcher/ui/dialogs/OfflineLoginDialog.cpp
@@ -9,6 +9,9 @@ OfflineLoginDialog::OfflineLoginDialog(QWidget* parent) : QDialog(parent), ui(ne
ui->progressBar->setVisible(false);
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
+
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
diff --git a/launcher/ui/dialogs/ProfileSelectDialog.cpp b/launcher/ui/dialogs/ProfileSelectDialog.cpp
index fe03e1b6b..95bdf99a9 100644
--- a/launcher/ui/dialogs/ProfileSelectDialog.cpp
+++ b/launcher/ui/dialogs/ProfileSelectDialog.cpp
@@ -18,6 +18,7 @@
#include
#include
+#include
#include "Application.h"
@@ -70,6 +71,9 @@ ProfileSelectDialog::ProfileSelectDialog(const QString& message, int flags, QWid
ui->listView->setCurrentIndex(ui->listView->model()->index(0, 0));
connect(ui->listView, SIGNAL(doubleClicked(QModelIndex)), SLOT(on_buttonBox_accepted()));
+
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
}
ProfileSelectDialog::~ProfileSelectDialog()
diff --git a/launcher/ui/dialogs/ProfileSetupDialog.cpp b/launcher/ui/dialogs/ProfileSetupDialog.cpp
index 385094e23..a6512784f 100644
--- a/launcher/ui/dialogs/ProfileSetupDialog.cpp
+++ b/launcher/ui/dialogs/ProfileSetupDialog.cpp
@@ -70,6 +70,9 @@ ProfileSetupDialog::ProfileSetupDialog(MinecraftAccountPtr accountToSetup, QWidg
connect(&checkStartTimer, &QTimer::timeout, this, &ProfileSetupDialog::startCheck);
setNameStatus(NameStatus::NotSet, QString());
+
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
}
ProfileSetupDialog::~ProfileSetupDialog()
diff --git a/launcher/ui/dialogs/ResourceDownloadDialog.cpp b/launcher/ui/dialogs/ResourceDownloadDialog.cpp
index 02a8454b4..06fa6dbf3 100644
--- a/launcher/ui/dialogs/ResourceDownloadDialog.cpp
+++ b/launcher/ui/dialogs/ResourceDownloadDialog.cpp
@@ -298,7 +298,7 @@ GetModDependenciesTask::Ptr ModDownloadDialog::getModDependenciesTask()
selectedVers.append(std::make_shared(selected->getPack(), selected->getVersion()));
}
- return makeShared(this, m_instance, model, selectedVers);
+ return makeShared(m_instance, model, selectedVers);
}
}
return nullptr;
diff --git a/launcher/ui/dialogs/ReviewMessageBox.cpp b/launcher/ui/dialogs/ReviewMessageBox.cpp
index 66c36d400..96cc8149f 100644
--- a/launcher/ui/dialogs/ReviewMessageBox.cpp
+++ b/launcher/ui/dialogs/ReviewMessageBox.cpp
@@ -20,6 +20,9 @@ ReviewMessageBox::ReviewMessageBox(QWidget* parent, [[maybe_unused]] QString con
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &ReviewMessageBox::accept);
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &ReviewMessageBox::reject);
+
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
}
ReviewMessageBox::~ReviewMessageBox()
@@ -38,7 +41,7 @@ void ReviewMessageBox::appendResource(ResourceInformation&& info)
itemTop->setCheckState(0, info.enabled ? Qt::CheckState::Checked : Qt::CheckState::Unchecked);
itemTop->setText(0, info.name);
if (!info.enabled) {
- itemTop->setToolTip(0, tr("Mod was disabled as it may be already instaled."));
+ itemTop->setToolTip(0, tr("Mod was disabled as it may be already installed."));
}
auto filenameItem = new QTreeWidgetItem(itemTop);
diff --git a/launcher/ui/dialogs/ScrollMessageBox.cpp b/launcher/ui/dialogs/ScrollMessageBox.cpp
index c04d87842..1cfb848f4 100644
--- a/launcher/ui/dialogs/ScrollMessageBox.cpp
+++ b/launcher/ui/dialogs/ScrollMessageBox.cpp
@@ -1,4 +1,5 @@
#include "ScrollMessageBox.h"
+#include
#include "ui_ScrollMessageBox.h"
ScrollMessageBox::ScrollMessageBox(QWidget* parent, const QString& title, const QString& text, const QString& body)
@@ -8,6 +9,9 @@ ScrollMessageBox::ScrollMessageBox(QWidget* parent, const QString& title, const
this->setWindowTitle(title);
ui->label->setText(text);
ui->textBrowser->setText(body);
+
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
}
ScrollMessageBox::~ScrollMessageBox()
diff --git a/launcher/ui/dialogs/VersionSelectDialog.cpp b/launcher/ui/dialogs/VersionSelectDialog.cpp
index 876d7470e..30377288b 100644
--- a/launcher/ui/dialogs/VersionSelectDialog.cpp
+++ b/launcher/ui/dialogs/VersionSelectDialog.cpp
@@ -68,6 +68,9 @@ VersionSelectDialog::VersionSelectDialog(BaseVersionList* vlist, QString title,
m_buttonBox->setObjectName(QStringLiteral("buttonBox"));
m_buttonBox->setOrientation(Qt::Horizontal);
m_buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
+
+ m_buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Ok"));
+ m_buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
m_horizontalLayout->addWidget(m_buttonBox);
m_verticalLayout->addLayout(m_horizontalLayout);
diff --git a/launcher/ui/dialogs/skins/SkinManageDialog.cpp b/launcher/ui/dialogs/skins/SkinManageDialog.cpp
index f992429fe..e6e21e147 100644
--- a/launcher/ui/dialogs/skins/SkinManageDialog.cpp
+++ b/launcher/ui/dialogs/skins/SkinManageDialog.cpp
@@ -93,6 +93,9 @@ SkinManageDialog::SkinManageDialog(QWidget* parent, MinecraftAccountPtr acct)
setupCapes();
ui->listView->setCurrentIndex(m_list.index(m_list.getSelectedAccountSkin()));
+
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
}
SkinManageDialog::~SkinManageDialog()
@@ -139,6 +142,9 @@ void SkinManageDialog::on_fileBtn_clicked()
{
auto filter = QMimeDatabase().mimeTypeForName("image/png").filterString();
QString raw_path = QFileDialog::getOpenFileName(this, tr("Select Skin Texture"), QString(), filter);
+ if (raw_path.isNull()) {
+ return;
+ }
auto message = m_list.installSkin(raw_path, {});
if (!message.isEmpty()) {
CustomMessageBox::selectable(this, tr("Selected file is not a valid skin"), message, QMessageBox::Critical)->show();
diff --git a/launcher/ui/java/InstallJavaDialog.cpp b/launcher/ui/java/InstallJavaDialog.cpp
index 0ece3220b..5f69b9d46 100644
--- a/launcher/ui/java/InstallJavaDialog.cpp
+++ b/launcher/ui/java/InstallJavaDialog.cpp
@@ -132,9 +132,9 @@ class InstallJavaPage : public QWidget, public BasePage {
m_recommended_majors = majors;
recommendedFilterChanged();
}
- void setRecomend(bool recomend)
+ void setRecommend(bool recommend)
{
- m_recommend = recomend;
+ m_recommend = recommend;
recommendedFilterChanged();
}
void recommendedFilterChanged()
@@ -202,7 +202,7 @@ InstallDialog::InstallDialog(const QString& uid, BaseInstance* instance, QWidget
recommendedCheckBox->setCheckState(Qt::CheckState::Checked);
connect(recommendedCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
for (BasePage* page : container->getPages()) {
- pageCast(page)->setRecomend(state == Qt::Checked);
+ pageCast(page)->setRecommend(state == Qt::Checked);
}
});
@@ -212,6 +212,7 @@ InstallDialog::InstallDialog(const QString& uid, BaseInstance* instance, QWidget
buttons->setOrientation(Qt::Horizontal);
buttons->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
buttons->button(QDialogButtonBox::Ok)->setText(tr("Download"));
+ buttons->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
buttonLayout->addWidget(buttons);
@@ -260,7 +261,7 @@ InstallDialog::InstallDialog(const QString& uid, BaseInstance* instance, QWidget
container->selectPage(page->id());
auto cast = pageCast(page);
- cast->setRecomend(true);
+ cast->setRecommend(true);
connect(cast, &InstallJavaPage::selectionChanged, this, [this, cast] { validate(cast); });
if (!recommendedJavas.isEmpty()) {
cast->setRecommendedMajors(recommendedJavas);
@@ -316,7 +317,7 @@ void InstallDialog::done(int result)
deletePath();
}
#if defined(Q_OS_MACOS)
- auto seq = makeShared(this, tr("Install Java"));
+ auto seq = makeShared(tr("Install Java"));
seq->addTask(task);
seq->addTask(makeShared(final_path));
task = seq;
@@ -343,4 +344,4 @@ void InstallDialog::done(int result)
} // namespace Java
-#include "InstallJavaDialog.moc"
\ No newline at end of file
+#include "InstallJavaDialog.moc"
diff --git a/launcher/ui/pagedialog/PageDialog.cpp b/launcher/ui/pagedialog/PageDialog.cpp
index 6514217cd..d211cb4d3 100644
--- a/launcher/ui/pagedialog/PageDialog.cpp
+++ b/launcher/ui/pagedialog/PageDialog.cpp
@@ -39,6 +39,8 @@ PageDialog::PageDialog(BasePageProvider* pageProvider, QString defaultId, QWidge
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Close);
buttons->button(QDialogButtonBox::Close)->setDefault(true);
+ buttons->button(QDialogButtonBox::Close)->setText(tr("Close"));
+ buttons->button(QDialogButtonBox::Help)->setText(tr("Help"));
buttons->setContentsMargins(6, 0, 6, 0);
m_container->addButtons(buttons);
diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui
index c5244eb1a..a46a6fd5d 100644
--- a/launcher/ui/pages/global/LauncherPage.ui
+++ b/launcher/ui/pages/global/LauncherPage.ui
@@ -35,7 +35,7 @@
- QTabWidget::Rounded
+ QTabWidget::TabShape::Rounded
0
@@ -46,333 +46,339 @@
-
-
-
- Update Settings
+
+
+ Qt::ScrollBarPolicy::ScrollBarAlwaysOff
-
-
-
-
-
- Check for updates automatically
-
-
-
- -
-
-
-
-
-
- Update interval
-
-
-
- -
-
-
- Set it to 0 to only check on launch
-
-
- h
-
-
- 0
-
-
- 99999999
-
-
-
-
-
-
+
+ true
+
+
+
+
+ 0
+ 0
+ 473
+ 770
+
+
+
+ -
+
+
+ Update Settings
+
+
+
-
+
+
+ Check for updates automatically
+
+
+
+ -
+
+
-
+
+
+ Update interval
+
+
+
+ -
+
+
+ Set it to 0 to only check on launch
+
+
+ h
+
+
+ 0
+
+
+ 99999999
+
+
+
+
+
+
+
+
+ -
+
+
+ Folders
+
+
+
-
+
+
+ &Downloads:
+
+
+ downloadsDirTextBox
+
+
+
+ -
+
+
+ Browse
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ &Skins:
+
+
+ skinsDirTextBox
+
+
+
+ -
+
+
+ &Icons:
+
+
+ iconsDirTextBox
+
+
+
+ -
+
+
+ When enabled, in addition to the downloads folder, its sub folders will also be searched when looking for resources (e.g. when looking for blocked mods on CurseForge).
+
+
+ Check downloads folder recursively
+
+
+
+ -
+
+
+ -
+
+
+ &Java:
+
+
+ javaDirTextBox
+
+
+
+ -
+
+
+ &Mods:
+
+
+ modsDirTextBox
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ Browse
+
+
+
+ -
+
+
+ Browse
+
+
+
+ -
+
+
+ Browse
+
+
+
+ -
+
+
+ I&nstances:
+
+
+ instDirTextBox
+
+
+
+ -
+
+
+ Browse
+
+
+
+ -
+
+
+ Browse
+
+
+
+
+
+
+ -
+
+
+ Mods
+
+
+
-
+
+
+ Disable using metadata provided by mod providers (like Modrinth or CurseForge) for mods.
+
+
+ Disable using metadata for mods
+
+
+
+ -
+
+
+ <html><head/><body><p><span style=" font-weight:600; color:#f5c211;">Warning</span><span style=" color:#f5c211;">: Disabling mod metadata may also disable some QoL features, such as mod updating!</span></p></body></html>
+
+
+ true
+
+
+
+ -
+
+
+ Disable the automatic detection, installation, and updating of mod dependencies.
+
+
+ Disable automatic mod dependency management
+
+
+
+ -
+
+
+ When creating a new modpack instance, do not suggest updating existing instances instead.
+
+
+ Skip modpack update prompt
+
+
+
+
+
+
+ -
+
+
+ Miscellaneous
+
+
+
-
+
+
+ 1
+
+
+
+ -
+
+
+ Number of concurrent tasks
+
+
+
+ -
+
+
+ 1
+
+
+
+ -
+
+
+ Number of concurrent downloads
+
+
+
+ -
+
+
+ Number of manual retries
+
+
+
+ -
+
+
+ 0
+
+
+
+ -
+
+
+ Seconds to wait until the requests are terminated
+
+
+ Timeout for HTTP requests
+
+
+
+ -
+
+
+ s
+
+
+
+
+
+
+ -
+
+
+ Qt::Orientation::Vertical
+
+
+
+ 0
+ 0
+
+
+
+
+
+
- -
-
-
- Folders
-
-
-
-
-
-
- &Downloads:
-
-
- downloadsDirTextBox
-
-
-
- -
-
-
- Browse
-
-
-
- -
-
-
- -
-
-
- -
-
-
- &Skins:
-
-
- skinsDirTextBox
-
-
-
- -
-
-
- &Icons:
-
-
- iconsDirTextBox
-
-
-
- -
-
-
- When enabled, in addition to the downloads folder, its sub folders will also be searched when looking for resources (e.g. when looking for blocked mods on CurseForge).
-
-
- Check downloads folder recursively
-
-
-
- -
-
-
- -
-
-
- &Java:
-
-
- javaDirTextBox
-
-
-
- -
-
-
- &Mods:
-
-
- modsDirTextBox
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- Browse
-
-
-
- -
-
-
- Browse
-
-
-
- -
-
-
- Browse
-
-
-
- -
-
-
- I&nstances:
-
-
- instDirTextBox
-
-
-
- -
-
-
- Browse
-
-
-
- -
-
-
- Browse
-
-
-
-
-
-
- -
-
-
- Mods
-
-
-
-
-
-
- Disable using metadata provided by mod providers (like Modrinth or CurseForge) for mods.
-
-
- Disable using metadata for mods
-
-
-
- -
-
-
- <html><head/><body><p><span style=" font-weight:600; color:#f5c211;">Warning</span><span style=" color:#f5c211;">: Disabling mod metadata may also disable some QoL features, such as mod updating!</span></p></body></html>
-
-
- true
-
-
-
- -
-
-
- Disable the automatic detection, installation, and updating of mod dependencies.
-
-
- Disable automatic mod dependency management
-
-
-
- -
-
-
- When creating a new modpack instance, do not suggest updating existing instances instead.
-
-
- Skip modpack update prompt
-
-
-
-
-
-
- -
-
-
- Miscellaneous
-
-
-
-
-
-
- 1
-
-
-
- -
-
-
- Number of concurrent tasks
-
-
-
- -
-
-
- 1
-
-
-
- -
-
-
- Number of concurrent downloads
-
-
-
- -
-
-
- Number of manual retries
-
-
-
- -
-
-
- 0
-
-
-
- -
-
-
- Seconds to wait until the requests are terminated
-
-
- Timeout for HTTP requests
-
-
-
- -
-
-
- s
-
-
-
-
-
-
- -
-
-
- Missing authlib-injector behavior
-
-
-
-
-
-
- What to do when using an authlib-injector account with an instance that does not have authlib-injector installed
-
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 0
- 0
-
-
-
-
@@ -459,7 +465,7 @@
-
- Qt::Horizontal
+ Qt::Orientation::Horizontal
@@ -500,7 +506,7 @@
-
- Qt::Vertical
+ Qt::Orientation::Vertical
@@ -609,13 +615,13 @@
- Qt::ScrollBarAlwaysOff
+ Qt::ScrollBarPolicy::ScrollBarAlwaysOff
false
- Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse
+ Qt::TextInteractionFlag::TextSelectableByKeyboard|Qt::TextInteractionFlag::TextSelectableByMouse
@@ -661,15 +667,33 @@
tabWidget
+ scrollArea
autoUpdateCheckBox
+ updateIntervalSpinBox
instDirTextBox
instDirBrowseBtn
modsDirTextBox
modsDirBrowseBtn
iconsDirTextBox
iconsDirBrowseBtn
+ javaDirTextBox
+ javaDirBrowseBtn
+ skinsDirTextBox
+ skinsDirBrowseBtn
+ downloadsDirTextBox
+ downloadsDirBrowseBtn
+ downloadsDirWatchRecursiveCheckBox
+ metadataDisableBtn
+ dependenciesDisableBtn
+ skipModpackUpdatePromptBtn
+ numberOfConcurrentTasksSpinBox
+ numberOfConcurrentDownloadsSpinBox
+ numberOfManualRetriesSpinBox
+ timeoutSecondsSpinBox
sortLastLaunchedBtn
sortByNameBtn
+ catOpacitySpinBox
+ preferMenuBarCheckBox
showConsoleCheck
autoCloseConsoleCheck
showConsoleErrorCheck
diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp
index f2feb8c7f..8d03b6d9a 100644
--- a/launcher/ui/pages/instance/ModFolderPage.cpp
+++ b/launcher/ui/pages/instance/ModFolderPage.cpp
@@ -124,7 +124,7 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr
ui->actionsToolbar->addAction(ui->actionVisitItemPage);
connect(ui->actionVisitItemPage, &QAction::triggered, this, &ModFolderPage::visitModPages);
- auto changeVersion = new QAction(tr("Change Version"));
+ auto changeVersion = new QAction(tr("Change Version"), this);
changeVersion->setToolTip(tr("Change mod version"));
changeVersion->setEnabled(false);
ui->actionsToolbar->insertActionAfter(ui->actionUpdateItem, changeVersion);
@@ -209,7 +209,7 @@ void ModFolderPage::installMods()
ResourceDownload::ModDownloadDialog mdownload(this, m_model, m_instance);
if (mdownload.exec()) {
- auto tasks = new ConcurrentTask(this, "Download Mods", APPLICATION->settings()->get("NumberOfConcurrentDownloads").toInt());
+ auto tasks = new ConcurrentTask("Download Mods", APPLICATION->settings()->get("NumberOfConcurrentDownloads").toInt());
connect(tasks, &Task::failed, [this, tasks](QString reason) {
CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->show();
tasks->deleteLater();
@@ -292,7 +292,7 @@ void ModFolderPage::updateMods(bool includeDeps)
}
if (update_dialog.exec()) {
- auto tasks = new ConcurrentTask(this, "Download Mods", APPLICATION->settings()->get("NumberOfConcurrentDownloads").toInt());
+ auto tasks = new ConcurrentTask("Download Mods", APPLICATION->settings()->get("NumberOfConcurrentDownloads").toInt());
connect(tasks, &Task::failed, [this, tasks](QString reason) {
CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->show();
tasks->deleteLater();
@@ -423,7 +423,7 @@ void ModFolderPage::changeModVersion()
ResourceDownload::ModDownloadDialog mdownload(this, m_model, m_instance);
mdownload.setModMetadata((*mods_list.begin())->metadata());
if (mdownload.exec()) {
- auto tasks = new ConcurrentTask(this, "Download Mods", APPLICATION->settings()->get("NumberOfConcurrentDownloads").toInt());
+ auto tasks = new ConcurrentTask("Download Mods", APPLICATION->settings()->get("NumberOfConcurrentDownloads").toInt());
connect(tasks, &Task::failed, [this, tasks](QString reason) {
CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->show();
tasks->deleteLater();
diff --git a/launcher/ui/pages/instance/ResourcePackPage.cpp b/launcher/ui/pages/instance/ResourcePackPage.cpp
index 85be64256..054bede01 100644
--- a/launcher/ui/pages/instance/ResourcePackPage.cpp
+++ b/launcher/ui/pages/instance/ResourcePackPage.cpp
@@ -37,8 +37,6 @@
#include "ResourcePackPage.h"
-#include "ResourceDownloadTask.h"
-
#include "ui/dialogs/CustomMessageBox.h"
#include "ui/dialogs/ProgressDialog.h"
#include "ui/dialogs/ResourceDownloadDialog.h"
@@ -72,8 +70,7 @@ void ResourcePackPage::downloadRPs()
ResourceDownload::ResourcePackDownloadDialog mdownload(this, std::static_pointer_cast(m_model), m_instance);
if (mdownload.exec()) {
- auto tasks =
- new ConcurrentTask(this, "Download Resource Pack", APPLICATION->settings()->get("NumberOfConcurrentDownloads").toInt());
+ auto tasks = new ConcurrentTask("Download Resource Pack", APPLICATION->settings()->get("NumberOfConcurrentDownloads").toInt());
connect(tasks, &Task::failed, [this, tasks](QString reason) {
CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->show();
tasks->deleteLater();
diff --git a/launcher/ui/pages/instance/ShaderPackPage.cpp b/launcher/ui/pages/instance/ShaderPackPage.cpp
index 40366a1be..61ee01445 100644
--- a/launcher/ui/pages/instance/ShaderPackPage.cpp
+++ b/launcher/ui/pages/instance/ShaderPackPage.cpp
@@ -65,7 +65,7 @@ void ShaderPackPage::downloadShaders()
ResourceDownload::ShaderPackDownloadDialog mdownload(this, std::static_pointer_cast(m_model), m_instance);
if (mdownload.exec()) {
- auto tasks = new ConcurrentTask(this, "Download Shaders", APPLICATION->settings()->get("NumberOfConcurrentDownloads").toInt());
+ auto tasks = new ConcurrentTask("Download Shaders", APPLICATION->settings()->get("NumberOfConcurrentDownloads").toInt());
connect(tasks, &Task::failed, [this, tasks](QString reason) {
CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->show();
tasks->deleteLater();
diff --git a/launcher/ui/pages/instance/TexturePackPage.cpp b/launcher/ui/pages/instance/TexturePackPage.cpp
index 7c8d7e061..9c8ee3c78 100644
--- a/launcher/ui/pages/instance/TexturePackPage.cpp
+++ b/launcher/ui/pages/instance/TexturePackPage.cpp
@@ -74,8 +74,7 @@ void TexturePackPage::downloadTPs()
ResourceDownload::TexturePackDownloadDialog mdownload(this, std::static_pointer_cast(m_model), m_instance);
if (mdownload.exec()) {
- auto tasks =
- new ConcurrentTask(this, "Download Texture Packs", APPLICATION->settings()->get("NumberOfConcurrentDownloads").toInt());
+ auto tasks = new ConcurrentTask("Download Texture Packs", APPLICATION->settings()->get("NumberOfConcurrentDownloads").toInt());
connect(tasks, &Task::failed, [this, tasks](QString reason) {
CustomMessageBox::selectable(this, tr("Error"), reason, QMessageBox::Critical)->show();
tasks->deleteLater();
diff --git a/launcher/ui/pages/instance/VersionPage.cpp b/launcher/ui/pages/instance/VersionPage.cpp
index 29a503593..e3d7f1f7b 100644
--- a/launcher/ui/pages/instance/VersionPage.cpp
+++ b/launcher/ui/pages/instance/VersionPage.cpp
@@ -243,7 +243,7 @@ void VersionPage::updateButtons(int row)
ui->actionRemove->setEnabled(patch && patch->isRemovable());
ui->actionMove_down->setEnabled(patch && patch->isMoveable());
ui->actionMove_up->setEnabled(patch && patch->isMoveable());
- ui->actionChange_version->setEnabled(patch && patch->isVersionChangeable());
+ ui->actionChange_version->setEnabled(patch && patch->isVersionChangeable(false));
ui->actionEdit->setEnabled(patch && patch->isCustom());
ui->actionCustomize->setEnabled(patch && patch->isCustomizable());
ui->actionRevert->setEnabled(patch && patch->isRevertible());
@@ -435,7 +435,7 @@ void VersionPage::on_actionDownload_All_triggered()
if (updateTasks.isEmpty()) {
return;
}
- auto task = makeShared(this);
+ auto task = makeShared();
for (auto t : updateTasks) {
task->addTask(t);
}
diff --git a/launcher/ui/pages/modplatform/ModPage.cpp b/launcher/ui/pages/modplatform/ModPage.cpp
index c9817cdf7..f0cc2df54 100644
--- a/launcher/ui/pages/modplatform/ModPage.cpp
+++ b/launcher/ui/pages/modplatform/ModPage.cpp
@@ -99,7 +99,7 @@ void ModPage::triggerSearch()
updateSelectionButton();
static_cast(m_model)->searchWithTerm(getSearchTerm(), m_ui->sortByBox->currentData().toUInt(), changed);
- m_fetch_progress.watch(m_model->activeSearchJob().get());
+ m_fetchProgress.watch(m_model->activeSearchJob().get());
}
QMap ModPage::urlHandlers() const
diff --git a/launcher/ui/pages/modplatform/OptionalModDialog.cpp b/launcher/ui/pages/modplatform/OptionalModDialog.cpp
index fc1c8b3cb..5dc53d9dc 100644
--- a/launcher/ui/pages/modplatform/OptionalModDialog.cpp
+++ b/launcher/ui/pages/modplatform/OptionalModDialog.cpp
@@ -43,6 +43,9 @@ OptionalModDialog::OptionalModDialog(QWidget* parent, const QStringList& mods) :
else
item->setCheckState(Qt::Checked);
});
+
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
}
OptionalModDialog::~OptionalModDialog()
diff --git a/launcher/ui/pages/modplatform/ResourcePackPage.cpp b/launcher/ui/pages/modplatform/ResourcePackPage.cpp
index 849ea1111..99039476e 100644
--- a/launcher/ui/pages/modplatform/ResourcePackPage.cpp
+++ b/launcher/ui/pages/modplatform/ResourcePackPage.cpp
@@ -30,7 +30,7 @@ void ResourcePackResourcePage::triggerSearch()
updateSelectionButton();
static_cast(m_model)->searchWithTerm(getSearchTerm(), m_ui->sortByBox->currentData().toUInt());
- m_fetch_progress.watch(m_model->activeSearchJob().get());
+ m_fetchProgress.watch(m_model->activeSearchJob().get());
}
QMap ResourcePackResourcePage::urlHandlers() const
diff --git a/launcher/ui/pages/modplatform/ResourcePage.cpp b/launcher/ui/pages/modplatform/ResourcePage.cpp
index dea28d6d5..766070f20 100644
--- a/launcher/ui/pages/modplatform/ResourcePage.cpp
+++ b/launcher/ui/pages/modplatform/ResourcePage.cpp
@@ -39,6 +39,7 @@
#include "ResourcePage.h"
#include "modplatform/ModIndex.h"
+#include "ui/dialogs/CustomMessageBox.h"
#include "ui_ResourcePage.h"
#include
@@ -54,7 +55,7 @@
namespace ResourceDownload {
ResourcePage::ResourcePage(ResourceDownloadDialog* parent, BaseInstance& base_instance)
- : QWidget(parent), m_base_instance(base_instance), m_ui(new Ui::ResourcePage), m_parent_dialog(parent), m_fetch_progress(this, false)
+ : QWidget(parent), m_baseInstance(base_instance), m_ui(new Ui::ResourcePage), m_parentDialog(parent), m_fetchProgress(this, false)
{
m_ui->setupUi(this);
@@ -63,18 +64,18 @@ ResourcePage::ResourcePage(ResourceDownloadDialog* parent, BaseInstance& base_in
m_ui->versionSelectionBox->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
m_ui->versionSelectionBox->view()->parentWidget()->setMaximumHeight(300);
- m_search_timer.setTimerType(Qt::TimerType::CoarseTimer);
- m_search_timer.setSingleShot(true);
+ m_searchTimer.setTimerType(Qt::TimerType::CoarseTimer);
+ m_searchTimer.setSingleShot(true);
- connect(&m_search_timer, &QTimer::timeout, this, &ResourcePage::triggerSearch);
+ connect(&m_searchTimer, &QTimer::timeout, this, &ResourcePage::triggerSearch);
// hide progress bar to prevent weird artifact
- m_fetch_progress.hide();
- m_fetch_progress.hideIfInactive(true);
- m_fetch_progress.setFixedHeight(24);
- m_fetch_progress.progressFormat("");
+ m_fetchProgress.hide();
+ m_fetchProgress.hideIfInactive(true);
+ m_fetchProgress.setFixedHeight(24);
+ m_fetchProgress.progressFormat("");
- m_ui->verticalLayout->insertWidget(1, &m_fetch_progress);
+ m_ui->verticalLayout->insertWidget(1, &m_fetchProgress);
m_ui->packView->setItemDelegate(new ProjectItemDelegate(this));
m_ui->packView->installEventFilter(this);
@@ -120,10 +121,10 @@ auto ResourcePage::eventFilter(QObject* watched, QEvent* event) -> bool
keyEvent->accept();
return true;
} else {
- if (m_search_timer.isActive())
- m_search_timer.stop();
+ if (m_searchTimer.isActive())
+ m_searchTimer.stop();
- m_search_timer.start(350);
+ m_searchTimer.start(350);
}
} else if (watched == m_ui->packView) {
if (keyEvent->key() == Qt::Key_Return) {
@@ -247,7 +248,7 @@ void ResourcePage::updateUi()
void ResourcePage::updateSelectionButton()
{
- if (!isOpened || m_selected_version_index < 0) {
+ if (!isOpened || m_selectedVersionIndex < 0) {
m_ui->resourceSelectionButton->setEnabled(false);
return;
}
@@ -257,7 +258,7 @@ void ResourcePage::updateSelectionButton()
if (current_pack->versionsLoaded && current_pack->versions.empty()) {
m_ui->resourceSelectionButton->setEnabled(false);
qWarning() << tr("No version available for the selected pack");
- } else if (!current_pack->isVersionSelected(m_selected_version_index))
+ } else if (!current_pack->isVersionSelected(m_selectedVersionIndex))
m_ui->resourceSelectionButton->setText(tr("Select %1 for download").arg(resourceString()));
else
m_ui->resourceSelectionButton->setText(tr("Deselect %1 for download").arg(resourceString()));
@@ -326,18 +327,18 @@ void ResourcePage::onSelectionChanged(QModelIndex curr, [[maybe_unused]] QModelI
void ResourcePage::onVersionSelectionChanged(int index)
{
- m_selected_version_index = index;
+ m_selectedVersionIndex = m_ui->versionSelectionBox->itemData(index).toInt();
updateSelectionButton();
}
void ResourcePage::addResourceToDialog(ModPlatform::IndexedPack::Ptr pack, ModPlatform::IndexedVersion& version)
{
- m_parent_dialog->addResource(pack, version);
+ m_parentDialog->addResource(pack, version);
}
void ResourcePage::removeResourceFromDialog(const QString& pack_name)
{
- m_parent_dialog->removeResource(pack_name);
+ m_parentDialog->removeResource(pack_name);
}
void ResourcePage::addResourceToPage(ModPlatform::IndexedPack::Ptr pack,
@@ -354,14 +355,15 @@ void ResourcePage::removeResourceFromPage(const QString& name)
void ResourcePage::onResourceSelected()
{
- if (m_selected_version_index < 0)
+ if (m_selectedVersionIndex < 0)
return;
auto current_pack = getCurrentPack();
- if (!current_pack || !current_pack->versionsLoaded)
+ if (!current_pack || !current_pack->versionsLoaded || current_pack->versions.size() < m_selectedVersionIndex)
return;
- auto& version = current_pack->versions[m_selected_version_index];
+ auto& version = current_pack->versions[m_selectedVersionIndex];
+ Q_ASSERT(!version.downloadUrl.isNull());
if (version.is_currently_selected)
removeResourceFromDialog(current_pack->name);
else
@@ -400,14 +402,14 @@ void ResourcePage::openUrl(const QUrl& url)
}
}
- if (!page.isNull() && !m_do_not_jump_to_mod) {
+ if (!page.isNull() && !m_doNotJumpToMod) {
const QString slug = match.captured(1);
// ensure the user isn't opening the same mod
if (auto current_pack = getCurrentPack(); current_pack && slug != current_pack->slug) {
- m_parent_dialog->selectPage(page);
+ m_parentDialog->selectPage(page);
- auto newPage = m_parent_dialog->selectedPage();
+ auto newPage = m_parentDialog->selectedPage();
QLineEdit* searchEdit = newPage->m_ui->searchEdit;
auto model = newPage->m_model;
@@ -451,7 +453,7 @@ void ResourcePage::openProject(QVariant projectID)
m_ui->resourceFilterButton->hide();
m_ui->packView->hide();
m_ui->resourceSelectionButton->hide();
- m_do_not_jump_to_mod = true;
+ m_doNotJumpToMod = true;
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
@@ -465,20 +467,23 @@ void ResourcePage::openProject(QVariant projectID)
auto cancelBtn = buttonBox->button(QDialogButtonBox::Cancel);
cancelBtn->setDefault(false);
cancelBtn->setAutoDefault(false);
+ cancelBtn->setText(tr("Cancel"));
connect(okBtn, &QPushButton::clicked, this, [this] {
onResourceSelected();
- m_parent_dialog->accept();
+ m_parentDialog->accept();
});
- connect(cancelBtn, &QPushButton::clicked, m_parent_dialog, &ResourceDownloadDialog::reject);
+ connect(cancelBtn, &QPushButton::clicked, m_parentDialog, &ResourceDownloadDialog::reject);
m_ui->gridLayout_4->addWidget(buttonBox, 1, 2);
- auto jump = [this, okBtn] {
+ connect(m_ui->versionSelectionBox, QOverload::of(&QComboBox::currentIndexChanged), this,
+ [this, okBtn](int index) { okBtn->setEnabled(m_ui->versionSelectionBox->itemData(index).toInt() >= 0); });
+
+ auto jump = [this] {
for (int row = 0; row < m_model->rowCount({}); row++) {
const QModelIndex index = m_model->index(row);
m_ui->packView->setCurrentIndex(index);
- okBtn->setEnabled(true);
return;
}
m_ui->packDescription->setText(tr("The resource was not found"));
diff --git a/launcher/ui/pages/modplatform/ResourcePage.h b/launcher/ui/pages/modplatform/ResourcePage.h
index b625240eb..09c512df4 100644
--- a/launcher/ui/pages/modplatform/ResourcePage.h
+++ b/launcher/ui/pages/modplatform/ResourcePage.h
@@ -62,7 +62,7 @@ class ResourcePage : public QWidget, public BasePage {
[[nodiscard]] bool setCurrentPack(ModPlatform::IndexedPack::Ptr);
[[nodiscard]] auto getCurrentPack() const -> ModPlatform::IndexedPack::Ptr;
- [[nodiscard]] auto getDialog() const -> const ResourceDownloadDialog* { return m_parent_dialog; }
+ [[nodiscard]] auto getDialog() const -> const ResourceDownloadDialog* { return m_parentDialog; }
[[nodiscard]] auto getModel() const -> ResourceModel* { return m_model; }
protected:
@@ -99,22 +99,22 @@ class ResourcePage : public QWidget, public BasePage {
virtual void openUrl(const QUrl&);
public:
- BaseInstance& m_base_instance;
+ BaseInstance& m_baseInstance;
protected:
Ui::ResourcePage* m_ui;
- ResourceDownloadDialog* m_parent_dialog = nullptr;
+ ResourceDownloadDialog* m_parentDialog = nullptr;
ResourceModel* m_model = nullptr;
- int m_selected_version_index = -1;
+ int m_selectedVersionIndex = -1;
- ProgressWidget m_fetch_progress;
+ ProgressWidget m_fetchProgress;
// Used to do instant searching with a delay to cache quick changes
- QTimer m_search_timer;
+ QTimer m_searchTimer;
- bool m_do_not_jump_to_mod = false;
+ bool m_doNotJumpToMod = false;
};
} // namespace ResourceDownload
diff --git a/launcher/ui/pages/modplatform/ShaderPackPage.cpp b/launcher/ui/pages/modplatform/ShaderPackPage.cpp
index ebd8d4ea2..cedf985fb 100644
--- a/launcher/ui/pages/modplatform/ShaderPackPage.cpp
+++ b/launcher/ui/pages/modplatform/ShaderPackPage.cpp
@@ -31,7 +31,7 @@ void ShaderPackResourcePage::triggerSearch()
updateSelectionButton();
static_cast(m_model)->searchWithTerm(getSearchTerm(), m_ui->sortByBox->currentData().toUInt());
- m_fetch_progress.watch(m_model->activeSearchJob().get());
+ m_fetchProgress.watch(m_model->activeSearchJob().get());
}
QMap ShaderPackResourcePage::urlHandlers() const
diff --git a/launcher/ui/pages/modplatform/flame/FlamePage.cpp b/launcher/ui/pages/modplatform/flame/FlamePage.cpp
index 9abf4a9c6..de6b3d633 100644
--- a/launcher/ui/pages/modplatform/flame/FlamePage.cpp
+++ b/launcher/ui/pages/modplatform/flame/FlamePage.cpp
@@ -273,7 +273,7 @@ void FlamePage::suggestCurrent()
void FlamePage::onVersionSelectionChanged(int index)
{
bool is_blocked = false;
- ui->versionSelectionBox->currentData().toInt(&is_blocked);
+ ui->versionSelectionBox->itemData(index).toInt(&is_blocked);
if (index == -1 || is_blocked) {
m_selected_version_index = -1;
diff --git a/launcher/ui/pages/modplatform/flame/FlamePage.ui b/launcher/ui/pages/modplatform/flame/FlamePage.ui
index bceb5d777..7ba515a99 100644
--- a/launcher/ui/pages/modplatform/flame/FlamePage.ui
+++ b/launcher/ui/pages/modplatform/flame/FlamePage.ui
@@ -14,16 +14,16 @@
-
-
-
-
- Search and filter...
+
+
+ Filter options
-
-
-
- Filter
+
+
+ Search and filter...
diff --git a/launcher/ui/pages/modplatform/flame/FlameResourcePages.cpp b/launcher/ui/pages/modplatform/flame/FlameResourcePages.cpp
index ce8c03fa1..4e01f3a65 100644
--- a/launcher/ui/pages/modplatform/flame/FlameResourcePages.cpp
+++ b/launcher/ui/pages/modplatform/flame/FlameResourcePages.cpp
@@ -209,7 +209,7 @@ auto FlameShaderPackPage::shouldDisplay() const -> bool
unique_qobject_ptr FlameModPage::createFilterWidget()
{
- return ModFilterWidget::create(&static_cast(m_base_instance), false, this);
+ return ModFilterWidget::create(&static_cast(m_baseInstance), false, this);
}
void FlameModPage::prepareProviderCategories()
diff --git a/launcher/ui/pages/modplatform/import_ftb/ImportFTBPage.ui b/launcher/ui/pages/modplatform/import_ftb/ImportFTBPage.ui
index 18c604ca4..337c3e474 100644
--- a/launcher/ui/pages/modplatform/import_ftb/ImportFTBPage.ui
+++ b/launcher/ui/pages/modplatform/import_ftb/ImportFTBPage.ui
@@ -13,6 +13,11 @@
-
+
+
+ true
+
+
Note: If your FTB instances are not in the default location, select it using the button next to search.
diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp
index 129f180a2..1b407d556 100644
--- a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp
+++ b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp
@@ -375,7 +375,7 @@ void ModrinthPage::onVersionSelectionChanged(int index)
selectedVersion = "";
return;
}
- selectedVersion = ui->versionSelectionBox->currentData().toString();
+ selectedVersion = ui->versionSelectionBox->itemData(index).toString();
suggestCurrent();
}
diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.ui b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.ui
index ef44abb52..d6e983929 100644
--- a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.ui
+++ b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.ui
@@ -14,16 +14,16 @@
-
-
-
-
- Search and filter...
+
+
+ Filter options
-
-
-
- Filter
+
+
+ Search and filter...
diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthResourcePages.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthResourcePages.cpp
index 85dcde471..4ee620677 100644
--- a/launcher/ui/pages/modplatform/modrinth/ModrinthResourcePages.cpp
+++ b/launcher/ui/pages/modplatform/modrinth/ModrinthResourcePages.cpp
@@ -144,7 +144,7 @@ auto ModrinthShaderPackPage::shouldDisplay() const -> bool
unique_qobject_ptr ModrinthModPage::createFilterWidget()
{
- return ModFilterWidget::create(&static_cast(m_base_instance), true, this);
+ return ModFilterWidget::create(&static_cast(m_baseInstance), true, this);
}
void ModrinthModPage::prepareProviderCategories()
diff --git a/launcher/ui/themes/ThemeManager.cpp b/launcher/ui/themes/ThemeManager.cpp
index 3b6c7a5b5..41ab2e082 100644
--- a/launcher/ui/themes/ThemeManager.cpp
+++ b/launcher/ui/themes/ThemeManager.cpp
@@ -36,6 +36,9 @@
ThemeManager::ThemeManager()
{
+ QIcon::setFallbackThemeName(QIcon::themeName());
+ QIcon::setThemeSearchPaths(QIcon::themeSearchPaths() << m_iconThemeFolder.path());
+
themeDebugLog() << "Determining System Widget Theme...";
const auto& style = QApplication::style();
m_defaultStyle = style->objectName();
@@ -93,10 +96,6 @@ void ThemeManager::initializeIcons()
// set icon theme search path!
themeDebugLog() << "<> Initializing Icon Themes";
- auto searchPaths = QIcon::themeSearchPaths();
- searchPaths.append(m_iconThemeFolder.path());
- QIcon::setThemeSearchPaths(searchPaths);
-
for (const QString& id : builtinIcons) {
IconTheme theme(id, QString(":/icons/%1").arg(id));
if (!theme.load()) {
diff --git a/launcher/ui/widgets/JavaSettingsWidget.cpp b/launcher/ui/widgets/JavaSettingsWidget.cpp
index 2b270c482..6efd3f581 100644
--- a/launcher/ui/widgets/JavaSettingsWidget.cpp
+++ b/launcher/ui/widgets/JavaSettingsWidget.cpp
@@ -460,7 +460,7 @@ void JavaSettingsWidget::checkJavaPath(const QString& path)
}
setJavaStatus(JavaStatus::Pending);
m_checker.reset(
- new JavaChecker(path, "", minHeapSize(), maxHeapSize(), m_permGenSpinBox->isVisible() ? m_permGenSpinBox->value() : 0, 0, this));
+ new JavaChecker(path, "", minHeapSize(), maxHeapSize(), m_permGenSpinBox->isVisible() ? m_permGenSpinBox->value() : 0, 0));
connect(m_checker.get(), &JavaChecker::checkFinished, this, &JavaSettingsWidget::checkFinished);
m_checker->start();
}
diff --git a/launcher/ui/widgets/ThemeCustomizationWidget.cpp b/launcher/ui/widgets/ThemeCustomizationWidget.cpp
index 2108bf56e..07306f5bd 100644
--- a/launcher/ui/widgets/ThemeCustomizationWidget.cpp
+++ b/launcher/ui/widgets/ThemeCustomizationWidget.cpp
@@ -87,7 +87,7 @@ void ThemeCustomizationWidget::applyIconTheme(int index)
{
auto settings = APPLICATION->settings();
auto originalIconTheme = settings->get("IconTheme").toString();
- auto newIconTheme = ui->iconsComboBox->currentData().toString();
+ auto newIconTheme = ui->iconsComboBox->itemData(index).toString();
if (originalIconTheme != newIconTheme) {
settings->set("IconTheme", newIconTheme);
APPLICATION->themeManager()->applyCurrentlySelectedTheme();
@@ -100,7 +100,7 @@ void ThemeCustomizationWidget::applyWidgetTheme(int index)
{
auto settings = APPLICATION->settings();
auto originalAppTheme = settings->get("ApplicationTheme").toString();
- auto newAppTheme = ui->widgetStyleComboBox->currentData().toString();
+ auto newAppTheme = ui->widgetStyleComboBox->itemData(index).toString();
if (originalAppTheme != newAppTheme) {
settings->set("ApplicationTheme", newAppTheme);
APPLICATION->themeManager()->applyCurrentlySelectedTheme();
@@ -113,7 +113,7 @@ void ThemeCustomizationWidget::applyCatTheme(int index)
{
auto settings = APPLICATION->settings();
auto originalCat = settings->get("BackgroundCat").toString();
- auto newCat = ui->backgroundCatComboBox->currentData().toString();
+ auto newCat = ui->backgroundCatComboBox->itemData(index).toString();
if (originalCat != newCat) {
settings->set("BackgroundCat", newCat);
}
diff --git a/launcher/updater/prismupdater/UpdaterDialogs.cpp b/launcher/updater/prismupdater/UpdaterDialogs.cpp
index 06dc161b1..eab3e6bbb 100644
--- a/launcher/updater/prismupdater/UpdaterDialogs.cpp
+++ b/launcher/updater/prismupdater/UpdaterDialogs.cpp
@@ -24,6 +24,7 @@
#include "ui_SelectReleaseDialog.h"
+#include
#include
#include "Markdown.h"
#include "StringUtils.h"
@@ -55,6 +56,9 @@ SelectReleaseDialog::SelectReleaseDialog(const Version& current_version, const Q
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &SelectReleaseDialog::accept);
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &SelectReleaseDialog::reject);
+
+ ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
}
SelectReleaseDialog::~SelectReleaseDialog()
diff --git a/nix/unwrapped.nix b/nix/unwrapped.nix
index a4e12259a..26b598e4e 100644
--- a/nix/unwrapped.nix
+++ b/nix/unwrapped.nix
@@ -15,6 +15,7 @@
stripJavaArchivesHook,
tomlplusplus,
zlib,
+
msaClientID ? null,
gamemodeSupport ? stdenv.isLinux,
version,
@@ -64,7 +65,7 @@ stdenv.mkDerivation {
tomlplusplus
zlib
]
- ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ]
+ ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ]
++ lib.optional gamemodeSupport gamemode;
hardeningEnable = lib.optionals stdenv.isLinux [ "pie" ];
diff --git a/nix/wrapper.nix b/nix/wrapper.nix
index b47af9128..7bbbd4a63 100644
--- a/nix/wrapper.nix
+++ b/nix/wrapper.nix
@@ -54,6 +54,7 @@ assert lib.assertMsg (
let
shatteredprism' = shatteredprism-unwrapped.override { inherit msaClientID gamemodeSupport; };
in
+
symlinkJoin {
name = "shatteredprism-${shatteredprism'.version}";
@@ -96,8 +97,14 @@ symlinkJoin {
let
runtimeLibs =
[
- # lwjgl
- glfw
+ stdenv.cc.cc.lib
+ ## native versions
+ glfw3-minecraft
+ openal
+
+ ## openal
+ alsa-lib
+ libjack2
libpulseaudio
libGL
openal
@@ -123,6 +130,7 @@ symlinkJoin {
pciutils # need lspci
xorg.xrandr # needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
] ++ additionalPrograms;
+
in
[
"--prefix SHATTEREDPRISM_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}"
diff --git a/tests/Task_test.cpp b/tests/Task_test.cpp
index 0740ba0a3..463e78b42 100644
--- a/tests/Task_test.cpp
+++ b/tests/Task_test.cpp
@@ -16,7 +16,7 @@ class BasicTask : public Task {
friend class TaskTest;
public:
- BasicTask(bool show_debug_log = true) : Task(nullptr, show_debug_log) {}
+ BasicTask(bool show_debug_log = true) : Task(show_debug_log) {}
private:
void executeTask() override { emitSucceeded(); }