diff --git a/Configuration.cpp b/Configuration.cpp index 24850c0..cf3bc65 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -631,7 +631,7 @@ private: bool tx_qsy_allowed_; bool spot_to_reporting_networks_; bool transmit_directed_; - bool autoreply_off_at_startup_; + bool autoreply_on_at_startup_; bool heartbeat_anywhere_; bool heartbeat_qso_pause_; bool relay_disabled_; @@ -770,12 +770,12 @@ void Configuration::set_spot_to_reporting_networks (bool spot) } bool Configuration::transmit_directed() const { return m_->transmit_directed_; } -bool Configuration::autoreply_off_at_startup () const { +bool Configuration::autoreply_on_at_startup () const { // auto-reply cannot be on at startup if the callsign or grid is empty if(my_callsign().isEmpty() || my_grid().isEmpty()){ - return true; + return false; } - return m_->autoreply_off_at_startup_; + return m_->autoreply_on_at_startup_; } bool Configuration::heartbeat_anywhere() const { return m_->heartbeat_anywhere_;} bool Configuration::heartbeat_qso_pause() const { return m_->heartbeat_qso_pause_;} @@ -1451,7 +1451,7 @@ void Configuration::impl::initialize_models () ui_->tx_qsy_check_box->setChecked (tx_qsy_allowed_); ui_->psk_reporter_check_box->setChecked (spot_to_reporting_networks_); ui_->transmit_directed_check_box->setChecked(transmit_directed_); - ui_->autoreply_off_check_box->setChecked (autoreply_off_at_startup_); + ui_->autoreply_on_check_box->setChecked (autoreply_on_at_startup_); ui_->heartbeat_anywhere_check_box->setChecked(heartbeat_anywhere_); ui_->heartbeat_qso_pause_check_box->setChecked(heartbeat_qso_pause_); ui_->relay_disabled_check_box->setChecked(relay_disabled_); @@ -1725,7 +1725,7 @@ void Configuration::impl::read_settings () type_2_msg_gen_ = settings_->value ("Type2MsgGen", QVariant::fromValue (Configuration::type_2_msg_3_full)).value (); transmit_directed_ = settings_->value ("TransmitDirected", true).toBool(); - autoreply_off_at_startup_ = settings_->value ("AutoreplyOFF", false).toBool (); + autoreply_on_at_startup_ = settings_->value ("AutoreplyOnAtStartup", false).toBool (); heartbeat_anywhere_ = settings_->value("BeaconAnywhere", false).toBool(); heartbeat_qso_pause_ = settings_->value("HeartbeatQSOPause", true).toBool(); relay_disabled_ = settings_->value ("RelayOFF", false).toBool (); @@ -1907,7 +1907,7 @@ void Configuration::impl::write_settings () settings_->setValue ("AudioOutputChannel", AudioDevice::toString (audio_output_channel_)); settings_->setValue ("Type2MsgGen", QVariant::fromValue (type_2_msg_gen_)); settings_->setValue ("TransmitDirected", transmit_directed_); - settings_->setValue ("AutoreplyOFF", autoreply_off_at_startup_); + settings_->setValue ("AutoreplyOnAtStartup", autoreply_on_at_startup_); settings_->setValue ("BeaconAnywhere", heartbeat_anywhere_); settings_->setValue ("HeartbeatQSOPause", heartbeat_qso_pause_); settings_->setValue ("RelayOFF", relay_disabled_); @@ -2469,7 +2469,7 @@ void Configuration::impl::accept () id_after_73_ = ui_->CW_id_after_73_check_box->isChecked (); tx_qsy_allowed_ = ui_->tx_qsy_check_box->isChecked (); transmit_directed_ = ui_->transmit_directed_check_box->isChecked(); - autoreply_off_at_startup_ = ui_->autoreply_off_check_box->isChecked (); + autoreply_on_at_startup_ = ui_->autoreply_on_check_box->isChecked (); heartbeat_anywhere_ = ui_->heartbeat_anywhere_check_box->isChecked(); heartbeat_qso_pause_ = ui_->heartbeat_qso_pause_check_box->isChecked(); relay_disabled_ = ui_->relay_disabled_check_box->isChecked(); diff --git a/Configuration.hpp b/Configuration.hpp index af74494..95bc1ab 100644 --- a/Configuration.hpp +++ b/Configuration.hpp @@ -129,7 +129,7 @@ public: bool spot_to_reporting_networks () const; void set_spot_to_reporting_networks (bool); bool transmit_directed() const; - bool autoreply_off_at_startup () const; + bool autoreply_on_at_startup () const; bool heartbeat_anywhere() const; bool heartbeat_qso_pause() const; bool relay_off() const; diff --git a/Configuration.ui b/Configuration.ui index 95658c0..58b5caf 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -63,7 +63,7 @@ 0 0 738 - 447 + 453 @@ -279,7 +279,7 @@ 0 0 724 - 789 + 508 @@ -373,20 +373,6 @@ - - - - Allow heartbeat transmissions outside of heartbeat sub-channel (500Hz - 1000Hz) - - - - - - - Pause heartbeat transmissions while in a QSO (i.e., callsign is selected) - - - @@ -565,59 +551,6 @@ text message. - - - - Autoreply - - - - - - Autoreply (AUTO) off at startup - - - - - - - Disable message relay (>) when AUTO is enabled - - - - - - - Only autoreply to these callsigns (comma separated): - - - - - - - - - - Never autoreply to these callsigns (comma separated): - - - - - - - - - - Never ACK HBs from these callsigns (comma separated): - - - - - - - - - @@ -711,57 +644,6 @@ text message. - - - - Idle Timeout - - - - - - - - Disable automatic transmissions after: - - - tx_watchdog_spin_box - - - - - - - <html><head/><body><p>Number of minutes before unattended heartbeat transmissions are aborted.</p></body></html> - - - Disabled - - - minutes of inactivity - - - - - - 0 - - - 1440 - - - 1 - - - 60 - - - - - - - - @@ -887,6 +769,200 @@ text message. + + + Networking && Autoreply + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + 0 + + + true + + + + + 0 + 0 + 738 + 453 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Heartbeat Network + + + + + + Allow heartbeat transmissions outside of heartbeat sub-channel (500Hz - 1000Hz) + + + + + + + Pause heartbeat transmissions while in a QSO (i.e., callsign is selected) + + + + + + + 0 + + + + + Never ACK HBs from these callsigns (comma separated): + + + + + + + + + + + + + + + Autoreply + + + + + + Turn autoreply on at startup + + + + + + + Disable message relay (>) when autoreply is enabled + + + + + + + Only autoreply to these callsigns (comma separated): + + + + + + + + + + Never autoreply to these callsigns (comma separated): + + + + + + + + + + + + + Idle Timeout + + + + + + + + Disable automatic transmissions after: + + + tx_watchdog_spin_box + + + + + + + <html><head/><body><p>Number of minutes before unattended heartbeat transmissions are aborted.</p></body></html> + + + Disabled + + + minutes of inactivity + + + + + + 0 + + + 1440 + + + 1 + + + 60 + + + + + + + + + + + + Qt::Vertical + + + + 20 + 220 + + + + + + + + + + @@ -1033,8 +1109,8 @@ radio interface behave as expected. 0 0 - 283 - 397 + 264 + 435 @@ -1455,7 +1531,7 @@ a few, particularly some Kenwood rigs, require it). 0 0 718 - 449 + 490 @@ -1859,7 +1935,7 @@ this setting allows you to select which audio input will be used 0 0 760 - 498 + 502 @@ -2172,7 +2248,7 @@ both here. 0 0 746 - 630 + 663 @@ -2573,7 +2649,7 @@ for assessing propagation and system performance. - + @@ -2667,7 +2743,7 @@ for assessing propagation and system performance. 0 0 760 - 498 + 502 @@ -2871,24 +2947,24 @@ Right click for insert and delete options. true - - 100 - 120 + + 100 + true false - - 24 - 30 + + 24 + @@ -3048,7 +3124,7 @@ QListView::item:hover { 0 0 724 - 434 + 418 @@ -3501,7 +3577,7 @@ QListView::item:hover { 0 0 233 - 263 + 253 @@ -3704,8 +3780,8 @@ QListView::item:hover { 0 0 - 287 - 99 + 277 + 93 @@ -4126,19 +4202,12 @@ soundcard changes monitor_off_check_box tx_qsy_check_box avoid_forced_identify_check_box - heartbeat_anywhere_check_box - heartbeat_qso_pause_check_box transmit_directed_check_box spellcheck_check_box reset_activity_check_box checkForUpdates_checkBox - autoreply_off_check_box - relay_disabled_check_box - auto_whitelist_line_edit - auto_blacklist_line_edit callsign_aging_spin_box activity_aging_spin_box - tx_watchdog_spin_box eot_line_edit rig_combo_box CAT_poll_interval_spin_box @@ -4315,11 +4384,11 @@ soundcard changes - - - - - + + + + + diff --git a/mainwindow.cpp b/mainwindow.cpp index 9492e0b..923fac8 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1152,9 +1152,12 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, setFreqOffsetForRestore(f, false); ui->cbVHFcontest->setChecked(false); // this needs to always be false + ui->actionModeAutoreply->setChecked(m_config.autoreply_on_at_startup()); ui->spotButton->setChecked(m_config.spot_to_reporting_networks()); - //m_checker = new JSCChecker(ui->extFreeTextMsgEdit, this); + // prep + prepareAutoreplyMode(ui->actionModeAutoreply->isChecked()); + prepareSpotting(); auto enterFilter = new EnterKeyPressEater(); connect(enterFilter, &EnterKeyPressEater::enterKeyPressed, this, [this](QObject *, QKeyEvent *, bool *pProcessed){ @@ -2772,7 +2775,6 @@ void MainWindow::on_menuControl_aboutToShow(){ #endif ui->actionEnable_Spotting->setChecked(ui->spotButton->isChecked()); - ui->actionEnable_Auto_Reply->setChecked(ui->autoReplyButton->isChecked()); QMenu * heartbeatMenu = new QMenu(this->menuBar()); buildHeartbeatMenu(heartbeatMenu); @@ -2797,10 +2799,6 @@ void MainWindow::on_actionEnable_Spotting_toggled(bool checked){ ui->spotButton->setChecked(checked); } -void MainWindow::on_actionEnable_Auto_Reply_toggled(bool checked){ - ui->autoReplyButton->setChecked(checked); -} - void MainWindow::on_menuWindow_aboutToShow(){ ui->actionShow_Fullscreen->setChecked((windowState() & Qt::WindowFullScreen) == Qt::WindowFullScreen); @@ -3194,13 +3192,6 @@ void MainWindow::on_autoButton_clicked (bool checked) } } -void MainWindow::on_autoReplyButton_toggled(bool checked){ - resetPushButtonToggleText(ui->autoReplyButton); - - // update the HB button immediately - updateRepeatButtonDisplay(); -} - void MainWindow::on_monitorButton_toggled(bool checked){ resetPushButtonToggleText(ui->monitorButton); } @@ -6926,6 +6917,23 @@ void MainWindow::displayWidgets(qint64 n) m_lastCallsign.clear (); // ensures Tx5 is updated for new modes } +void MainWindow::on_actionModeJS8_triggered(){ + // TODO: uncheck all other modes +} + +void MainWindow::on_actionModeAutoreply_toggled(bool checked){ + prepareAutoreplyMode(checked); +} + +void MainWindow::prepareAutoreplyMode(bool enabled){ + // heartbeat is now only available in autoreply mode + ui->hbMacroButton->setVisible(enabled); + ui->actionHeartbeat->setVisible(enabled); + + // update the HB button immediately + updateRepeatButtonDisplay(); +} + void MainWindow::on_actionFT8_triggered() { m_mode="FT8"; @@ -7419,10 +7427,10 @@ void MainWindow::buildFrequencyMenu(QMenu *menu){ void MainWindow::buildHeartbeatMenu(QMenu *menu){ auto selectedCallsign = callsignSelected(); - bool enabled = ui->autoReplyButton->isChecked() && selectedCallsign.isEmpty(); + bool enabled = ui->actionModeAutoreply->isChecked() && selectedCallsign.isEmpty(); auto text = "Send Heartbeat Acknowledgments (ACK)"; - if(!ui->autoReplyButton->isChecked()){ - text = "Send Heartbeat Acknowledgments (ACK) (Disabled: AUTO is off)"; + if(!ui->actionModeAutoreply->isChecked()){ + text = "Send Heartbeat Acknowledgments (ACK) (Disabled: Autoreply is off)"; } if(!selectedCallsign.isEmpty()){ text = "Send Heartbeat Acknowledgments (ACK) (Disabled: Currently in QSO)"; @@ -8911,8 +8919,6 @@ void MainWindow::handle_transceiver_update (Transceiver::TransceiverState const& { // initializing on_monitorButton_clicked (!m_config.monitor_off_at_startup ()); - - ui->autoReplyButton->setChecked(!m_config.autoreply_off_at_startup()); } if (s.frequency () != old_state.frequency () || s.split () != m_splitMode) @@ -9418,7 +9424,7 @@ void MainWindow::updateButtonDisplay(){ void MainWindow::updateRepeatButtonDisplay(){ auto selectedCallsign = callsignSelected(); - auto hbBase = m_hbAutoAck && ui->autoReplyButton->isChecked() && selectedCallsign.isEmpty() ? "HB + ACK" : "HB"; + auto hbBase = m_hbAutoAck && ui->actionModeAutoreply->isChecked() && selectedCallsign.isEmpty() ? "HB + ACK" : "HB"; if(ui->hbMacroButton->isChecked() && m_hbInterval > 0 && m_nextHeartbeat.isValid()){ auto secs = DriftingDateTime::currentDateTimeUtc().secsTo(m_nextHeartbeat); if(secs > 0){ @@ -10193,15 +10199,15 @@ QStringList MainWindow::generateStatusFlags() { flags.append("HB"); } - if(ui->autoReplyButton->isChecked()){ + if(ui->actionModeAutoreply->isChecked()){ flags.append("AUTO"); } - if(ui->autoReplyButton->isChecked() && !m_config.relay_off()){ + if(ui->actionModeAutoreply->isChecked() && !m_config.relay_off()){ flags.append("RELAY"); } - if(ui->spotButton->isChecked()){ + if(m_config.spot_to_reporting_networks()){ flags.append("SPOT"); } @@ -10663,7 +10669,7 @@ void MainWindow::processCommandActivity() { // PROCESS ACTIVE HEARTBEAT // if we have auto reply enabled and auto ack enabled and no callsign is selected - else if (d.cmd == " HB" && ui->autoReplyButton->isChecked() && m_hbAutoAck && selectedCallsign.isEmpty()){ + else if (d.cmd == " HB" && ui->actionModeAutoreply->isChecked() && m_hbAutoAck && selectedCallsign.isEmpty()){ // check to make sure this callsign isn't blacklisted if(m_config.hb_blacklist().contains(d.from) || m_config.hb_blacklist().contains(Radio::base_callsign(d.from))){ @@ -10806,7 +10812,7 @@ void MainWindow::processCommandActivity() { } // PROCESS BUFFERED QUERY MSGS - else if (d.cmd == " QUERY MSGS" && ui->autoReplyButton->isChecked()){ + else if (d.cmd == " QUERY MSGS" && ui->actionModeAutoreply->isChecked()){ auto who = d.from; // keep in mind, this is the sender, not the original requestor if relayed auto replyPath = d.from; @@ -10830,7 +10836,7 @@ void MainWindow::processCommandActivity() { } // PROCESS BUFFERED QUERY CALL - else if (d.cmd == " QUERY CALL" && ui->autoReplyButton->isChecked()){ + else if (d.cmd == " QUERY CALL" && ui->actionModeAutoreply->isChecked()){ auto replyPath = d.from; if(d.relayPath.contains(">")){ replyPath = d.relayPath; @@ -10900,7 +10906,7 @@ void MainWindow::processCommandActivity() { } // do not queue @ALLCALL replies if auto-reply is not checked - if(!ui->autoReplyButton->isChecked() && isAllCall){ + if(!ui->actionModeAutoreply->isChecked() && isAllCall){ continue; } @@ -11140,7 +11146,7 @@ void MainWindow::processAlertReplyForCommand(CommandDetail d, QString from, QStr } void MainWindow::processSpots() { - if(!ui->spotButton->isChecked()){ + if(!m_config.spot_to_reporting_networks()){ m_rxCallQueue.clear(); return; } @@ -11231,7 +11237,7 @@ void MainWindow::processTxQueue(){ if(message.priority >= PriorityHigh || message.message.contains(" HB ") || message.message.contains(" ACK ") || - ui->autoReplyButton->isChecked() + ui->actionModeAutoreply->isChecked() ){ // then try to set the frequency... setFreqOffsetForRestore(f, true); @@ -12652,12 +12658,12 @@ void MainWindow::tx_watchdog (bool triggered) tx_status_label.setText ("Idle timeout"); // if the watchdog is triggered...we're no longer active - bool wasAuto = ui->autoReplyButton->isChecked(); + bool wasAuto = ui->actionModeAutoreply->isChecked(); bool wasHB = ui->hbMacroButton->isChecked(); bool wasCQ = ui->cqMacroButton->isChecked(); // save the button states - ui->autoReplyButton->setChecked(false); + ui->actionModeAutoreply->setChecked(false); ui->hbMacroButton->setChecked(false); ui->cqMacroButton->setChecked(false); @@ -12672,7 +12678,7 @@ void MainWindow::tx_watchdog (bool triggered) connect(msgBox, &QMessageBox::finished, this, [this, wasAuto, wasHB, wasCQ](int /*result*/) { // restore the button states - ui->autoReplyButton->setChecked(wasAuto); + ui->actionModeAutoreply->setChecked(wasAuto); ui->hbMacroButton->setChecked(wasHB); ui->cqMacroButton->setChecked(wasCQ); @@ -12690,7 +12696,7 @@ void MainWindow::tx_watchdog (bool triggered) resetMessageTransmitQueue(); // restore the button states - ui->autoReplyButton->setChecked(wasAuto); + ui->actionModeAutoreply->setChecked(wasAuto); ui->hbMacroButton->setChecked(wasHB); ui->cqMacroButton->setChecked(wasCQ); #endif diff --git a/mainwindow.h b/mainwindow.h index b62f391..1ae4045 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -180,7 +180,6 @@ private slots: void on_menuControl_aboutToShow(); void on_actionCheck_for_Updates_triggered(); void on_actionEnable_Spotting_toggled(bool checked); - void on_actionEnable_Auto_Reply_toggled(bool checked); void on_menuWindow_aboutToShow(); void on_actionFocus_Message_Reply_Area_triggered(); void on_actionFocus_Band_Activity_Table_triggered(); @@ -260,6 +259,9 @@ private slots: void on_dxCallEntry_returnPressed (); void on_genStdMsgsPushButton_clicked(); void on_logQSOButton_clicked(); + void on_actionModeJS8_triggered(); + void on_actionModeAutoreply_toggled(bool checked); + void prepareAutoreplyMode(bool enabled); void on_actionFT8_triggered(); void on_TxFreqSpinBox_valueChanged(int arg1); void on_actionSave_decoded_triggered(); @@ -369,7 +371,6 @@ private slots: void stop_tuning (); void stopTuneATU(); void auto_tx_mode(bool); - void on_autoReplyButton_toggled(bool checked); void on_monitorButton_toggled(bool checked); void on_monitorTxButton_toggled(bool checked); void on_tuneButton_toggled(bool checked); diff --git a/mainwindow.ui b/mainwindow.ui index b3476b4..e0d60fb 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -533,7 +533,7 @@ QPushButton:checked { QFrame::Plain - + QLayout::SetMinimumSize @@ -552,8 +552,8 @@ QPushButton:checked { 10 - - + + true @@ -580,8 +580,8 @@ QPushButton:checked { 9 - - <html><head/><body><p>Enable or disable spotting of callsigns heard to PSKReporter</p></body></html> + + true QPushButton { @@ -593,11 +593,11 @@ QPushButton:checked { } QPushButton:checked { - background-color:#6699ff; + background-color:#FF2222; } - SPOT + TX true @@ -662,6 +662,93 @@ QPushButton:checked { + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 20 + 10 + + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 20 + 10 + + + + + + + + true + + + + 0 + 0 + + + + + 0 + 30 + + + + + 16777215 + 16777215 + + + + + 9 + + + + true + + + <html><head/><body><p>Insert a new entry into the log</p></body></html> + + + QPushButton { + background-color:lightgray; + padding:0.25em 0.25em; font-weight:normal; + border-style:solid; + border-width:0px; + border-radius:2px; + } + +QPushButton:checked { + background-color:#6699ff; +} + + + LOG + + + false + + + @@ -717,95 +804,8 @@ QPushButton:checked { - - - - true - - - - 0 - 0 - - - - - 0 - 30 - - - - - 16777215 - 16777215 - - - - - 9 - - - - true - - - QPushButton { - background-color:lightgray; - padding:0.25em 0.25em; font-weight:normal; - border-style:solid; - border-width:0px; - border-radius:2px; - } - -QPushButton:checked { - background-color:#FF2222; -} - - - TX - - - true - - - false - - - - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 10 - - - - - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 10 - - - - - + true @@ -833,23 +833,23 @@ QPushButton:checked { - <html><head/><body><p>Enable or disable automatic station replies to directed queries</p></body></html> + <html><head/><body><p><br/></p></body></html> QPushButton { - background-color:lightgray; - padding:0.25em 0.25em; font-weight:normal; - border-style:solid; - border-width:0px; - border-radius:2px; - } +background-color:lightgray; +padding:0.25em 0.25em; font-weight:normal; +border-style:solid; +border-width:0px; +border-radius:2px; +} -QPushButton:checked { - background-color:#6699ff; +QPushButton:checked { +background-color:#6699ff; } - AUTO + ... true @@ -859,8 +859,8 @@ QPushButton:checked { - - + + true @@ -887,27 +887,27 @@ QPushButton:checked { 9 - - true - - <html><head/><body><p>Insert a new entry into the log</p></body></html> + <html><head/><body><p>Transmit a tuning tone</p></body></html> QPushButton { - background-color:lightgray; - padding:0.25em 0.25em; font-weight:normal; - border-style:solid; - border-width:0px; - border-radius:2px; + background-color:lightgray; + padding:0.25em 0.25em; font-weight:normal; + border-style:solid; + border-width:0px; + border-radius:2px; } -QPushButton:checked { +QPushButton:checked { background-color:#6699ff; } - LOG + SPOT + + + true false @@ -4790,9 +4790,6 @@ list. The list can be maintained in Settings (F2). - - - @@ -4802,6 +4799,8 @@ list. The list can be maintained in Settings (F2). Mode + + @@ -5745,6 +5744,30 @@ list. The list can be maintained in Settings (F2). AUTO + + + true + + + Enable Networking && Autoreply + + + + + true + + + Messaging + + + + + true + + + Heartbeat + +