![]() |
Audacity 3.2.0
|
MenuManager handles updates to menu state. More...
#include <Menus.h>
Public Member Functions | |
MenuManager (AudacityProject &project) | |
MenuManager (const MenuManager &) PROHIBITED | |
MenuManager & | operator= (const MenuManager &) PROHIBITED |
~MenuManager () | |
void | UpdateMenus (bool checkActive=true) |
CommandFlag | GetUpdateFlags (bool checkActive=false) const |
void | UpdatePrefs () override |
bool | ReportIfActionNotAllowed (const TranslatableString &Name, CommandFlag &flags, CommandFlag flagsRqd) |
bool | TryToMakeActionAllowed (CommandFlag &flags, CommandFlag flagsRqd) |
![]() | |
MenuCreator () | |
~MenuCreator () | |
void | CreateMenusAndCommands (AudacityProject &project) |
void | RebuildMenuBar (AudacityProject &project) |
![]() | |
virtual | ~Base () |
Static Public Member Functions | |
static MenuManager & | Get (AudacityProject &project) |
static const MenuManager & | Get (const AudacityProject &project) |
static void | Visit (ToolbarMenuVisitor &visitor) |
static void | ModifyUndoMenuItems (AudacityProject &project) |
static void | ModifyToolbarMenus (AudacityProject &project) |
static void | ModifyAllProjectToolbarMenus () |
![]() | |
static void | RebuildAllMenuBars () |
Public Attributes | |
int | mWhatIfNoSelection |
bool | mStopIfWasPaused |
![]() | |
CommandFlag | mLastFlags |
PluginID | mLastGenerator {} |
PluginID | mLastEffect {} |
PluginID | mLastAnalyzer {} |
int | mLastAnalyzerRegistration |
int | mLastAnalyzerRegisteredId |
PluginID | mLastTool {} |
int | mLastToolRegistration |
int | mLastToolRegisteredId |
unsigned | mRepeatGeneratorFlags |
unsigned | mRepeatEffectFlags |
unsigned | mRepeatAnalyzerFlags |
unsigned | mRepeatToolFlags |
Private Member Functions | |
void | TellUserWhyDisallowed (const TranslatableString &Name, CommandFlag flagsGot, CommandFlag flagsRequired) |
void | OnUndoRedo (struct UndoRedoMessage) |
![]() | |
PrefsListener () | |
virtual | ~PrefsListener () |
virtual void | UpdatePrefs ()=0 |
virtual void | UpdateSelectedPrefs (int id) |
Private Attributes | |
Observer::Subscription | mUndoSubscription |
AudacityProject & | mProject |
Additional Inherited Members | |
![]() | |
enum | { repeattypenone = 0 , repeattypeplugin = 1 , repeattypeunique = 2 , repeattypeapplymacro = 3 } |
![]() | |
static void | Broadcast (int id=0) |
Call this static function to notify all PrefsListener objects. More... | |
MenuManager handles updates to menu state.
|
explicit |
Definition at line 81 of file Menus.cpp.
References UndoManager::Get(), mUndoSubscription, OnUndoRedo(), Observer::Publisher< Message, NotifyAll >::Subscribe(), and UpdatePrefs().
MenuManager::MenuManager | ( | const MenuManager & | ) |
|
static |
Definition at line 71 of file Menus.cpp.
References key.
Referenced by anonymous_namespace{PluginMenus.cpp}::AnalyzeMenu(), MacroCommands::ApplyCommandInBatchMode(), CommonTrackPanelCell::DoContextMenu(), EffectUI::DoEffect(), anonymous_namespace{WindowMenus.cpp}::DoMacMinimize(), ProjectAudioManager::DoRecord(), DoReloadPreferences(), anonymous_namespace{PluginMenus.cpp}::EffectMenu(), CommandManager::FilterKeyEvent(), ProjectWindow::FixScrollbars(), anonymous_namespace{PluginMenus.cpp}::GenerateMenu(), Get(), CommandManager::HandleCommandEntry(), anonymous_namespace{PluginMenus.cpp}::HasLastAnalyzerFlag(), anonymous_namespace{PluginMenus.cpp}::HasLastEffectFlag(), anonymous_namespace{PluginMenus.cpp}::HasLastGeneratorFlag(), anonymous_namespace{PluginMenus.cpp}::HasLastToolFlag(), ModifyAllProjectToolbarMenus(), ProjectManager::New(), EffectUIHost::OnApply(), PluginActions::Handler::OnApplyMacroDirectlyByName(), EditToolBar::OnButton(), ExtraActions::Handler::OnFullScreen(), ProjectWindow::OnMenu(), EditActions::Handler::OnPreferences(), PluginActions::Handler::OnRepeatLastAnalyzer(), PluginActions::Handler::OnRepeatLastEffect(), PluginActions::Handler::OnRepeatLastGenerator(), PluginActions::Handler::OnRepeatLastTool(), PluginActions::Handler::OnResetConfig(), ToolManager::OnResetToolBars(), AttachedToolBarMenuItem::OnShowToolBar(), ProjectWindow::OnUpdateUI(), MenuCreator::RebuildAllMenuBars(), CommandManager::RegisterLastAnalyzer(), CommandManager::RegisterLastTool(), SelectUtilities::SelectAllIfNone(), SelectUtilities::SelectAllIfNoneAndAllowed(), anonymous_namespace{PluginMenus.cpp}::ToolsMenu(), and MacrosWindow::UpdateMenus().
|
static |
Definition at line 76 of file Menus.cpp.
References Get().
CommandFlag MenuManager::GetUpdateFlags | ( | bool | checkActive = false | ) | const |
Definition at line 553 of file Menus.cpp.
References GetProjectFrame(), anonymous_namespace{Menus.cpp}::Options(), and anonymous_namespace{Menus.cpp}::RegisteredPredicates().
Referenced by CommonTrackPanelCell::DoContextMenu(), CommandManager::FilterKeyEvent(), EditToolBar::OnButton(), ProjectWindow::OnMenu(), SelectUtilities::SelectAllIfNone(), and SelectUtilities::SelectAllIfNoneAndAllowed().
|
static |
Definition at line 592 of file Menus.cpp.
References Get(), and ModifyToolbarMenus().
Referenced by TrackActions::Handler::OnSyncLock(), TransportActions::Handler::OnTogglePlayRecording(), TransportActions::Handler::OnToggleSoundActivated(), TransportActions::Handler::OnToggleSWPlaythrough(), LabelEditActions::Handler::OnToggleTypeToCreateLabel(), and AdornedRulerPanel::TogglePinnedHead().
|
static |
Definition at line 600 of file Menus.cpp.
References CommandManager::Get(), ProjectSettings::Get(), ToolManager::Get(), gPrefs, settings(), ToolBarCount, and CommandManager::UpdateCheckmarks().
Referenced by ModifyAllProjectToolbarMenus(), ExtraActions::Handler::OnFullScreen(), ToolManager::OnResetToolBars(), AttachedToolBarMenuItem::OnShowToolBar(), and UpdateMenus().
|
static |
Definition at line 444 of file Menus.cpp.
References desc, ProjectHistory::Get(), UndoManager::Get(), CommandManager::Get(), and XXO.
Referenced by anonymous_namespace{EditMenus.cpp}::EditMenu(), and PluginActions::Handler::OnApplyMacroDirectlyByName().
|
private |
Definition at line 513 of file Menus.cpp.
References UndoRedoMessage::Pushed, UndoRedoMessage::Renamed, UndoRedoMessage::Reset, UndoRedoMessage::type, and UndoRedoMessage::UndoOrRedo.
Referenced by MenuManager().
MenuManager & MenuManager::operator= | ( | const MenuManager & | ) |
bool MenuManager::ReportIfActionNotAllowed | ( | const TranslatableString & | Name, |
CommandFlag & | flags, | ||
CommandFlag | flagsRqd | ||
) |
Definition at line 705 of file Menus.cpp.
References CommandManager::Get().
Referenced by CommandManager::HandleCommandEntry(), and EffectUIHost::OnApply().
|
private |
Definition at line 751 of file Menus.cpp.
References anonymous_namespace{Menus.cpp}::Options(), BasicUI::ShowErrorDialog(), and XO.
bool MenuManager::TryToMakeActionAllowed | ( | CommandFlag & | flags, |
CommandFlag | flagsRqd | ||
) |
Determines if flags for command are compatible with current state. If not, then try some recovery action to make it so.
Definition at line 720 of file Menus.cpp.
References anonymous_namespace{Menus.cpp}::Enablers(), and PackedArray::end().
Referenced by ProjectAudioManager::DoRecord().
void MenuManager::UpdateMenus | ( | bool | checkActive = true | ) |
Definition at line 643 of file Menus.cpp.
References anonymous_namespace{Menus.cpp}::Enablers(), CommandManager::Get(), and ModifyToolbarMenus().
Referenced by MacroCommands::ApplyCommandInBatchMode(), EffectUI::DoEffect(), anonymous_namespace{WindowMenus.cpp}::DoMacMinimize(), ProjectWindow::FixScrollbars(), and ProjectWindow::OnUpdateUI().
|
overridevirtual |
Implements PrefsListener.
Definition at line 93 of file Menus.cpp.
References gPrefs, mStopIfWasPaused, and mWhatIfNoSelection.
Referenced by MenuManager().
|
static |
Definition at line 435 of file Menus.cpp.
References MenuTable::Items(), MenuPathStart, anonymous_namespace{Menus.cpp}::sRegistry(), and Registry::Visit().
Referenced by MenuCreator::CreateMenusAndCommands(), and HelpActions::Handler::OnMenuTree().
|
private |
bool MenuManager::mStopIfWasPaused |
Definition at line 125 of file Menus.h.
Referenced by UpdatePrefs().
|
private |
Definition at line 119 of file Menus.h.
Referenced by MenuManager().
int MenuManager::mWhatIfNoSelection |
Definition at line 124 of file Menus.h.
Referenced by UpdatePrefs().