Merge pull request #738 from drowe67/ms-config-path-in-title

If provided by user, add config file to titlebar.
ms-tooltip-adj
Mooneer Salem 2024-08-25 15:51:19 -07:00 committed by GitHub
commit 2b4452f163
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 43 additions and 1 deletions

View File

@ -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) * Update configuration of the Voice Keyer feature based on user feedback. (PR #730)
* Add monitor volume adjustment. (PR #733) * Add monitor volume adjustment. (PR #733)
* Avoid modifying the audio device configuration without the user explicitly doing so. (PR #735) * 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: 3. Build system:
* Allow overrriding the version tag when building. (PR #727) * Allow overrriding the version tag when building. (PR #727)
* Update wxWidgets to 3.2.5. (PR #731) * Update wxWidgets to 3.2.5. (PR #731)

View File

@ -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) 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); if (g_verbose) fprintf(stderr, "pos %d %d\n", pos.x, pos.y);
audioEngineInit(); audioEngineInit();

View File

@ -55,6 +55,11 @@ EasySetupDialog::EasySetupDialog(wxWindow* parent, wxWindowID id, const wxString
, serialPortTestObject_(nullptr) , serialPortTestObject_(nullptr)
, hasAppliedChanges_(false) , hasAppliedChanges_(false)
{ {
if (wxGetApp().customConfigFileName != "")
{
SetTitle(wxString::Format("%s (%s)", title, wxGetApp().customConfigFileName));
}
// Create top-level of control hierarchy. // Create top-level of control hierarchy.
wxPanel* panel = new wxPanel(this); wxPanel* panel = new wxPanel(this);
wxBoxSizer* sectionSizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sectionSizer = new wxBoxSizer(wxVERTICAL);

View File

@ -59,6 +59,11 @@ extern wxMutex g_mutexProtectingCallbackData;
FilterDlg::FilterDlg(wxWindow* parent, bool running, bool *newMicInFilter, bool *newSpkOutFilter, 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) 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_running = running;
m_newMicInFilter = newMicInFilter; m_newMicInFilter = newMicInFilter;
m_newSpkOutFilter = newSpkOutFilter; m_newSpkOutFilter = newSpkOutFilter;

View File

@ -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) 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; sessionActive_ = false;
wxPanel* panel = new wxPanel(this); wxPanel* panel = new wxPanel(this);

View File

@ -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) 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); wxPanel* panel = new wxPanel(this);
wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);

View File

@ -90,6 +90,11 @@ FreeDVReporterDialog::FreeDVReporterDialog(wxWindow* parent, wxWindowID id, cons
, filterSelfMessageUpdates_(false) , filterSelfMessageUpdates_(false)
, filteredFrequency_(0) , filteredFrequency_(0)
{ {
if (wxGetApp().customConfigFileName != "")
{
SetTitle(wxString::Format("%s (%s)", _("FreeDV Reporter"), wxGetApp().customConfigFileName));
}
for (int col = 0; col < NUM_COLS; col++) for (int col = 0; col < NUM_COLS; col++)
{ {
columnLengths_[col] = DefaultColumnWidths_[col]; columnLengths_[col] = DefaultColumnWidths_[col];

View File

@ -204,6 +204,10 @@ bool MainApp::OnCmdLineParsed(wxCmdLineParser& parser)
fprintf(stderr, "Loading configuration from %s\n", (const char*)configPath.ToUTF8()); 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); pConfig = new wxFileConfig(wxT("FreeDV"), wxT("CODEC2-Project"), configPath, configPath, wxCONFIG_USE_LOCAL_FILE);
wxConfigBase::Set(pConfig); wxConfigBase::Set(pConfig);
// On Linux/macOS, this replaces $HOME with "~" to shorten the title a bit.
wxFileName fn(configPath);
customConfigFileName = fn.GetFullName();
} }
pConfig->SetRecordDefaults(); pConfig->SetRecordDefaults();
@ -240,7 +244,7 @@ bool MainApp::OnInit()
// displayed. But it doesn't when built from command line. Why? // displayed. But it doesn't when built from command line. Why?
frame->m_auiNbookCtrl->ChangeSelection(0); frame->m_auiNbookCtrl->ChangeSelection(0);
frame->Layout(); frame->Layout();
frame->Show(); frame->Show();
g_parent =frame; g_parent =frame;
@ -648,6 +652,12 @@ MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent, wxID_ANY, _("FreeDV ")
pthread_setname_np(pthread_self(), "FreeDV GUI"); pthread_setname_np(pthread_self(), "FreeDV GUI");
#endif // defined(__linux__) #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_reporterDialog = nullptr;
m_filterDialog = nullptr; m_filterDialog = nullptr;

View File

@ -168,6 +168,7 @@ class MainApp : public wxApp
bool CanAccessSerialPort(std::string portName); bool CanAccessSerialPort(std::string portName);
FreeDVConfiguration appConfiguration; FreeDVConfiguration appConfiguration;
wxString customConfigFileName;
// PTT ----------------------------------- // PTT -----------------------------------
unsigned int m_intHamlibRig; unsigned int m_intHamlibRig;