fix: issues with aborts (again)
i hate it Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -105,7 +105,7 @@ void FtbPage::retranslate()
|
||||
|
||||
void FtbPage::openedImpl()
|
||||
{
|
||||
if(!initialised)
|
||||
if(!initialised || listModel->wasAborted())
|
||||
{
|
||||
listModel->request();
|
||||
initialised = true;
|
||||
|
Reference in New Issue
Block a user