mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-26 23:55:46 +00:00
Wait for shader viewer background debugging, add cancel button
* Until we properly support background debugging we need to wait for it to complete, otherwise the user could close the window and we'd crash.
This commit is contained in:
@@ -1953,6 +1953,7 @@ public:
|
||||
setLabel(&m_Label);
|
||||
}
|
||||
|
||||
void enableCancel() { setCancelButtonText(tr("Cancel")); }
|
||||
void setPercentage(float percent) { setValue(int(maxProgress * percent)); }
|
||||
void setInfinite(bool infinite)
|
||||
{
|
||||
@@ -2299,13 +2300,16 @@ QStringList ParseArgsList(const QString &args)
|
||||
}
|
||||
|
||||
void ShowProgressDialog(QWidget *window, const QString &labelText, ProgressFinishedMethod finished,
|
||||
ProgressUpdateMethod update)
|
||||
ProgressUpdateMethod update, ProgressCancelMethod cancel)
|
||||
{
|
||||
if(finished())
|
||||
return;
|
||||
|
||||
RDProgressDialog dialog(labelText, window);
|
||||
|
||||
if(cancel)
|
||||
dialog.enableCancel();
|
||||
|
||||
// if we don't have an update function, set the progress display to be 'infinite spinner'
|
||||
dialog.setInfinite(!update);
|
||||
|
||||
@@ -2338,6 +2342,9 @@ void ShowProgressDialog(QWidget *window, const QString &labelText, ProgressFinis
|
||||
// to clean itself up
|
||||
tickerSemaphore.tryAcquire();
|
||||
progressTickerThread.wait();
|
||||
|
||||
if(cancel && dialog.wasCanceled())
|
||||
cancel();
|
||||
}
|
||||
|
||||
void UpdateTransferProgress(qint64 xfer, qint64 total, QElapsedTimer *timer,
|
||||
|
||||
Reference in New Issue
Block a user