mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-07 12:05:52 +00:00
Qt: Disable close for non-cancellable progress dialog
This commit is contained in:
parent
49b669c8be
commit
61dae0ed6f
@ -19,6 +19,7 @@ QtModalProgressCallback::QtModalProgressCallback(QWidget* parent_widget, float s
|
|||||||
m_dialog.setModal(parent_widget != nullptr);
|
m_dialog.setModal(parent_widget != nullptr);
|
||||||
m_dialog.setAutoClose(false);
|
m_dialog.setAutoClose(false);
|
||||||
m_dialog.setAutoReset(false);
|
m_dialog.setAutoReset(false);
|
||||||
|
m_dialog.setWindowFlag(Qt::WindowCloseButtonHint, false);
|
||||||
connect(&m_dialog, &QProgressDialog::canceled, this, &QtModalProgressCallback::dialogCancelled);
|
connect(&m_dialog, &QProgressDialog::canceled, this, &QtModalProgressCallback::dialogCancelled);
|
||||||
checkForDelayedShow();
|
checkForDelayedShow();
|
||||||
}
|
}
|
||||||
@ -31,6 +32,7 @@ void QtModalProgressCallback::SetCancellable(bool cancellable)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ProgressCallback::SetCancellable(cancellable);
|
ProgressCallback::SetCancellable(cancellable);
|
||||||
|
m_dialog.setWindowFlag(Qt::WindowCloseButtonHint, cancellable);
|
||||||
m_dialog.setCancelButtonText(cancellable ? tr("Cancel") : QString());
|
m_dialog.setCancelButtonText(cancellable ? tr("Cancel") : QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user