mirror of
https://github.com/cookiengineer/audacity
synced 2026-03-11 17:05:26 +01:00
Separate subclass ToolbarMenuVisitor from MenuVisitor
This commit is contained in:
@@ -199,7 +199,7 @@ namespace MenuTable {
|
||||
|
||||
MenuItem::MenuItem( const Identifier &internalName,
|
||||
const TranslatableString &title_, BaseItemPtrs &&items_ )
|
||||
: ConcreteGroupItem< false, MenuVisitor >{
|
||||
: ConcreteGroupItem< false, ToolbarMenuVisitor >{
|
||||
internalName, std::move( items_ ) }, title{ title_ }
|
||||
{
|
||||
wxASSERT( !title.empty() );
|
||||
@@ -208,7 +208,7 @@ MenuItem::~MenuItem() {}
|
||||
|
||||
ConditionalGroupItem::ConditionalGroupItem(
|
||||
const Identifier &internalName, Condition condition_, BaseItemPtrs &&items_ )
|
||||
: ConcreteGroupItem< false, MenuVisitor >{
|
||||
: ConcreteGroupItem< false, ToolbarMenuVisitor >{
|
||||
internalName, std::move( items_ ) }, condition{ condition_ }
|
||||
{
|
||||
}
|
||||
@@ -240,6 +240,8 @@ CommandGroupItem::~CommandGroupItem() {}
|
||||
|
||||
SpecialItem::~SpecialItem() {}
|
||||
|
||||
MenuSection::~MenuSection() {}
|
||||
|
||||
CommandHandlerFinder FinderScope::sFinder =
|
||||
[](AudacityProject &project) -> CommandHandlerObject & {
|
||||
// If this default finder function is reached, then FinderScope should
|
||||
@@ -1058,10 +1060,10 @@ namespace {
|
||||
|
||||
using namespace MenuTable;
|
||||
|
||||
struct MenuItemVisitor : MenuVisitor
|
||||
struct MenuItemVisitor : ToolbarMenuVisitor
|
||||
{
|
||||
MenuItemVisitor( AudacityProject &proj, CommandManager &man )
|
||||
: MenuVisitor(proj), manager( man ) {}
|
||||
: ToolbarMenuVisitor(proj), manager( man ) {}
|
||||
|
||||
void DoBeginGroup( GroupItem &item, const Path& ) override
|
||||
{
|
||||
@@ -1209,7 +1211,7 @@ void MenuCreator::CreateMenusAndCommands(AudacityProject &project)
|
||||
#endif
|
||||
}
|
||||
|
||||
void MenuManager::Visit( MenuVisitor &visitor )
|
||||
void MenuManager::Visit( ToolbarMenuVisitor &visitor )
|
||||
{
|
||||
static const auto menuTree = MenuTable::Items( MenuPathStart );
|
||||
Registry::Visit( visitor, menuTree.get(), &sRegistry() );
|
||||
|
||||
Reference in New Issue
Block a user