From 6a7263dc94524d5f22aa94cc9772770d54861e9e Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 11 Mar 2020 22:38:41 +0000 Subject: [PATCH] Add escape route from retries of IPC errors --- widgets/mainwindow.cpp | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index b12195ad4..8e7deea64 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -1057,9 +1057,14 @@ void MainWindow::release_jt9 () { if (!l.remove ()) { - MessageBox::query_message (this - , tr ("Error removing \"%1\" - %2").arg (l.fileName ()).arg (l.errorString ()) - , tr ("Click OK to retry")); + if (MessageBox::Cancel == MessageBox::query_message (this + , tr ("IPC Error") + , tr ("Error removing \"%1\" - %2").arg (l.fileName ()).arg (l.errorString ()) + , QString {} + , MessageBox::Retry | MessageBox::Cancel)) + { + break; + } } } } @@ -1072,9 +1077,14 @@ void MainWindow::stop_jt9 () { if (!q.open (QFile::ReadWrite)) { - MessageBox::query_message (this - , tr ("Error creating \"%1\" - %2").arg (q.fileName ()).arg (q.errorString ()) - , tr ("Click OK to retry")); + if (MessageBox::Cancel == MessageBox::query_message (this + , tr ("IPC Error") + , tr ("Error creating \"%1\" - %2").arg (q.fileName ()).arg (q.errorString ()) + , QString {} + , MessageBox::Retry | MessageBox::Cancel)) + { + break; + } } } release_jt9 (); @@ -1086,9 +1096,14 @@ void MainWindow::stop_jt9 () { if (!q.remove ()) { - MessageBox::query_message (this - , tr ("Error removing \"%1\" - %2").arg (q.fileName ()).arg (q.errorString ()) - , tr ("Click OK to retry")); + if (MessageBox::Cancel == MessageBox::query_message (this + , tr ("IPC Error") + , tr ("Error removing \"%1\" - %2").arg (q.fileName ()).arg (q.errorString ()) + , QString {} + , MessageBox::Retry | MessageBox::Cancel)) + { + break; + } } } }