mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-05 21:06:58 +03:00
Pass option as constructor parameter
Signed-off-by: Dylan Schooner <dschooner05@gmail.com>
This commit is contained in:
parent
55dc9e6a84
commit
11a2ba63b3
6 changed files with 12 additions and 30 deletions
|
|
@ -1073,8 +1073,6 @@ SET(LAUNCHER_SOURCES
|
|||
ui/dialogs/ResourceDownloadDialog.h
|
||||
ui/dialogs/ScrollMessageBox.cpp
|
||||
ui/dialogs/ScrollMessageBox.h
|
||||
ui/dialogs/UpdateCheckFailedDialog.cpp
|
||||
ui/dialogs/UpdateCheckFailedDialog.h
|
||||
ui/dialogs/BlockedModsDialog.cpp
|
||||
ui/dialogs/BlockedModsDialog.h
|
||||
ui/dialogs/ChooseProviderDialog.h
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
#include "ProgressDialog.h"
|
||||
#include "ScrollMessageBox.h"
|
||||
#include "StringUtils.h"
|
||||
#include "UpdateCheckFailedDialog.h"
|
||||
#include "minecraft/mod/tasks/GetModDependenciesTask.h"
|
||||
#include "modplatform/ModIndex.h"
|
||||
#include "modplatform/flame/FlameAPI.h"
|
||||
|
|
@ -176,7 +175,10 @@ void ResourceUpdateDialog::checkCandidates()
|
|||
text += "<br>";
|
||||
}
|
||||
|
||||
UpdateCheckFailedDialog message_dialog(m_parent, text);
|
||||
ScrollMessageBox message_dialog(m_parent, tr("Failed to check for updates"),
|
||||
tr("Could not check or get the following resources for updates:<br>"
|
||||
"Do you wish to proceed without those resources?"),
|
||||
text, "Disable unavailable mods");
|
||||
message_dialog.setModal(true);
|
||||
if (message_dialog.exec() == QDialog::Rejected) {
|
||||
m_aborted = true;
|
||||
|
|
@ -184,7 +186,7 @@ void ResourceUpdateDialog::checkCandidates()
|
|||
return;
|
||||
}
|
||||
|
||||
// Disable incompatible mods
|
||||
// Disable unavailable mods
|
||||
if (message_dialog.isOptionChecked()) {
|
||||
for (const auto& failed : m_failedCheckUpdate) {
|
||||
const auto& mod = std::get<0>(failed);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include <QPushButton>
|
||||
#include "ui_ScrollMessageBox.h"
|
||||
|
||||
ScrollMessageBox::ScrollMessageBox(QWidget* parent, const QString& title, const QString& text, const QString& body)
|
||||
ScrollMessageBox::ScrollMessageBox(QWidget* parent, const QString& title, const QString& text, const QString& body, const QString& option)
|
||||
: QDialog(parent), ui(new Ui::ScrollMessageBox)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
|
@ -10,6 +10,11 @@ ScrollMessageBox::ScrollMessageBox(QWidget* parent, const QString& title, const
|
|||
ui->label->setText(text);
|
||||
ui->textBrowser->setText(body);
|
||||
|
||||
if (!option.isEmpty()) {
|
||||
ui->optionCheckBox->setVisible(true);
|
||||
ui->optionCheckBox->setText(option);
|
||||
}
|
||||
|
||||
ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class ScrollMessageBox : public QDialog {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ScrollMessageBox(QWidget* parent, const QString& title, const QString& text, const QString& body);
|
||||
ScrollMessageBox(QWidget* parent, const QString& title, const QString& text, const QString& body, const QString& option = QString());
|
||||
|
||||
~ScrollMessageBox() override;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
#include "UpdateCheckFailedDialog.h"
|
||||
#include "ui_ScrollMessageBox.h"
|
||||
|
||||
UpdateCheckFailedDialog::UpdateCheckFailedDialog(QWidget* parent, const QString& body)
|
||||
: ScrollMessageBox(parent,
|
||||
tr("Failed to check for updates"),
|
||||
tr("Could not check or get the following resources for updates:<br>"
|
||||
"Do you wish to proceed without those resources?"),
|
||||
body)
|
||||
{
|
||||
ui->optionCheckBox->setVisible(true);
|
||||
ui->optionCheckBox->setText(tr("Disable unavailable mods"));
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "ScrollMessageBox.h"
|
||||
|
||||
class UpdateCheckFailedDialog final : public ScrollMessageBox {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit UpdateCheckFailedDialog(QWidget* parent, const QString& body);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue