1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-07 12:12:23 +01:00

All things with an UpdatePrefs() message listen for an event...

... Still to do, improve the handling of updates of only subsets of the prefs
This commit is contained in:
Paul Licameli
2018-02-17 17:42:14 -05:00
parent cc635e0498
commit 62899a32f4
37 changed files with 198 additions and 136 deletions

View File

@@ -71,6 +71,31 @@ int gMenusDirty = 0;
wxDEFINE_EVENT(EVT_PREFS_UPDATE, wxCommandEvent);
PrefsListener::PrefsListener()
{
wxTheApp->Bind(EVT_PREFS_UPDATE, &PrefsListener::OnEvent, this);
}
PrefsListener::~PrefsListener()
{
// Explicit unbinding is needed because this is not a wxEvtHandler
wxTheApp->Unbind(EVT_PREFS_UPDATE, &PrefsListener::OnEvent, this);
}
void PrefsListener::UpdateSelectedPrefs( int )
{
}
void PrefsListener::OnEvent( wxCommandEvent &evt )
{
evt.Skip();
auto id = evt.GetId();
if (id <= 0)
UpdatePrefs();
else
UpdateSelectedPrefs( id );
}
#if 0
// Copy one entry from one wxConfig object to another
static void CopyEntry(wxString path, wxConfigBase *src, wxConfigBase *dst, wxString entry)