mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-24 16:20:05 +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( "&","" );
|
||||
return Temp;
|
||||
}
|
||||
const wxString &TranslatedForMenu() const { return mTranslated; }
|
||||
|
||||
private:
|
||||
wxString mInternal;
|
||||
|
@ -1146,17 +1146,19 @@ void MenuCreator::CreateMenusAndCommands(AudacityProject &project)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const TranslatedInternalString alignLabelsNoSync[] = {
|
||||
{ wxT("EndToEnd"), _("&Align End to End") },
|
||||
{ wxT("Together"), _("Align &Together") },
|
||||
// Mutual alignment of tracks independent of selection or zero
|
||||
static const IdentInterfaceSymbol alignLabelsNoSync[] = {
|
||||
{ wxT("EndToEnd"), XO("&Align End to End") },
|
||||
{ wxT("Together"), XO("Align &Together") },
|
||||
};
|
||||
|
||||
const TranslatedInternalString alignLabels[] = {
|
||||
{ wxT("StartToZero"), _("Start to &Zero") },
|
||||
{ wxT("StartToSelStart"), _("Start to &Cursor/Selection Start") },
|
||||
{ wxT("StartToSelEnd"), _("Start to Selection &End") },
|
||||
{ wxT("EndToSelStart"), _("End to Cu&rsor/Selection Start") },
|
||||
{ wxT("EndToSelEnd"), _("End to Selection En&d") },
|
||||
// Alignment commands using selection or zero
|
||||
static const IdentInterfaceSymbol alignLabels[] = {
|
||||
{ wxT("StartToZero"), XO("Start to &Zero") },
|
||||
{ wxT("StartToSelStart"), XO("Start to &Cursor/Selection Start") },
|
||||
{ wxT("StartToSelEnd"), XO("Start to Selection &End") },
|
||||
{ wxT("EndToSelStart"), XO("End to Cu&rsor/Selection Start") },
|
||||
{ wxT("EndToSelEnd"), XO("End to Selection En&d") },
|
||||
};
|
||||
static_assert(
|
||||
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
|
||||
/// all of the items at once.
|
||||
void CommandManager::AddItemList(const wxString & name,
|
||||
const TranslatedInternalString items[],
|
||||
const IdentInterfaceSymbol items[],
|
||||
size_t nItems,
|
||||
CommandHandlerFinder finder,
|
||||
CommandFunctorPointer callback,
|
||||
@ -780,9 +780,10 @@ void CommandManager::AddItemList(const wxString & name,
|
||||
bool bIsEffect)
|
||||
{
|
||||
for (size_t i = 0, cnt = nItems; i < cnt; i++) {
|
||||
auto translated = items[i].Translation();
|
||||
CommandListEntry *entry = NewIdentifier(name,
|
||||
items[i].TranslatedForMenu(),
|
||||
items[i].TranslatedForMenu(),
|
||||
translated,
|
||||
translated,
|
||||
// No means yet to specify !
|
||||
false,
|
||||
CurrentMenu(),
|
||||
|
@ -179,7 +179,7 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
||||
};
|
||||
|
||||
void AddItemList(const wxString & name,
|
||||
const TranslatedInternalString items[],
|
||||
const IdentInterfaceSymbol items[],
|
||||
size_t nItems,
|
||||
CommandHandlerFinder finder,
|
||||
CommandFunctorPointer callback,
|
||||
|
Loading…
x
Reference in New Issue
Block a user