mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
When closing multiple capture connections apply 'No to All' answer wider
* This means if you're closing multiple connections and click 'no to all' when prompting save of instead of discarding just the captures in that connection then going on to prompt for the next, it discards all remaining captures.
This commit is contained in:
@@ -685,12 +685,11 @@ QString LiveCapture::MakeText(Capture *cap)
|
||||
return text;
|
||||
}
|
||||
|
||||
bool LiveCapture::checkAllowClose()
|
||||
bool LiveCapture::checkAllowClose(bool multipleClosures, bool &noToAll)
|
||||
{
|
||||
m_IgnoreThreadClosed = true;
|
||||
|
||||
bool suppressRemoteWarning = false;
|
||||
bool notoall = false;
|
||||
|
||||
QMessageBox::StandardButtons msgFlags = RDDialog::YesNoCancel;
|
||||
|
||||
@@ -712,7 +711,7 @@ bool LiveCapture::checkAllowClose()
|
||||
|
||||
QMessageBox::StandardButton res = QMessageBox::No;
|
||||
|
||||
if(!suppressRemoteWarning && !notoall)
|
||||
if(!suppressRemoteWarning && !noToAll)
|
||||
{
|
||||
QString frameName = tr("Frame #%1").arg(cap->frameNumber);
|
||||
if(cap->frameNumber == ~0U)
|
||||
@@ -727,7 +726,26 @@ bool LiveCapture::checkAllowClose()
|
||||
|
||||
if(res == QMessageBox::NoToAll)
|
||||
{
|
||||
notoall = true;
|
||||
// if we're closing multiple connections make sure the user is sure of what they're doing
|
||||
if(multipleClosures)
|
||||
{
|
||||
QMessageBox::StandardButton res2 =
|
||||
RDDialog::question(this, tr("Discarding all captures"),
|
||||
tr("Multiple connections open have potentially unsaved captures, "
|
||||
"are you sure you wish to discard them all?"));
|
||||
|
||||
// if the user is sure, apply the no to all
|
||||
if(res2 == QMessageBox::Yes)
|
||||
noToAll = true;
|
||||
|
||||
// otherwise we'll treat this as a simple 'no' in case they changed their mind.
|
||||
}
|
||||
else
|
||||
{
|
||||
// if we're not closing multiple, we can just immediately accept the 'no to all'
|
||||
noToAll = true;
|
||||
}
|
||||
|
||||
res = QMessageBox::No;
|
||||
}
|
||||
}
|
||||
@@ -782,6 +800,12 @@ bool LiveCapture::checkAllowClose()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LiveCapture::checkAllowClose()
|
||||
{
|
||||
bool dummy = false;
|
||||
return checkAllowClose(false, dummy);
|
||||
}
|
||||
|
||||
void LiveCapture::openCapture(Capture *cap)
|
||||
{
|
||||
cap->opened = true;
|
||||
|
||||
Reference in New Issue
Block a user