1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 16:37:12 +01:00

Rewrite insertion of menu items by null and Nyquist modules...

... using the new registration system, and without the fragile hacks making
assumptions about the positions of menus within the menu bar.
This commit is contained in:
Paul Licameli
2019-01-05 15:20:28 -05:00
parent baada94567
commit 56cd24a062
7 changed files with 38 additions and 90 deletions

View File

@@ -32,7 +32,6 @@
#include <wx/frame.h>
#include "ModuleManager.h"
#include "Project.h"
#include "ProjectHistory.h"
#include "ProjectSettings.h"
@@ -1046,8 +1045,6 @@ void MenuCreator::RebuildMenuBar(AudacityProject &project)
CommandManager::Get( project ).PurgeData();
CreateMenusAndCommands(project);
ModuleManager::Get().Dispatch(MenusRebuilt);
}
void MenuManager::OnUndoRedo( wxCommandEvent &evt )

View File

@@ -38,8 +38,7 @@ typedef enum
AppInitialized,
AppQuiting,
ProjectInitialized,
ProjectClosing,
MenusRebuilt
ProjectClosing
} ModuleDispatchTypes;
typedef int (*fnModuleDispatch)(ModuleDispatchTypes type);

View File

@@ -477,26 +477,6 @@ wxMenu * CommandManager::CurrentMenu() const
return tmpCurrentSubMenu;
}
void CommandManager::SetCurrentMenu(wxMenu * menu)
{
// uCurrentMenu ought to be null in correct usage
wxASSERT(!uCurrentMenu);
// Make sure of it anyway
uCurrentMenu.reset();
mCurrentMenu = menu;
}
void CommandManager::ClearCurrentMenu()
{
// uCurrentMenu ought to be null in correct usage
wxASSERT(!uCurrentMenu);
// Make sure of it anyway
uCurrentMenu.reset();
mCurrentMenu = nullptr;
}
void CommandManager::AddItem(AudacityProject &project,

View File

@@ -133,8 +133,6 @@ class AUDACITY_DLL_API CommandManager final
std::unique_ptr<wxMenuBar> AddMenuBar(const wxString & sMenu);
// You may either called SetCurrentMenu later followed by ClearCurrentMenu,
// or else BeginMenu followed by EndMenu. Don't mix them.
wxMenu *BeginMenu(const TranslatableString & tName);
void EndMenu();
@@ -235,11 +233,6 @@ class AUDACITY_DLL_API CommandManager final
void Check(const CommandID &name, bool checked);
void Modify(const wxString &name, const TranslatableString &newLabel);
// You may either called SetCurrentMenu later followed by ClearCurrentMenu,
// or else BeginMenu followed by EndMenu. Don't mix them.
void SetCurrentMenu(wxMenu * menu);
void ClearCurrentMenu();
//
// Modifying accelerators
//