Skip to content

Commit

Permalink
Qt: Disable close for non-cancellable progress dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Nov 16, 2024
1 parent 49b669c commit 61dae0e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/duckstation-qt/qtprogresscallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ QtModalProgressCallback::QtModalProgressCallback(QWidget* parent_widget, float s
m_dialog.setModal(parent_widget != nullptr);
m_dialog.setAutoClose(false);
m_dialog.setAutoReset(false);
m_dialog.setWindowFlag(Qt::WindowCloseButtonHint, false);
connect(&m_dialog, &QProgressDialog::canceled, this, &QtModalProgressCallback::dialogCancelled);
checkForDelayedShow();
}
Expand All @@ -31,6 +32,7 @@ void QtModalProgressCallback::SetCancellable(bool cancellable)
return;

ProgressCallback::SetCancellable(cancellable);
m_dialog.setWindowFlag(Qt::WindowCloseButtonHint, cancellable);
m_dialog.setCancelButtonText(cancellable ? tr("Cancel") : QString());
}

Expand Down

0 comments on commit 61dae0e

Please sign in to comment.