From: drowe67 Date: Mon, 29 Jun 2015 19:09:48 +0000 (+0000) Subject: space bar to tx doesnt work when options dialog is up, so we can use space bar to... X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=213bff2cc4fb4a5cfac5e5cd50144cf4efe541da;p=freetel-svn-tracking.git space bar to tx doesnt work when options dialog is up, so we can use space bar to enter text git-svn-id: https://svn.code.sf.net/p/freetel/code@2224 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/fdmdv2-dev/src/dlg_options.cpp b/fdmdv2-dev/src/dlg_options.cpp index 39bbed79..9d8e5524 100644 --- a/fdmdv2-dev/src/dlg_options.cpp +++ b/fdmdv2-dev/src/dlg_options.cpp @@ -200,6 +200,7 @@ OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, c //------------------------------------------------------------------------- OptionsDlg::~OptionsDlg() { + // Disconnect Events this->Disconnect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(OptionsDlg::OnInitDialog)); @@ -305,6 +306,7 @@ void OptionsDlg::OnOK(wxCommandEvent& event) { ExchangeData(EXCHANGE_DATA_OUT, true); //this->EndModal(wxID_OK); + g_modal = false; this->Show(false); } @@ -314,6 +316,7 @@ void OptionsDlg::OnOK(wxCommandEvent& event) void OptionsDlg::OnCancel(wxCommandEvent& event) { //this->EndModal(wxID_CANCEL); + g_modal = false; this->Show(false); } @@ -322,6 +325,7 @@ void OptionsDlg::OnCancel(wxCommandEvent& event) //------------------------------------------------------------------------- void OptionsDlg::OnApply(wxCommandEvent& event) { + g_modal = false; ExchangeData(EXCHANGE_DATA_OUT, true); } diff --git a/fdmdv2-dev/src/fdmdv2_main.cpp b/fdmdv2-dev/src/fdmdv2_main.cpp index 64d8fdd7..10c9346b 100644 --- a/fdmdv2-dev/src/fdmdv2_main.cpp +++ b/fdmdv2-dev/src/fdmdv2_main.cpp @@ -63,6 +63,7 @@ int g_split; int g_tx; float g_snr; bool g_half_duplex; +bool g_modal; // sending and receiving Call Sign data struct FIFO *g_txDataInFifo; @@ -488,7 +489,7 @@ MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent) g_total_bits = 0; wxGetApp().m_testFrames = false; - m_modal = false; + g_modal = false; // Start UDP listener thread @@ -1256,8 +1257,9 @@ 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->m_modal) { + //fprintf(stderr,"frame->m_RxRunning: %d g_modal: %d\n", + // frame->m_RxRunning, g_modal); + if (frame->m_RxRunning && !g_modal) { if (frame->m_btnTogPTT->GetValue()) frame->m_btnTogPTT->SetValue(false); else @@ -1798,9 +1800,9 @@ void MainFrame::OnToolsFilter(wxCommandEvent& event) void MainFrame::OnToolsOptions(wxCommandEvent& event) { wxUnusedVar(event); - m_modal=true; + g_modal = true; + //fprintf(stderr,"g_modal: %d\n", g_modal); optionsDlg->Show(); - m_modal=false; } //-------------------------------------------------------------------------