mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-17 08:30:06 +02:00
Emit an event when the preferences dialog closes
This commit is contained in:
parent
a78ad42399
commit
cc635e0498
@ -69,6 +69,8 @@ std::unique_ptr<AudacityPrefs> ugPrefs {};
|
|||||||
AudacityPrefs *gPrefs = NULL;
|
AudacityPrefs *gPrefs = NULL;
|
||||||
int gMenusDirty = 0;
|
int gMenusDirty = 0;
|
||||||
|
|
||||||
|
wxDEFINE_EVENT(EVT_PREFS_UPDATE, wxCommandEvent);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// Copy one entry from one wxConfig object to another
|
// Copy one entry from one wxConfig object to another
|
||||||
static void CopyEntry(wxString path, wxConfigBase *src, wxConfigBase *dst, wxString entry)
|
static void CopyEntry(wxString path, wxConfigBase *src, wxConfigBase *dst, wxString entry)
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#include "../include/audacity/ComponentInterface.h"
|
#include "../include/audacity/ComponentInterface.h"
|
||||||
|
|
||||||
#include <wx/fileconf.h> // to inherit wxFileConfig
|
#include <wx/fileconf.h> // to inherit wxFileConfig
|
||||||
|
#include <wx/event.h> // to declare custom event types
|
||||||
|
|
||||||
void InitPreferences();
|
void InitPreferences();
|
||||||
void FinishPreferences();
|
void FinishPreferences();
|
||||||
@ -159,4 +160,8 @@ private:
|
|||||||
const wxString mOldKey;
|
const wxString mOldKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// An event emitted by the application when the Preference dialog commits
|
||||||
|
// changes
|
||||||
|
wxDECLARE_EVENT(EVT_PREFS_UPDATE, wxCommandEvent);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -844,6 +844,9 @@ void PrefsDialog::OnOK(wxCommandEvent & WXUNUSED(event))
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// PRL: Is the following concern still valid, now that prefs update is
|
||||||
|
// handled instead by delayed event processing?
|
||||||
|
|
||||||
// LL: wxMac can't handle recreating the menus when this dialog is still active,
|
// LL: wxMac can't handle recreating the menus when this dialog is still active,
|
||||||
// so AudacityProject::UpdatePrefs() or any of the routines it calls must
|
// so AudacityProject::UpdatePrefs() or any of the routines it calls must
|
||||||
// not cause MenuCreator::RebuildMenuBar() to be executed.
|
// not cause MenuCreator::RebuildMenuBar() to be executed.
|
||||||
@ -851,6 +854,8 @@ void PrefsDialog::OnOK(wxCommandEvent & WXUNUSED(event))
|
|||||||
gAudacityProjects[i]->UpdatePrefs();
|
gAudacityProjects[i]->UpdatePrefs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxTheApp->AddPendingEvent(wxCommandEvent{ EVT_PREFS_UPDATE });
|
||||||
|
|
||||||
WaveformSettings::defaults().LoadPrefs();
|
WaveformSettings::defaults().LoadPrefs();
|
||||||
SpectrogramSettings::defaults().LoadPrefs();
|
SpectrogramSettings::defaults().LoadPrefs();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user