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:
14
src/Menus.h
14
src/Menus.h
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user