mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-25 17:08:07 +02:00
AddItemList takes IdentInterfaceSymbol (untranslated) ...
... so that we can use a static constant table of names, which can't use macro _ in initializers.
This commit is contained in:
parent
1b05ba9a78
commit
27aa59ed50
@ -214,7 +214,6 @@ public:
|
|||||||
Temp.Replace( "&","" );
|
Temp.Replace( "&","" );
|
||||||
return Temp;
|
return Temp;
|
||||||
}
|
}
|
||||||
const wxString &TranslatedForMenu() const { return mTranslated; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxString mInternal;
|
wxString mInternal;
|
||||||
|
@ -1146,17 +1146,19 @@ void MenuCreator::CreateMenusAndCommands(AudacityProject &project)
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
const TranslatedInternalString alignLabelsNoSync[] = {
|
// Mutual alignment of tracks independent of selection or zero
|
||||||
{ wxT("EndToEnd"), _("&Align End to End") },
|
static const IdentInterfaceSymbol alignLabelsNoSync[] = {
|
||||||
{ wxT("Together"), _("Align &Together") },
|
{ wxT("EndToEnd"), XO("&Align End to End") },
|
||||||
|
{ wxT("Together"), XO("Align &Together") },
|
||||||
};
|
};
|
||||||
|
|
||||||
const TranslatedInternalString alignLabels[] = {
|
// Alignment commands using selection or zero
|
||||||
{ wxT("StartToZero"), _("Start to &Zero") },
|
static const IdentInterfaceSymbol alignLabels[] = {
|
||||||
{ wxT("StartToSelStart"), _("Start to &Cursor/Selection Start") },
|
{ wxT("StartToZero"), XO("Start to &Zero") },
|
||||||
{ wxT("StartToSelEnd"), _("Start to Selection &End") },
|
{ wxT("StartToSelStart"), XO("Start to &Cursor/Selection Start") },
|
||||||
{ wxT("EndToSelStart"), _("End to Cu&rsor/Selection Start") },
|
{ wxT("StartToSelEnd"), XO("Start to Selection &End") },
|
||||||
{ wxT("EndToSelEnd"), _("End to Selection En&d") },
|
{ wxT("EndToSelStart"), XO("End to Cu&rsor/Selection Start") },
|
||||||
|
{ wxT("EndToSelEnd"), XO("End to Selection En&d") },
|
||||||
};
|
};
|
||||||
static_assert(
|
static_assert(
|
||||||
kAlignLabelsCount == sizeof(alignLabels) / sizeof(alignLabels[0]),
|
kAlignLabelsCount == sizeof(alignLabels) / sizeof(alignLabels[0]),
|
||||||
|
@ -772,7 +772,7 @@ void CommandManager::AddItem(const wxChar *name,
|
|||||||
/// When you call Enable on this command name, it will enable or disable
|
/// When you call Enable on this command name, it will enable or disable
|
||||||
/// all of the items at once.
|
/// all of the items at once.
|
||||||
void CommandManager::AddItemList(const wxString & name,
|
void CommandManager::AddItemList(const wxString & name,
|
||||||
const TranslatedInternalString items[],
|
const IdentInterfaceSymbol items[],
|
||||||
size_t nItems,
|
size_t nItems,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
CommandFunctorPointer callback,
|
CommandFunctorPointer callback,
|
||||||
@ -780,9 +780,10 @@ void CommandManager::AddItemList(const wxString & name,
|
|||||||
bool bIsEffect)
|
bool bIsEffect)
|
||||||
{
|
{
|
||||||
for (size_t i = 0, cnt = nItems; i < cnt; i++) {
|
for (size_t i = 0, cnt = nItems; i < cnt; i++) {
|
||||||
|
auto translated = items[i].Translation();
|
||||||
CommandListEntry *entry = NewIdentifier(name,
|
CommandListEntry *entry = NewIdentifier(name,
|
||||||
items[i].TranslatedForMenu(),
|
translated,
|
||||||
items[i].TranslatedForMenu(),
|
translated,
|
||||||
// No means yet to specify !
|
// No means yet to specify !
|
||||||
false,
|
false,
|
||||||
CurrentMenu(),
|
CurrentMenu(),
|
||||||
|
@ -179,7 +179,7 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
|||||||
};
|
};
|
||||||
|
|
||||||
void AddItemList(const wxString & name,
|
void AddItemList(const wxString & name,
|
||||||
const TranslatedInternalString items[],
|
const IdentInterfaceSymbol items[],
|
||||||
size_t nItems,
|
size_t nItems,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
CommandFunctorPointer callback,
|
CommandFunctorPointer callback,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user