mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-23 20:58:55 -05:00
Do one automatic retry on CAT errors
To allow for intermittant CAT failures one retry before bringing up a message box should allow many setups to be more reliable. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4473 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
e2b39b6b8a
commit
94ab875ea9
@ -2866,23 +2866,34 @@ void MainWindow::handle_transceiver_failure (QString reason)
|
|||||||
|
|
||||||
void MainWindow::rigFailure (QString const& reason, QString const& detail)
|
void MainWindow::rigFailure (QString const& reason, QString const& detail)
|
||||||
{
|
{
|
||||||
m_rigErrorMessageBox.setText (reason);
|
static bool first_error {true};
|
||||||
m_rigErrorMessageBox.setDetailedText (detail);
|
if (first_error)
|
||||||
|
|
||||||
// don't call slot functions directly to avoid recursion
|
|
||||||
switch (m_rigErrorMessageBox.exec ())
|
|
||||||
{
|
{
|
||||||
case QMessageBox::Ok:
|
// one automatic retry
|
||||||
QTimer::singleShot (0, this, SLOT (on_actionSettings_triggered ()));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case QMessageBox::Retry:
|
|
||||||
QTimer::singleShot (0, this, SLOT (rigOpen ()));
|
QTimer::singleShot (0, this, SLOT (rigOpen ()));
|
||||||
break;
|
first_error = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_rigErrorMessageBox.setText (reason);
|
||||||
|
m_rigErrorMessageBox.setDetailedText (detail);
|
||||||
|
|
||||||
case QMessageBox::Cancel:
|
// don't call slot functions directly to avoid recursion
|
||||||
QTimer::singleShot (0, this, SLOT (close ()));
|
switch (m_rigErrorMessageBox.exec ())
|
||||||
break;
|
{
|
||||||
|
case QMessageBox::Ok:
|
||||||
|
QTimer::singleShot (0, this, SLOT (on_actionSettings_triggered ()));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case QMessageBox::Retry:
|
||||||
|
QTimer::singleShot (0, this, SLOT (rigOpen ()));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case QMessageBox::Cancel:
|
||||||
|
QTimer::singleShot (0, this, SLOT (close ()));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
first_error = true; // reset
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user