From 66f03baca54349f5707e642fb3626891ab97f1c6 Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Thu, 14 Dec 2023 19:22:07 -0800 Subject: [PATCH 1/2] Suppress use of space bar when in RX Only mode. --- src/main.cpp | 7 +------ src/main.h | 2 ++ src/ongui.cpp | 2 +- src/util.cpp | 14 ++++++++++++++ 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f14a398de..e55dcb39c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3036,12 +3036,7 @@ bool MainFrame::validateSoundCardSetup() void MainFrame::initializeFreeDVReporter_() { - bool hamlibDisabledForRigControl = - (wxGetApp().appConfiguration.rigControlConfiguration.hamlibUseForPTT && - (HamlibRigController::PttType)wxGetApp().appConfiguration.rigControlConfiguration.hamlibPTTType.get() == HamlibRigController::PTT_VIA_NONE); - bool receiveOnly = - wxGetApp().appConfiguration.reportingConfiguration.freedvReporterForceReceiveOnly || - g_nSoundCards <= 1 || hamlibDisabledForRigControl; + bool receiveOnly = isReceiveOnly(); auto oldReporterObject = wxGetApp().m_sharedReporterObject; wxGetApp().m_sharedReporterObject = diff --git a/src/main.h b/src/main.h index 6f803b0bb..7bbeb371f 100644 --- a/src/main.h +++ b/src/main.h @@ -344,6 +344,8 @@ class MainFrame : public TopFrame void StopPlaybackFileFromRadio(); void StopRecFileFromRadio(); + bool isReceiveOnly(); + protected: void setsnrBeta(bool snrSlow); diff --git a/src/ongui.cpp b/src/ongui.cpp index 0c5a7d65f..a33980aa2 100644 --- a/src/ongui.cpp +++ b/src/ongui.cpp @@ -751,7 +751,7 @@ int MainApp::FilterEvent(wxEvent& event) (((wxKeyEvent&)event).GetKeyCode() == WXK_SPACE)) { // only use space to toggle PTT if we are running and no modal dialogs (like options) up - if (frame->m_RxRunning && frame->IsActive() && wxGetApp().appConfiguration.enableSpaceBarForPTT) { + if (frame->m_RxRunning && frame->IsActive() && wxGetApp().appConfiguration.enableSpaceBarForPTT && !frame->isReceiveOnly()) { // space bar controls rx/rx if keyer not running if (frame->vk_state == VK_IDLE) { diff --git a/src/util.cpp b/src/util.cpp index a33ffa7f5..4e541eff5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -112,6 +112,20 @@ bool MainApp::CanAccessSerialPort(std::string portName) return couldOpen; } +//---------------------------------------------------------------- +// isReceiveOnly() +//---------------------------------------------------------------- + +bool MainFrame::isReceiveOnly() +{ + bool hamlibDisabledForRigControl = + (wxGetApp().appConfiguration.rigControlConfiguration.hamlibUseForPTT && + (HamlibRigController::PttType)wxGetApp().appConfiguration.rigControlConfiguration.hamlibPTTType.get() == HamlibRigController::PTT_VIA_NONE); + return + wxGetApp().appConfiguration.reportingConfiguration.freedvReporterForceReceiveOnly || + g_nSoundCards <= 1 || hamlibDisabledForRigControl; +} + //---------------------------------------------------------------- // OpenSerialPort() //---------------------------------------------------------------- From e8ab9f18013c71c116ebee69a7410dcefc7595e7 Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Thu, 14 Dec 2023 19:25:02 -0800 Subject: [PATCH 2/2] Add PR #623 to changelog. --- USER_MANUAL.md | 1 + 1 file changed, 1 insertion(+) diff --git a/USER_MANUAL.md b/USER_MANUAL.md index df6525ad6..607cf4547 100644 --- a/USER_MANUAL.md +++ b/USER_MANUAL.md @@ -919,6 +919,7 @@ LDPC | Low Density Parity Check Codes - a family of powerful FEC codes * Check for RIGCAPS_NOT_CONST in Hamlib 4.6. (PR #615) * Make main screen gauges horizontal to work around sizing/layout issues. (PR #613) * Fix compiler issue with certain versions of MinGW. (PR #622) + * Suppress use of space bar when in RX Only mode. (PR #623) 2. Enhancements: * Allow serial PTT to be enabled along with OmniRig. (PR #619) * Add 800XA to multi-RX list. (PR #617)