mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-24 16:20:05 +02:00
Merge pull request #267 from Paul-Licameli/ellipsis-problem
Ellipsis problem
This commit is contained in:
commit
ddb4290284
@ -8,7 +8,7 @@ subdir = po
|
|||||||
top_builddir = ..
|
top_builddir = ..
|
||||||
|
|
||||||
# These options get passed to xgettext.
|
# These options get passed to xgettext.
|
||||||
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --keyword=XO --keyword=wxPLURAL:1,2 --add-comments=" i18n" --add-location=file
|
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --keyword=XO --keyword=XXO --keyword=wxPLURAL:1,2 --add-comments=" i18n" --add-location=file
|
||||||
|
|
||||||
# This is the copyright holder that gets inserted into the header of the
|
# This is the copyright holder that gets inserted into the header of the
|
||||||
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
|
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
|
||||||
|
@ -315,16 +315,17 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project )
|
|||||||
auto mManager = project->GetCommandManager();
|
auto mManager = project->GetCommandManager();
|
||||||
wxArrayString mLabels;
|
wxArrayString mLabels;
|
||||||
wxArrayString mNames;
|
wxArrayString mNames;
|
||||||
|
std::vector<bool> vHasDialog;
|
||||||
mLabels.Clear();
|
mLabels.Clear();
|
||||||
mNames.Clear();
|
mNames.Clear();
|
||||||
mManager->GetAllCommandLabels(mLabels, true);
|
mManager->GetAllCommandLabels(mLabels, vHasDialog, true);
|
||||||
mManager->GetAllCommandNames(mNames, true);
|
mManager->GetAllCommandNames(mNames, true);
|
||||||
|
|
||||||
const bool english = wxGetLocale()->GetCanonicalName().StartsWith(wxT("en"));
|
const bool english = wxGetLocale()->GetCanonicalName().StartsWith(wxT("en"));
|
||||||
|
|
||||||
for(size_t i=0; i<mNames.GetCount(); i++) {
|
for(size_t i=0; i<mNames.GetCount(); i++) {
|
||||||
wxString label = mLabels[i];
|
wxString label = mLabels[i];
|
||||||
if( !label.Contains( "..." ) ){
|
if( !vHasDialog[i] ){
|
||||||
label.Replace( "&", "" );
|
label.Replace( "&", "" );
|
||||||
bool suffix;
|
bool suffix;
|
||||||
if (!english)
|
if (!english)
|
||||||
|
583
src/Menus.cpp
583
src/Menus.cpp
File diff suppressed because it is too large
Load Diff
@ -31,6 +31,7 @@ void AddEffectMenuItems(CommandManager *c,
|
|||||||
std::vector<const PluginDescriptor*> & plugs,
|
std::vector<const PluginDescriptor*> & plugs,
|
||||||
CommandFlag batchflags, CommandFlag realflags, bool isDefault);
|
CommandFlag batchflags, CommandFlag realflags, bool isDefault);
|
||||||
void AddEffectMenuItemGroup(CommandManager *c, const wxArrayString & names,
|
void AddEffectMenuItemGroup(CommandManager *c, const wxArrayString & names,
|
||||||
|
const std::vector<bool> &vHasDialog,
|
||||||
const PluginIDList & plugs,
|
const PluginIDList & plugs,
|
||||||
const std::vector<CommandFlag> & flags, bool isDefault);
|
const std::vector<CommandFlag> & flags, bool isDefault);
|
||||||
void CreateRecentFilesMenu(CommandManager *c);
|
void CreateRecentFilesMenu(CommandManager *c);
|
||||||
|
@ -704,6 +704,7 @@ void CommandManager::ClearCurrentMenu()
|
|||||||
mCurrentMenu = nullptr;
|
mCurrentMenu = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
///
|
///
|
||||||
/// Add a menu item to the current menu. When the user selects it, the
|
/// Add a menu item to the current menu. When the user selects it, the
|
||||||
/// given functor will be called
|
/// given functor will be called
|
||||||
@ -760,7 +761,7 @@ void CommandManager::InsertItem(const wxString & name,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandListEntry *entry = NewIdentifier(name, label_in, menu, finder, callback, {}, 0, 0, false);
|
CommandListEntry *entry = NewIdentifier(name, label_in, false, menu, finder, callback, {}, 0, 0, false);
|
||||||
int ID = entry->id;
|
int ID = entry->id;
|
||||||
wxString label = GetLabel(entry);
|
wxString label = GetLabel(entry);
|
||||||
|
|
||||||
@ -774,32 +775,36 @@ void CommandManager::InsertItem(const wxString & name,
|
|||||||
|
|
||||||
mbSeparatorAllowed = true;
|
mbSeparatorAllowed = true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CommandManager::AddCheck(const wxChar *name,
|
void CommandManager::AddCheck(const wxChar *name,
|
||||||
const wxChar *label,
|
const wxChar *label,
|
||||||
|
bool hasDialog,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
CommandFunctorPointer callback,
|
CommandFunctorPointer callback,
|
||||||
int checkmark)
|
int checkmark)
|
||||||
{
|
{
|
||||||
AddItem(name, label, finder, callback, wxT(""),
|
AddItem(name, label, hasDialog, finder, callback, wxT(""),
|
||||||
NoFlagsSpecifed, NoFlagsSpecifed, checkmark);
|
NoFlagsSpecifed, NoFlagsSpecifed, checkmark);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandManager::AddCheck(const wxChar *name,
|
void CommandManager::AddCheck(const wxChar *name,
|
||||||
const wxChar *label,
|
const wxChar *label,
|
||||||
|
bool hasDialog,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
CommandFunctorPointer callback,
|
CommandFunctorPointer callback,
|
||||||
int checkmark,
|
int checkmark,
|
||||||
CommandFlag flags,
|
CommandFlag flags,
|
||||||
CommandMask mask)
|
CommandMask mask)
|
||||||
{
|
{
|
||||||
AddItem(name, label, finder, callback, wxT(""), flags, mask, checkmark);
|
AddItem(name, label, hasDialog, finder, callback, wxT(""), flags, mask, checkmark);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandManager::AddItem(const wxChar *name,
|
void CommandManager::AddItem(const wxChar *name,
|
||||||
const wxChar *label,
|
const wxChar *label,
|
||||||
|
bool hasDialog,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
CommandFunctorPointer callback,
|
CommandFunctorPointer callback,
|
||||||
CommandFlag flags,
|
CommandFlag flags,
|
||||||
@ -807,11 +812,12 @@ void CommandManager::AddItem(const wxChar *name,
|
|||||||
bool bIsEffect,
|
bool bIsEffect,
|
||||||
const CommandParameter ¶meter)
|
const CommandParameter ¶meter)
|
||||||
{
|
{
|
||||||
AddItem(name, label, finder, callback, wxT(""), flags, mask, -1, bIsEffect, parameter);
|
AddItem(name, label, hasDialog, finder, callback, wxT(""), flags, mask, -1, bIsEffect, parameter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandManager::AddItem(const wxChar *name,
|
void CommandManager::AddItem(const wxChar *name,
|
||||||
const wxChar *label_in,
|
const wxChar *label_in,
|
||||||
|
bool hasDialog,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
CommandFunctorPointer callback,
|
CommandFunctorPointer callback,
|
||||||
const wxChar *accel,
|
const wxChar *accel,
|
||||||
@ -827,7 +833,7 @@ void CommandManager::AddItem(const wxChar *name,
|
|||||||
else
|
else
|
||||||
cookedParameter = parameter;
|
cookedParameter = parameter;
|
||||||
CommandListEntry *entry =
|
CommandListEntry *entry =
|
||||||
NewIdentifier(name, label_in, accel, CurrentMenu(), finder, callback,
|
NewIdentifier(name, label_in, hasDialog, accel, CurrentMenu(), finder, callback,
|
||||||
{}, 0, 0, bIsEffect, cookedParameter);
|
{}, 0, 0, bIsEffect, cookedParameter);
|
||||||
int ID = entry->id;
|
int ID = entry->id;
|
||||||
wxString label = GetLabelWithDisabledAccel(entry);
|
wxString label = GetLabelWithDisabledAccel(entry);
|
||||||
@ -864,6 +870,8 @@ void CommandManager::AddItemList(const wxString & name,
|
|||||||
for (size_t i = 0, cnt = nItems; i < cnt; i++) {
|
for (size_t i = 0, cnt = nItems; i < cnt; i++) {
|
||||||
CommandListEntry *entry = NewIdentifier(name,
|
CommandListEntry *entry = NewIdentifier(name,
|
||||||
items[i].Translated(),
|
items[i].Translated(),
|
||||||
|
// No means yet to specify !
|
||||||
|
false,
|
||||||
CurrentMenu(),
|
CurrentMenu(),
|
||||||
finder,
|
finder,
|
||||||
callback,
|
callback,
|
||||||
@ -897,7 +905,7 @@ void CommandManager::AddCommand(const wxChar *name,
|
|||||||
CommandFlag flags,
|
CommandFlag flags,
|
||||||
CommandMask mask)
|
CommandMask mask)
|
||||||
{
|
{
|
||||||
NewIdentifier(name, label_in, accel, NULL, finder, callback, {}, 0, 0, false, {});
|
NewIdentifier(name, label_in, false, accel, NULL, finder, callback, {}, 0, 0, false, {});
|
||||||
|
|
||||||
if (flags != NoFlagsSpecifed || mask != NoFlagsSpecifed) {
|
if (flags != NoFlagsSpecifed || mask != NoFlagsSpecifed) {
|
||||||
SetCommandFlags(name, flags, mask);
|
SetCommandFlags(name, flags, mask);
|
||||||
@ -906,12 +914,13 @@ void CommandManager::AddCommand(const wxChar *name,
|
|||||||
|
|
||||||
void CommandManager::AddGlobalCommand(const wxChar *name,
|
void CommandManager::AddGlobalCommand(const wxChar *name,
|
||||||
const wxChar *label_in,
|
const wxChar *label_in,
|
||||||
|
bool hasDialog,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
CommandFunctorPointer callback,
|
CommandFunctorPointer callback,
|
||||||
const wxChar *accel)
|
const wxChar *accel)
|
||||||
{
|
{
|
||||||
CommandListEntry *entry =
|
CommandListEntry *entry =
|
||||||
NewIdentifier(name, label_in, accel, NULL, finder, callback,
|
NewIdentifier(name, label_in, hasDialog, accel, NULL, finder, callback,
|
||||||
{}, 0, 0, false, {});
|
{}, 0, 0, false, {});
|
||||||
|
|
||||||
entry->enabled = false;
|
entry->enabled = false;
|
||||||
@ -945,6 +954,7 @@ int CommandManager::NextIdentifier(int ID)
|
|||||||
///and keep menus above wxID_HIGHEST
|
///and keep menus above wxID_HIGHEST
|
||||||
CommandListEntry *CommandManager::NewIdentifier(const wxString & name,
|
CommandListEntry *CommandManager::NewIdentifier(const wxString & name,
|
||||||
const wxString & label,
|
const wxString & label,
|
||||||
|
bool hasDialog,
|
||||||
wxMenu *menu,
|
wxMenu *menu,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
CommandFunctorPointer callback,
|
CommandFunctorPointer callback,
|
||||||
@ -955,6 +965,7 @@ CommandListEntry *CommandManager::NewIdentifier(const wxString & name,
|
|||||||
{
|
{
|
||||||
return NewIdentifier(name,
|
return NewIdentifier(name,
|
||||||
label.BeforeFirst(wxT('\t')),
|
label.BeforeFirst(wxT('\t')),
|
||||||
|
hasDialog,
|
||||||
label.AfterFirst(wxT('\t')),
|
label.AfterFirst(wxT('\t')),
|
||||||
menu,
|
menu,
|
||||||
finder,
|
finder,
|
||||||
@ -968,6 +979,7 @@ CommandListEntry *CommandManager::NewIdentifier(const wxString & name,
|
|||||||
|
|
||||||
CommandListEntry *CommandManager::NewIdentifier(const wxString & nameIn,
|
CommandListEntry *CommandManager::NewIdentifier(const wxString & nameIn,
|
||||||
const wxString & label,
|
const wxString & label,
|
||||||
|
bool hasDialog,
|
||||||
const wxString & accel,
|
const wxString & accel,
|
||||||
wxMenu *menu,
|
wxMenu *menu,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
@ -1034,6 +1046,7 @@ CommandListEntry *CommandManager::NewIdentifier(const wxString & nameIn,
|
|||||||
|
|
||||||
entry->name = name;
|
entry->name = name;
|
||||||
entry->label = label;
|
entry->label = label;
|
||||||
|
entry->hasDialog = hasDialog;
|
||||||
entry->key = NormalizedKeyString{ accel.BeforeFirst(wxT('\t')) };
|
entry->key = NormalizedKeyString{ accel.BeforeFirst(wxT('\t')) };
|
||||||
entry->defaultKey = entry->key;
|
entry->defaultKey = entry->key;
|
||||||
entry->labelPrefix = labelPrefix;
|
entry->labelPrefix = labelPrefix;
|
||||||
@ -1666,8 +1679,10 @@ void CommandManager::GetAllCommandNames(wxArrayString &names,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CommandManager::GetAllCommandLabels(wxArrayString &names,
|
void CommandManager::GetAllCommandLabels(wxArrayString &names,
|
||||||
|
std::vector<bool> &vHasDialog,
|
||||||
bool includeMultis) const
|
bool includeMultis) const
|
||||||
{
|
{
|
||||||
|
vHasDialog.clear();
|
||||||
for(const auto &entry : mCommandList) {
|
for(const auto &entry : mCommandList) {
|
||||||
// This is fetching commands from the menus, for use as batch commands.
|
// This is fetching commands from the menus, for use as batch commands.
|
||||||
// Until we have properly merged EffectManager and CommandManager
|
// Until we have properly merged EffectManager and CommandManager
|
||||||
@ -1676,9 +1691,9 @@ void CommandManager::GetAllCommandLabels(wxArrayString &names,
|
|||||||
if ( entry->isEffect )
|
if ( entry->isEffect )
|
||||||
continue;
|
continue;
|
||||||
if (!entry->multi)
|
if (!entry->multi)
|
||||||
names.Add(entry->label);
|
names.Add(entry->label), vHasDialog.push_back(entry->hasDialog);
|
||||||
else if( includeMultis )
|
else if( includeMultis )
|
||||||
names.Add(entry->label);
|
names.Add(entry->label), vHasDialog.push_back(entry->hasDialog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,6 +83,7 @@ struct CommandListEntry
|
|||||||
bool isGlobal;
|
bool isGlobal;
|
||||||
bool isOccult;
|
bool isOccult;
|
||||||
bool isEffect;
|
bool isEffect;
|
||||||
|
bool hasDialog;
|
||||||
CommandFlag flags;
|
CommandFlag flags;
|
||||||
CommandMask mask;
|
CommandMask mask;
|
||||||
};
|
};
|
||||||
@ -154,12 +155,14 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
|||||||
wxMenu* BeginSubMenu(const wxString & tName);
|
wxMenu* BeginSubMenu(const wxString & tName);
|
||||||
void EndSubMenu();
|
void EndSubMenu();
|
||||||
|
|
||||||
|
/*
|
||||||
void InsertItem(const wxString & name,
|
void InsertItem(const wxString & name,
|
||||||
const wxString & label,
|
const wxString & label,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
CommandFunctorPointer callback,
|
CommandFunctorPointer callback,
|
||||||
const wxString & after,
|
const wxString & after,
|
||||||
int checkmark = -1);
|
int checkmark = -1);
|
||||||
|
*/
|
||||||
|
|
||||||
void AddItemList(const wxString & name,
|
void AddItemList(const wxString & name,
|
||||||
const TranslatedInternalString items[],
|
const TranslatedInternalString items[],
|
||||||
@ -170,12 +173,14 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
|||||||
|
|
||||||
void AddCheck(const wxChar *name,
|
void AddCheck(const wxChar *name,
|
||||||
const wxChar *label,
|
const wxChar *label,
|
||||||
|
bool hasDialog,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
CommandFunctorPointer callback,
|
CommandFunctorPointer callback,
|
||||||
int checkmark = 0);
|
int checkmark = 0);
|
||||||
|
|
||||||
void AddCheck(const wxChar *name,
|
void AddCheck(const wxChar *name,
|
||||||
const wxChar *label,
|
const wxChar *label,
|
||||||
|
bool hasDialog,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
CommandFunctorPointer callback,
|
CommandFunctorPointer callback,
|
||||||
int checkmark,
|
int checkmark,
|
||||||
@ -184,6 +189,7 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
|||||||
|
|
||||||
void AddItem(const wxChar *name,
|
void AddItem(const wxChar *name,
|
||||||
const wxChar *label,
|
const wxChar *label,
|
||||||
|
bool hasDialog,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
CommandFunctorPointer callback,
|
CommandFunctorPointer callback,
|
||||||
CommandFlag flags = NoFlagsSpecifed,
|
CommandFlag flags = NoFlagsSpecifed,
|
||||||
@ -193,6 +199,7 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
|||||||
|
|
||||||
void AddItem(const wxChar *name,
|
void AddItem(const wxChar *name,
|
||||||
const wxChar *label_in,
|
const wxChar *label_in,
|
||||||
|
bool hasDialog,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
CommandFunctorPointer callback,
|
CommandFunctorPointer callback,
|
||||||
const wxChar *accel,
|
const wxChar *accel,
|
||||||
@ -223,6 +230,7 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
|||||||
|
|
||||||
void AddGlobalCommand(const wxChar *name,
|
void AddGlobalCommand(const wxChar *name,
|
||||||
const wxChar *label,
|
const wxChar *label,
|
||||||
|
bool hasDialog,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
CommandFunctorPointer callback,
|
CommandFunctorPointer callback,
|
||||||
const wxChar *accel);
|
const wxChar *accel);
|
||||||
@ -281,7 +289,9 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
|||||||
|
|
||||||
void GetCategories(wxArrayString &cats);
|
void GetCategories(wxArrayString &cats);
|
||||||
void GetAllCommandNames(wxArrayString &names, bool includeMultis) const;
|
void GetAllCommandNames(wxArrayString &names, bool includeMultis) const;
|
||||||
void GetAllCommandLabels(wxArrayString &labels, bool includeMultis) const;
|
void GetAllCommandLabels(
|
||||||
|
wxArrayString &labels, std::vector<bool> &vHasDialog,
|
||||||
|
bool includeMultis) const;
|
||||||
void GetAllCommandData(
|
void GetAllCommandData(
|
||||||
wxArrayString &names,
|
wxArrayString &names,
|
||||||
std::vector<NormalizedKeyString> &keys,
|
std::vector<NormalizedKeyString> &keys,
|
||||||
@ -333,6 +343,7 @@ protected:
|
|||||||
int NextIdentifier(int ID);
|
int NextIdentifier(int ID);
|
||||||
CommandListEntry *NewIdentifier(const wxString & name,
|
CommandListEntry *NewIdentifier(const wxString & name,
|
||||||
const wxString & label,
|
const wxString & label,
|
||||||
|
bool hasDialog,
|
||||||
wxMenu *menu,
|
wxMenu *menu,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
CommandFunctorPointer callback,
|
CommandFunctorPointer callback,
|
||||||
@ -342,6 +353,7 @@ protected:
|
|||||||
bool bIsEffect);
|
bool bIsEffect);
|
||||||
CommandListEntry *NewIdentifier(const wxString & name,
|
CommandListEntry *NewIdentifier(const wxString & name,
|
||||||
const wxString & label,
|
const wxString & label,
|
||||||
|
bool hasDialog,
|
||||||
const wxString & accel,
|
const wxString & accel,
|
||||||
wxMenu *menu,
|
wxMenu *menu,
|
||||||
CommandHandlerFinder finder,
|
CommandHandlerFinder finder,
|
||||||
|
@ -1002,12 +1002,16 @@ void Scrubber::AddMenuItems()
|
|||||||
for (const auto &item : menuItems) {
|
for (const auto &item : menuItems) {
|
||||||
if (item.StatusTest)
|
if (item.StatusTest)
|
||||||
cm->AddCheck(item.name, wxGetTranslation(item.label),
|
cm->AddCheck(item.name, wxGetTranslation(item.label),
|
||||||
|
// No menu items yet have dialogs
|
||||||
|
false,
|
||||||
findme, static_cast<CommandFunctorPointer>(item.memFn),
|
findme, static_cast<CommandFunctorPointer>(item.memFn),
|
||||||
false,
|
false,
|
||||||
item.flags, item.flags);
|
item.flags, item.flags);
|
||||||
else
|
else
|
||||||
// The start item
|
// The start item
|
||||||
cm->AddItem(item.name, wxGetTranslation(item.label),
|
cm->AddItem(item.name, wxGetTranslation(item.label),
|
||||||
|
// No menu items yet have dialogs
|
||||||
|
false,
|
||||||
findme, static_cast<CommandFunctorPointer>(item.memFn),
|
findme, static_cast<CommandFunctorPointer>(item.memFn),
|
||||||
item.flags, item.flags);
|
item.flags, item.flags);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user