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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user