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:
baldurk
2022-01-12 11:24:22 +00:00
parent 49876a1043
commit 3587f8e448
3 changed files with 45 additions and 6 deletions
+16 -2
View File
@@ -1951,6 +1951,8 @@ void MainWindow::setRemoteHost(int hostIdx)
if(hostIdx >= 0 && hostIdx < hosts.count())
host = hosts[hostIdx];
bool noToAll = false;
for(LiveCapture *live : m_LiveCaptures)
{
// allow live captures to this host to stay open, that way
@@ -1959,7 +1961,12 @@ void MainWindow::setRemoteHost(int hostIdx)
if(host.IsValid() && live->hostname() == host.Hostname())
continue;
if(!live->checkAllowClose())
// if the user previously selected 'no to all' in the save prompts below, apply that to all
// subsequent live captures
if(noToAll)
continue;
if(!live->checkAllowClose(m_LiveCaptures.count() > 1, noToAll))
return;
}
@@ -2937,9 +2944,16 @@ void MainWindow::loadLayout_triggered()
void MainWindow::closeEvent(QCloseEvent *event)
{
bool noToAll = false;
for(LiveCapture *live : m_LiveCaptures)
{
if(!live->checkAllowClose())
// if the user previously selected 'no to all' in the save prompts below, apply that to all
// subsequent live captures
if(noToAll)
continue;
if(!live->checkAllowClose(m_LiveCaptures.count() > 1, noToAll))
{
event->ignore();
return;