diff --git a/Configuration.cpp b/Configuration.cpp index cb0566c10..57978f907 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -607,6 +607,7 @@ private: bool miles_; bool quick_call_; bool disable_TX_on_73_; + bool alternate_bindings_; int watchdog_; bool TX_messages_; bool enable_VHF_features_; @@ -700,6 +701,7 @@ bool Configuration::clear_DX () const {return m_->clear_DX_;} bool Configuration::miles () const {return m_->miles_;} bool Configuration::quick_call () const {return m_->quick_call_;} bool Configuration::disable_TX_on_73 () const {return m_->disable_TX_on_73_;} +bool Configuration::alternate_bindings() const {return m_->alternate_bindings_;} int Configuration::watchdog () const {return m_->watchdog_;} bool Configuration::TX_messages () const {return m_->TX_messages_;} bool Configuration::enable_VHF_features () const {return m_->enable_VHF_features_;} @@ -1232,6 +1234,7 @@ void Configuration::impl::initialize_models () ui_->miles_check_box->setChecked (miles_); ui_->quick_call_check_box->setChecked (quick_call_); ui_->disable_TX_on_73_check_box->setChecked (disable_TX_on_73_); + ui_->alternate_bindings_check_box->setChecked (alternate_bindings_); ui_->tx_watchdog_spin_box->setValue (watchdog_); ui_->TX_messages_check_box->setChecked (TX_messages_); ui_->enable_VHF_features_check_box->setChecked(enable_VHF_features_); @@ -1481,6 +1484,7 @@ void Configuration::impl::read_settings () miles_ = settings_->value ("Miles", false).toBool (); quick_call_ = settings_->value ("QuickCall", false).toBool (); disable_TX_on_73_ = settings_->value ("73TxDisable", false).toBool (); + alternate_bindings_ = settings_->value ("AlternateBindings", false).toBool (); watchdog_ = settings_->value ("TxWatchdog", 6).toInt (); TX_messages_ = settings_->value ("Tx2QSO", true).toBool (); enable_VHF_features_ = settings_->value("VHFUHF",false).toBool (); @@ -1580,6 +1584,7 @@ void Configuration::impl::write_settings () settings_->setValue ("Miles", miles_); settings_->setValue ("QuickCall", quick_call_); settings_->setValue ("73TxDisable", disable_TX_on_73_); + settings_->setValue ("AlternateBindings", alternate_bindings_); settings_->setValue ("TxWatchdog", watchdog_); settings_->setValue ("Tx2QSO", TX_messages_); settings_->setValue ("CATForceDTR", rig_params_.force_dtr); @@ -2022,6 +2027,7 @@ void Configuration::impl::accept () miles_ = ui_->miles_check_box->isChecked (); quick_call_ = ui_->quick_call_check_box->isChecked (); disable_TX_on_73_ = ui_->disable_TX_on_73_check_box->isChecked (); + alternate_bindings_ = ui_->alternate_bindings_check_box->isChecked (); watchdog_ = ui_->tx_watchdog_spin_box->value (); TX_messages_ = ui_->TX_messages_check_box->isChecked (); data_mode_ = static_cast (ui_->TX_mode_button_group->checkedId ()); diff --git a/Configuration.hpp b/Configuration.hpp index 3f76c1b95..1154f6129 100644 --- a/Configuration.hpp +++ b/Configuration.hpp @@ -126,6 +126,7 @@ public: bool miles () const; bool quick_call () const; bool disable_TX_on_73 () const; + bool alternate_bindings() const; int watchdog () const; bool TX_messages () const; bool split_mode () const; diff --git a/Configuration.ui b/Configuration.ui index 6b04fd353..da9d71c66 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -461,6 +461,13 @@ text message. + + + + Alternate F1-F5 bindings + + + @@ -3018,13 +3025,13 @@ Right click for insert and delete options. - - - - - - + + + + + + diff --git a/decodedtext.cpp b/decodedtext.cpp index f466bb8d9..88f6bd621 100644 --- a/decodedtext.cpp +++ b/decodedtext.cpp @@ -65,7 +65,7 @@ QStringList DecodedText::messageWords () const QString DecodedText::CQersCall() const { - QRegularExpression callsign_re {R"(^(CQ|DE|QRZ)(\s?DX|\s([A-Z]{2,4}|\d{3}))?\s(?[A-Z0-9/]{2,})(\s[A-R]{2}[0-9]{2})?)"}; + QRegularExpression callsign_re {R"(^(CQ|DE|QRZ)(\s?DX|\s([A-Z]{1,4}|\d{3}))?\s(?[A-Z0-9/]{2,})(\s[A-R]{2}[0-9]{2})?)"}; return callsign_re.match (message_).captured ("callsign"); } @@ -167,9 +167,8 @@ void DecodedText::deCallAndGrid(/*out*/QString& call, QString& grid) const call = match.captured ("word2"); grid = match.captured ("word3"); if ("R" == grid) grid = match.captured ("word4"); - if(match.captured("word1")=="CQ" and call.length()>=3 and call.length()<=4 - and !call.contains(QRegExp("[0-9]"))) { - //Second word has length 3 or 4 and contains no digits + if(match.captured("word1")=="CQ" and call.length()<=4 and !call.contains(QRegExp("[0-9]"))) { + //Second word has length 1-4 and contains no digits call = match.captured ("word3"); grid = match.captured ("word4"); } diff --git a/shortcuts.txt b/shortcuts.txt index 14a9cd73a..e50278d0f 100644 --- a/shortcuts.txt +++ b/shortcuts.txt @@ -1,13 +1,13 @@ - + - - - + + + - + diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index bb0089d95..259dc1d9f 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -1863,6 +1863,7 @@ void MainWindow::keyPressEvent (QKeyEvent * e) } int n; + bool bAltF1F5=m_config.alternate_bindings(); switch(e->key()) { case Qt::Key_D: @@ -1876,21 +1877,51 @@ void MainWindow::keyPressEvent (QKeyEvent * e) } break; case Qt::Key_F1: - on_actionOnline_User_Guide_triggered(); - return; + if(bAltF1F5) { + auto_tx_mode(true); + on_txb6_clicked(); + return; + } else { + on_actionOnline_User_Guide_triggered(); + return; + } case Qt::Key_F2: - on_actionSettings_triggered(); - return; + if(bAltF1F5) { + auto_tx_mode(true); + on_txb2_clicked(); + return; + } else { + on_actionSettings_triggered(); + return; + } case Qt::Key_F3: - on_actionKeyboard_shortcuts_triggered(); - return; + if(bAltF1F5) { + auto_tx_mode(true); + on_txb3_clicked(); + return; + } else { + on_actionKeyboard_shortcuts_triggered(); + return; + } case Qt::Key_F4: - clearDX (); - ui->dxCallEntry->setFocus(); - return; + if(bAltF1F5) { + auto_tx_mode(true); + on_txb4_clicked(); + return; + } else { + clearDX (); + ui->dxCallEntry->setFocus(); + return; + } case Qt::Key_F5: - on_actionSpecial_mouse_commands_triggered(); - return; + if(bAltF1F5) { + auto_tx_mode(true); + on_txb5_clicked(); + return; + } else { + on_actionSpecial_mouse_commands_triggered(); + return; + } case Qt::Key_F6: if(e->modifiers() & Qt::ShiftModifier) { on_actionDecode_remaining_files_in_directory_triggered(); @@ -4013,6 +4044,7 @@ void MainWindow::ba2msg(QByteArray ba, char message[]) //ba2msg() int iz=ba.length(); for(int i=0; i<37; i++) { if(i=97 and int(ba[i])<=122) ba[i]=int(ba[i])-32; message[i]=ba[i]; } else { message[i]=32; @@ -5274,8 +5306,11 @@ void MainWindow::on_tx6_editingFinished() //tx6 edited QString t=ui->tx6->text().toUpper(); if(t.indexOf(" ")>0) { QString t1=t.split(" ").at(1); + QRegExp AZ4("^[A-Z]{1,4}$"); + QRegExp NN3("^[0-9]{1,3}$"); m_CQtype="CQ"; - if(t1.size()==2) m_CQtype="CQ " + t1; + if(t1.size()<=4 and t1.contains(AZ4)) m_CQtype="CQ " + t1; + if(t1.size()<=3 and t1.contains(NN3)) m_CQtype="CQ " + t1; } msgtype(t, ui->tx6); } diff --git a/widgets/mainwindow.ui b/widgets/mainwindow.ui index 8815fd530..560c982ef 100644 --- a/widgets/mainwindow.ui +++ b/widgets/mainwindow.ui @@ -1523,9 +1523,6 @@ QPushButton[state="ok"] { Ctrl+2 - - buttonGroup - @@ -1542,9 +1539,6 @@ QPushButton[state="ok"] { Ctrl+1 - - buttonGroup - @@ -1602,9 +1596,6 @@ QPushButton[state="ok"] { true - - buttonGroup - @@ -1624,9 +1615,6 @@ QPushButton[state="ok"] { Ctrl+5 - - buttonGroup - @@ -1643,9 +1631,6 @@ QPushButton[state="ok"] { Ctrl+3 - - buttonGroup - @@ -1678,9 +1663,6 @@ QPushButton[state="ok"] { Ctrl+4 - - buttonGroup - @@ -2862,25 +2844,16 @@ list. The list can be maintained in Settings (F2). Online User Guide - - F1 - Keyboard shortcuts - - F3 - Special mouse commands - - F5 - @@ -3092,9 +3065,6 @@ list. The list can be maintained in Settings (F2). Settings... - - F2 - @@ -3475,6 +3445,4 @@ list. The list can be maintained in Settings (F2). - -
Esc Stop Tx, abort QSO, clear next-call queue
F1 Online User's Guide
F1 Online User's Guide (Alt: transmit Tx6)
Shift+F1 Copyright Notice
Ctrl+F1 About WSJT-X
F2 Open settings window
F3 Display keyboard shortcuts
F4 Clear DX Call, DX Grid, Tx messages 1-4
F2 Open settings window (Alt: transmit Tx2)
F3 Display keyboard shortcuts (Alt: transmit Tx3)
F4 Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)
Alt+F4 Exit program
F5 Display special mouse commands
F5 Display special mouse commands (Alt: transmit Tx5)
F6 Open next file in directory
Shift+F6 Decode all remaining files in directrory
F7 Display Message Averaging window