aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2022-10-13 15:10:35 -0300
committerflow <flowlnlnln@gmail.com>2022-10-13 15:10:35 -0300
commitdfa220ef02f23ff734dec6247f4a124a7a144c7a (patch)
tree73dc55f36db5e421ad529f21fd38fcc5291d7974 /launcher/ui
parentf26be005716818b643a0c8b1373dbe83e4cdcfbf (diff)
downloadPrismLauncher-dfa220ef02f23ff734dec6247f4a124a7a144c7a.tar.gz
PrismLauncher-dfa220ef02f23ff734dec6247f4a124a7a144c7a.tar.bz2
PrismLauncher-dfa220ef02f23ff734dec6247f4a124a7a144c7a.zip
fix: issues with aborts (again)
i hate it Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/ui')
-rw-r--r--launcher/ui/dialogs/ProgressDialog.cpp5
-rw-r--r--launcher/ui/pages/modplatform/ftb/FtbListModel.h1
-rw-r--r--launcher/ui/pages/modplatform/ftb/FtbPage.cpp2
3 files changed, 5 insertions, 3 deletions
diff --git a/launcher/ui/dialogs/ProgressDialog.cpp b/launcher/ui/dialogs/ProgressDialog.cpp
index 258a32e4..68dd4d17 100644
--- a/launcher/ui/dialogs/ProgressDialog.cpp
+++ b/launcher/ui/dialogs/ProgressDialog.cpp
@@ -25,6 +25,7 @@ ProgressDialog::ProgressDialog(QWidget* parent) : QDialog(parent), ui(new Ui::Pr
{
ui->setupUi(this);
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
+ setAttribute(Qt::WidgetAttribute::WA_QuitOnClose, true);
setSkipButton(false);
changeProgress(0, 100);
}
@@ -67,7 +68,7 @@ int ProgressDialog::execWithTask(Task* task)
return QDialog::DialogCode::Accepted;
}
- QDialog::DialogCode result;
+ QDialog::DialogCode result {};
if (handleImmediateResult(result)) {
return result;
}
@@ -80,7 +81,7 @@ int ProgressDialog::execWithTask(Task* task)
connect(task, &Task::stepStatus, this, &ProgressDialog::changeStatus);
connect(task, &Task::progress, this, &ProgressDialog::changeProgress);
- connect(task, &Task::aborted, [this] { QDialog::reject(); });
+ connect(task, &Task::aborted, this, &ProgressDialog::hide);
connect(task, &Task::abortStatusChanged, ui->skipButton, &QPushButton::setEnabled);
m_is_multi_step = task->isMultiStep();
diff --git a/launcher/ui/pages/modplatform/ftb/FtbListModel.h b/launcher/ui/pages/modplatform/ftb/FtbListModel.h
index cbf215c4..d7a120f0 100644
--- a/launcher/ui/pages/modplatform/ftb/FtbListModel.h
+++ b/launcher/ui/pages/modplatform/ftb/FtbListModel.h
@@ -52,6 +52,7 @@ public:
void getLogo(const QString &logo, const QString &logoUrl, LogoCallback callback);
[[nodiscard]] bool isMakingRequest() const { return jobPtr.get(); }
+ [[nodiscard]] bool wasAborted() const { return m_aborted; }
private slots:
void requestFinished();
diff --git a/launcher/ui/pages/modplatform/ftb/FtbPage.cpp b/launcher/ui/pages/modplatform/ftb/FtbPage.cpp
index 1fe28124..34a3d1c0 100644
--- a/launcher/ui/pages/modplatform/ftb/FtbPage.cpp
+++ b/launcher/ui/pages/modplatform/ftb/FtbPage.cpp
@@ -105,7 +105,7 @@ void FtbPage::retranslate()
void FtbPage::openedImpl()
{
- if(!initialised)
+ if(!initialised || listModel->wasAborted())
{
listModel->request();
initialised = true;