From d13449235075d7482bef6854a8730d5bf6925415 Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Wed, 7 Aug 2024 21:51:55 -0700 Subject: [PATCH 01/10] If provided by user, add config file to titlebar. --- src/main.cpp | 14 +++++++++++++- src/main.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 56041d30..549fe582 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -204,6 +204,12 @@ bool MainApp::OnCmdLineParsed(wxCmdLineParser& parser) fprintf(stderr, "Loading configuration from %s\n", (const char*)configPath.ToUTF8()); pConfig = new wxFileConfig(wxT("FreeDV"), wxT("CODEC2-Project"), configPath, configPath, wxCONFIG_USE_LOCAL_FILE); wxConfigBase::Set(pConfig); + + // On Linux/macOS, this replaces $HOME with "~" to shorten the title a bit. + wxFileName fn(configPath); + fn.ReplaceEnvVariable("HOME", "~"); + + customConfigFileName = fn.GetShortPath(); } pConfig->SetRecordDefaults(); @@ -240,7 +246,7 @@ bool MainApp::OnInit() // displayed. But it doesn't when built from command line. Why? frame->m_auiNbookCtrl->ChangeSelection(0); - frame->Layout(); + frame->Layout(); frame->Show(); g_parent =frame; @@ -648,6 +654,12 @@ MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent, wxID_ANY, _("FreeDV ") pthread_setname_np(pthread_self(), "FreeDV GUI"); #endif // defined(__linux__) + // Add config file name to title bar if provided at the command line. + if (wxGetApp().customConfigFileName != "") + { + SetTitle(wxString::Format("%s (%s)", _("FreeDV ") + _(FREEDV_VERSION), wxGetApp().customConfigFileName)); + } + m_reporterDialog = nullptr; m_filterDialog = nullptr; diff --git a/src/main.h b/src/main.h index f49e43a1..006f65a9 100644 --- a/src/main.h +++ b/src/main.h @@ -168,6 +168,7 @@ class MainApp : public wxApp bool CanAccessSerialPort(std::string portName); FreeDVConfiguration appConfiguration; + wxString customConfigFileName; // PTT ----------------------------------- unsigned int m_intHamlibRig; From 5f0c55d1268972134f9a7e9cab7ee9d285a405f2 Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Wed, 7 Aug 2024 21:54:14 -0700 Subject: [PATCH 02/10] Add PR #738 to changelog. --- USER_MANUAL.md | 1 + build_osx.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/USER_MANUAL.md b/USER_MANUAL.md index d189bfc2..005c16e9 100644 --- a/USER_MANUAL.md +++ b/USER_MANUAL.md @@ -898,6 +898,7 @@ LDPC | Low Density Parity Check Codes - a family of powerful FEC codes * Update configuration of the Voice Keyer feature based on user feedback. (PR #730) * Add monitor volume adjustment. (PR #733) * Avoid modifying the audio device configuration without the user explicitly doing so. (PR #735) + * If provided by user, add config file to titlebar. (PR #738) 3. Build system: * Allow overrriding the version tag when building. (PR #727) * Update wxWidgets to 3.2.5. (PR #731) diff --git a/build_osx.sh b/build_osx.sh index 4611e6be..c96ad378 100755 --- a/build_osx.sh +++ b/build_osx.sh @@ -25,7 +25,7 @@ cd $FREEDVGUIDIR if [ ! -d hamlib-code ]; then git clone https://github.com/Hamlib/Hamlib.git hamlib-code fi -cd hamlib-code && git checkout 4.5.5 && git pull +cd hamlib-code && git checkout master && git pull ./bootstrap CFLAGS="-g -O2 -mmacosx-version-min=10.9 -arch x86_64 -arch arm64" CXXFLAGS="-g -O2 -mmacosx-version-min=10.9 -arch x86_64 -arch arm64" ./configure --enable-shared --prefix $HAMLIBDIR make -j4 @@ -78,5 +78,5 @@ if [ -d .git ]; then git pull fi mkdir -p build_osx && cd build_osx && rm -Rf * -cmake -DUNITTEST=1 -DBUILD_OSX_UNIVERSAL=1 -DUNITTEST=$UT_ENABLE -DCMAKE_BUILD_TYPE=Debug -DBOOTSTRAP_WXWIDGETS=1 -DUSE_STATIC_SPEEXDSP=1 -DUSE_STATIC_PORTAUDIO=1 -DUSE_STATIC_SAMPLERATE=1 -DUSE_STATIC_SNDFILE=1 -DHAMLIB_INCLUDE_DIR=${HAMLIBDIR}/include -DHAMLIB_LIBRARY=${HAMLIBDIR}/lib/libhamlib.dylib -DCODEC2_BUILD_DIR=$CODEC2DIR/build_osx ${LPCNET_CMAKE_CMD} .. +CFLAGS=-fsanitize=address CXXFLAGS=-fsanitize=address cmake -DUNITTEST=1 -DBUILD_OSX_UNIVERSAL=1 -DUNITTEST=$UT_ENABLE -DCMAKE_BUILD_TYPE=Debug -DBOOTSTRAP_WXWIDGETS=1 -DUSE_STATIC_SPEEXDSP=1 -DUSE_STATIC_PORTAUDIO=1 -DUSE_STATIC_SAMPLERATE=1 -DUSE_STATIC_SNDFILE=1 -DHAMLIB_INCLUDE_DIR=${HAMLIBDIR}/include -DHAMLIB_LIBRARY=${HAMLIBDIR}/lib/libhamlib.dylib -DCODEC2_BUILD_DIR=$CODEC2DIR/build_osx ${LPCNET_CMAKE_CMD} .. make VERBOSE=1 -j8 From 3a18c4522676aa35e92cb2f121512be3de432847 Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Wed, 7 Aug 2024 21:55:10 -0700 Subject: [PATCH 03/10] Revert accidental commit of build script changes. --- build_osx.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_osx.sh b/build_osx.sh index c96ad378..4611e6be 100755 --- a/build_osx.sh +++ b/build_osx.sh @@ -25,7 +25,7 @@ cd $FREEDVGUIDIR if [ ! -d hamlib-code ]; then git clone https://github.com/Hamlib/Hamlib.git hamlib-code fi -cd hamlib-code && git checkout master && git pull +cd hamlib-code && git checkout 4.5.5 && git pull ./bootstrap CFLAGS="-g -O2 -mmacosx-version-min=10.9 -arch x86_64 -arch arm64" CXXFLAGS="-g -O2 -mmacosx-version-min=10.9 -arch x86_64 -arch arm64" ./configure --enable-shared --prefix $HAMLIBDIR make -j4 @@ -78,5 +78,5 @@ if [ -d .git ]; then git pull fi mkdir -p build_osx && cd build_osx && rm -Rf * -CFLAGS=-fsanitize=address CXXFLAGS=-fsanitize=address cmake -DUNITTEST=1 -DBUILD_OSX_UNIVERSAL=1 -DUNITTEST=$UT_ENABLE -DCMAKE_BUILD_TYPE=Debug -DBOOTSTRAP_WXWIDGETS=1 -DUSE_STATIC_SPEEXDSP=1 -DUSE_STATIC_PORTAUDIO=1 -DUSE_STATIC_SAMPLERATE=1 -DUSE_STATIC_SNDFILE=1 -DHAMLIB_INCLUDE_DIR=${HAMLIBDIR}/include -DHAMLIB_LIBRARY=${HAMLIBDIR}/lib/libhamlib.dylib -DCODEC2_BUILD_DIR=$CODEC2DIR/build_osx ${LPCNET_CMAKE_CMD} .. +cmake -DUNITTEST=1 -DBUILD_OSX_UNIVERSAL=1 -DUNITTEST=$UT_ENABLE -DCMAKE_BUILD_TYPE=Debug -DBOOTSTRAP_WXWIDGETS=1 -DUSE_STATIC_SPEEXDSP=1 -DUSE_STATIC_PORTAUDIO=1 -DUSE_STATIC_SAMPLERATE=1 -DUSE_STATIC_SNDFILE=1 -DHAMLIB_INCLUDE_DIR=${HAMLIBDIR}/include -DHAMLIB_LIBRARY=${HAMLIBDIR}/lib/libhamlib.dylib -DCODEC2_BUILD_DIR=$CODEC2DIR/build_osx ${LPCNET_CMAKE_CMD} .. make VERBOSE=1 -j8 From 1dba2acf1e27b84ac2ca37c2a1d865ec1dfaecf7 Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Sat, 17 Aug 2024 22:50:11 -0700 Subject: [PATCH 04/10] Add filename to FreeDV Reporter titlebar. --- src/gui/dialogs/freedv_reporter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/dialogs/freedv_reporter.cpp b/src/gui/dialogs/freedv_reporter.cpp index a0b687e3..4350646f 100644 --- a/src/gui/dialogs/freedv_reporter.cpp +++ b/src/gui/dialogs/freedv_reporter.cpp @@ -90,6 +90,11 @@ FreeDVReporterDialog::FreeDVReporterDialog(wxWindow* parent, wxWindowID id, cons , filterSelfMessageUpdates_(false) , filteredFrequency_(0) { + if (wxGetApp().customConfigFileName != "") + { + SetTitle(wxString::Format("%s (%s)", _("FreeDV Reporter"), wxGetApp().customConfigFileName)); + } + for (int col = 0; col < NUM_COLS; col++) { columnLengths_[col] = DefaultColumnWidths_[col]; From c79d5a6facd9a779a01ed326243aed311383b05c Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Thu, 22 Aug 2024 15:45:43 -0700 Subject: [PATCH 05/10] Add filename to all other possible dialogs. --- src/gui/dialogs/dlg_audiooptions.cpp | 5 +++++ src/gui/dialogs/dlg_easy_setup.cpp | 5 +++++ src/gui/dialogs/dlg_filter.cpp | 5 +++++ src/gui/dialogs/dlg_options.cpp | 5 +++++ src/gui/dialogs/dlg_ptt.cpp | 5 +++++ 5 files changed, 25 insertions(+) diff --git a/src/gui/dialogs/dlg_audiooptions.cpp b/src/gui/dialogs/dlg_audiooptions.cpp index f196f723..0b512748 100644 --- a/src/gui/dialogs/dlg_audiooptions.cpp +++ b/src/gui/dialogs/dlg_audiooptions.cpp @@ -88,6 +88,11 @@ void AudioOptsDialog::buildTestControls(PlotScalar **plotScalar, wxButton **btnT //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-= AudioOptsDialog::AudioOptsDialog(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { + if (wxGetApp().customConfigFileName != "") + { + SetTitle(wxString::Format("%s (%s)", title, wxGetApp().customConfigFileName)); + } + if (g_verbose) fprintf(stderr, "pos %d %d\n", pos.x, pos.y); audioEngineInit(); diff --git a/src/gui/dialogs/dlg_easy_setup.cpp b/src/gui/dialogs/dlg_easy_setup.cpp index 1a484b19..136f3a40 100644 --- a/src/gui/dialogs/dlg_easy_setup.cpp +++ b/src/gui/dialogs/dlg_easy_setup.cpp @@ -55,6 +55,11 @@ EasySetupDialog::EasySetupDialog(wxWindow* parent, wxWindowID id, const wxString , serialPortTestObject_(nullptr) , hasAppliedChanges_(false) { + if (wxGetApp().customConfigFileName != "") + { + SetTitle(wxString::Format("%s (%s)", title, wxGetApp().customConfigFileName)); + } + // Create top-level of control hierarchy. wxPanel* panel = new wxPanel(this); wxBoxSizer* sectionSizer = new wxBoxSizer(wxVERTICAL); diff --git a/src/gui/dialogs/dlg_filter.cpp b/src/gui/dialogs/dlg_filter.cpp index e6b3f1e4..0bdb9700 100644 --- a/src/gui/dialogs/dlg_filter.cpp +++ b/src/gui/dialogs/dlg_filter.cpp @@ -59,6 +59,11 @@ extern wxMutex g_mutexProtectingCallbackData; FilterDlg::FilterDlg(wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { + if (wxGetApp().customConfigFileName != "") + { + SetTitle(wxString::Format("%s (%s)", title, wxGetApp().customConfigFileName)); + } + m_running = running; m_newMicInFilter = newMicInFilter; m_newSpkOutFilter = newSpkOutFilter; diff --git a/src/gui/dialogs/dlg_options.cpp b/src/gui/dialogs/dlg_options.cpp index 633dd6e2..563c2c58 100644 --- a/src/gui/dialogs/dlg_options.cpp +++ b/src/gui/dialogs/dlg_options.cpp @@ -44,6 +44,11 @@ extern wxConfigBase *pConfig; //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-= OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { + if (wxGetApp().customConfigFileName != "") + { + SetTitle(wxString::Format("%s (%s)", title, wxGetApp().customConfigFileName)); + } + sessionActive_ = false; wxPanel* panel = new wxPanel(this); diff --git a/src/gui/dialogs/dlg_ptt.cpp b/src/gui/dialogs/dlg_ptt.cpp index 2f598489..fc34bda3 100644 --- a/src/gui/dialogs/dlg_ptt.cpp +++ b/src/gui/dialogs/dlg_ptt.cpp @@ -48,6 +48,11 @@ extern wxConfigBase *pConfig; //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-= ComPortsDlg::ComPortsDlg(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { + if (wxGetApp().customConfigFileName != "") + { + SetTitle(wxString::Format("%s (%s)", title, wxGetApp().customConfigFileName)); + } + wxPanel* panel = new wxPanel(this); wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); From e4bc3ce9823899e28192e5355e45396e5e8941f0 Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Thu, 22 Aug 2024 15:45:57 -0700 Subject: [PATCH 06/10] Only show filename and not any folders. --- src/main.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 549fe582..76ce106a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -206,10 +206,8 @@ bool MainApp::OnCmdLineParsed(wxCmdLineParser& parser) wxConfigBase::Set(pConfig); // On Linux/macOS, this replaces $HOME with "~" to shorten the title a bit. - wxFileName fn(configPath); - fn.ReplaceEnvVariable("HOME", "~"); - - customConfigFileName = fn.GetShortPath(); + wxFileName fn(configPath); + customConfigFileName = fn.GetFullName(); } pConfig->SetRecordDefaults(); From 9ecbcb04f0ad7db3b21687c1e98eb8b40cbc30eb Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Sun, 25 Aug 2024 22:53:33 +0000 Subject: [PATCH 07/10] latest user manual PDF --- USER_MANUAL.html | 1 + USER_MANUAL.pdf | Bin 1117339 -> 1116719 bytes 2 files changed, 1 insertion(+) diff --git a/USER_MANUAL.html b/USER_MANUAL.html index aa4f99a3..423c73cf 100644 --- a/USER_MANUAL.html +++ b/USER_MANUAL.html @@ -655,6 +655,7 @@

Update configuration of the Voice Keyer feature based on user feedback. (PR #730)
  • Add monitor volume adjustment. (PR #733)
  • Avoid modifying the audio device configuration without the user explicitly doing so. (PR #735)
  • +
  • If provided by user, add config file to titlebar. (PR #738)
  • Build system: