mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-02-03 09:44:24 -05:00
Add a configurations button to the rig error message box
This button pops up the same context menu as the configurations button on the main window menu bar. This allows the operator to easily escape from an incorrectly configured configuration without changing it. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7075 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
9fb5422fbb
commit
66eaf24af0
@ -170,6 +170,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
||||
m_revision {revision ()},
|
||||
m_multiple {multiple},
|
||||
m_multi_settings {multi_settings},
|
||||
m_configurations_button {0},
|
||||
m_settings {multi_settings->settings ()},
|
||||
ui(new Ui::MainWindow),
|
||||
m_config {temp_directory, m_settings, this},
|
||||
@ -589,6 +590,8 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
||||
|
||||
// set up configurations menu
|
||||
m_multi_settings->create_menu_actions (this, ui->menuConfig);
|
||||
m_configurations_button = m_rigErrorMessageBox.addButton (tr ("Configurations...")
|
||||
, QMessageBox::ActionRole);
|
||||
|
||||
// set up message text validators
|
||||
ui->tx1->setValidator (new QRegExpValidator {message_alphabet, this});
|
||||
@ -4886,19 +4889,30 @@ void MainWindow::rigFailure (QString const& reason)
|
||||
m_rigErrorMessageBox.setDetailedText (reason);
|
||||
|
||||
// don't call slot functions directly to avoid recursion
|
||||
switch (m_rigErrorMessageBox.exec ())
|
||||
m_rigErrorMessageBox.exec ();
|
||||
auto const clicked_button = m_rigErrorMessageBox.clickedButton ();
|
||||
if (clicked_button == m_configurations_button)
|
||||
{
|
||||
case MessageBox::Ok:
|
||||
QTimer::singleShot (0, this, SLOT (on_actionSettings_triggered ()));
|
||||
break;
|
||||
ui->menuConfig->exec (QCursor::pos ());
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (m_rigErrorMessageBox.standardButton (clicked_button))
|
||||
{
|
||||
case MessageBox::Ok:
|
||||
QTimer::singleShot (0, this, SLOT (on_actionSettings_triggered ()));
|
||||
break;
|
||||
|
||||
case MessageBox::Retry:
|
||||
QTimer::singleShot (0, this, SLOT (rigOpen ()));
|
||||
break;
|
||||
case MessageBox::Retry:
|
||||
QTimer::singleShot (0, this, SLOT (rigOpen ()));
|
||||
break;
|
||||
|
||||
case MessageBox::Cancel:
|
||||
QTimer::singleShot (0, this, SLOT (close ()));
|
||||
break;
|
||||
case MessageBox::Cancel:
|
||||
QTimer::singleShot (0, this, SLOT (close ()));
|
||||
break;
|
||||
|
||||
default: break; // squashing compile warnings
|
||||
}
|
||||
}
|
||||
m_first_error = true; // reset
|
||||
}
|
||||
|
@ -288,6 +288,7 @@ private:
|
||||
QString m_revision;
|
||||
bool m_multiple;
|
||||
MultiSettings * m_multi_settings;
|
||||
QPushButton * m_configurations_button;
|
||||
QSettings * m_settings;
|
||||
QScopedPointer<Ui::MainWindow> ui;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user