1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-26 14:41:14 +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

@@ -13,6 +13,7 @@
#include "audacity/Types.h"
#include <wx/string.h> // member variable
#include "Prefs.h"
class wxArrayString;
class AudacityProject;
@@ -32,13 +33,6 @@ enum EffectType : int;
typedef wxString PluginID;
typedef wxArrayString PluginIDs;
class PrefsListener
{
public:
virtual ~PrefsListener();
virtual void UpdatePrefs(); // default is no-op
};
class MenuCreator
{
public:
@@ -56,9 +50,11 @@ public:
PluginID mLastEffect{};
};
class MenuManager : public MenuCreator
class MenuManager final : public MenuCreator, private PrefsListener
{
public:
MenuManager();
static void ModifyUndoMenuItems(AudacityProject &project);
static void ModifyToolbarMenus(AudacityProject &project);
// Calls ModifyToolbarMenus() on all projects
@@ -72,7 +68,7 @@ public:
// inactive project as it is needlessly expensive.
CommandFlag GetUpdateFlags(
AudacityProject &project, bool checkActive = false);
void UpdatePrefs();
void UpdatePrefs() override;
// Command Handling
bool ReportIfActionNotAllowed(