1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-12 22:57:43 +02:00

664 Commits

Author SHA1 Message Date
Paul Licameli
3c9cd7925a Fix crash on Linux startup since commit f6e5696 2020-01-28 17:39:40 -05:00
Paul Licameli
103a6050a0 Registry::Visit doesn't require an AudacityProject 2020-01-26 16:22:49 -05:00
Paul Licameli
c7bfa7a2a6 Parametrize ComputedItem::Factory by the type of argument it expects 2020-01-26 16:22:02 -05:00
Paul Licameli
bbccce4386 More rework of the class hierarchy of Registry items 2020-01-26 16:20:15 -05:00
Paul Licameli
356e5d545e Define abstract Visitor for menu items, and concrete subclass...
... The general visitation procedure will find reuse with other specific
actions, and maybe for other non-menu trees too
2020-01-25 15:10:01 -05:00
Paul Licameli
90a22b3982 Split out namespace Registry for non-menu-specific tree manipulation 2020-01-25 15:09:16 -05:00
Paul Licameli
393a098b69 Store a string identifier in each menu item...
... which is not yet used for anything.

It could be used to describe textual paths for attaching plug-in menu items.

Strings are only path local, not necessarily globally unique, and may be
left empty for separators and for groups that should be transparent to
path identification.

It may also be empty for certain sub-menus, such as those that group effects
according to the changeable criteria in Preferences.
2020-01-24 18:05:56 -05:00
Paul Licameli
33b4b409e8 Change class hierarchy of MenuTable::BaseItem...
... There are now four immediate subclasses (SharedItem and Computed Item,
which are final, and SingleItem and GroupItem, which are abstract), which may
serve future purposes more general than menu items.  There are further
subclasses specific to menu management.

The former concrete class GroupItem is renamed TransparentGroupItem.

Also allows direct construction of items in lists from shared pointers.
2020-01-24 18:05:56 -05:00
Paul Licameli
93c2bb9322 Delay evaluation of checkmark states...
... so that more menu item descriptions can be statically constructed once only
2020-01-24 18:05:56 -05:00
Paul Licameli
512c27d422 Simplify the FN macros in src/menus/*.cpp...
... Eliminate repetitious passing of the finder function into each of the
calls to Command and CommandGroup.
2020-01-24 18:05:56 -05:00
Paul Licameli
702b8b1e9d More specific return types for builders of menu descriptions 2020-01-24 18:05:56 -05:00
Paul Licameli
b5c59b29a7 LoadCommands.cpp doesn't depend on individual command classes...
... Remove many #includes and macros.  Use instead a hash generated from the
registry.
2020-01-19 19:21:12 -05:00
Paul Licameli
2522459637 Each command class registers itself 2020-01-19 19:21:12 -05:00
Paul Licameli
0ca5775234 Eliminate one of the ## macro hacks in LoadCommands 2020-01-19 19:21:12 -05:00
Paul Licameli
2ec2ad378d Break dependency cycle introduced at a69fba9 2020-01-19 14:36:28 -05:00
Paul Licameli
2570b56176 Rename Maybe and its members more like std::optional of C++17 2020-01-19 11:38:12 -05:00
Paul Licameli
36aad4d1c6 Don't hard-code the exhaustive list of sub-view types...
... in Wave track context menu and SetTrackVisualsCommand

Instead, discover them through a registry.

This eliminates some duplication of string constants and prepares for
non-intrusive generalization to more kinds of sub-views.

This makes the command agnostic about which subview types are known, but the
context menu still has special case treatment for Spectrogram Settings and
Wave Colors.
2020-01-18 20:26:12 -05:00
James Crook
1176b61953 Wording changes, per wiki:
https://wiki.audacityteam.org/wiki/Wording
2020-01-10 17:02:31 +00:00
Paul Licameli
05e24ec760 Remove unused declaration 2020-01-08 19:53:02 -05:00
Paul Licameli
04a9ce8ba6 Remove some GetActiveProject calls in CommandManager.cpp ...
... The remaining ones, for use in a global event handler, are appropriate
2020-01-08 13:20:00 -05:00
Paul Licameli
a178f0df09 another null check on GetActiveProject 2020-01-07 18:45:56 -05:00
Paul Licameli
545fab88dd Eliminate GetActiveProject from ScreenshotCommand 2020-01-07 16:32:52 -05:00
Paul Licameli
02e5b8db07 Remove unnecessary members of CommandHandler...
... see also commit 02d5e6c
2020-01-04 12:59:37 -05:00
Paul Licameli
c9a9c06bd0 Pass AudacityProject * into preference panel factories 2020-01-04 12:37:57 -05:00
Paul Licameli
83f7bc6b5c Eliminate some uses of GetActiveProject...
... where there was already a project at hand
2020-01-02 13:15:14 -05:00
Paul Licameli
d23569ca10 Construct Exporter with project pointer, fewer GetActiveProject calls 2020-01-02 13:13:48 -05:00
Paul Licameli
a1eeb528b7 Lift a call to GetActiveProject into ScriptCommandRelay...
... Don't do it at the low level of construction of a command object.  Do it
only at the highest possible level, where an external scripting module or
Nyquist calls into the command framework.  Pass the project pointer down where
it is needed.
2020-01-02 13:05:09 -05:00
Paul Licameli
747c35645a TranslatableString for checkbox captions 2019-12-23 19:15:34 -05:00
Paul Licameli
6b235bdec5 TranslatableString for captions of sliders 2019-12-23 19:02:21 -05:00
Paul Licameli
acd1158e1b TranslatableString for titles, and spin control and combo prompts 2019-12-23 18:53:00 -05:00
Paul Licameli
5168d62e3d TranslatableString for captions of text entry boxes 2019-12-23 18:53:00 -05:00
Paul Licameli
21e7b9f2de TranslatableString for prompts of choice controls 2019-12-23 15:39:49 -05:00
Paul Licameli
75996a851c ShuttleGui::AddChoice and TieChoice take TranslatableStrings 2019-12-23 15:35:47 -05:00
David Bailes
a512706646 Bug 2262 - Scriptables are non-functional
Caused by commit e496876.
Problem caused by moving cookedParameter to another function, which then wasn't used.
2019-12-23 11:08:19 +00:00
Paul Licameli
1537930195 DiscoverPluginsAtPath reports error as TranslatableString 2019-12-20 22:06:18 -05:00
Paul Licameli
2214b5ff3b Pass friendly macro command names as TranslatableString 2019-12-20 21:36:11 -05:00
Paul Licameli
dc39f22442 AudacityMessageBox takes TranslatableString message and caption 2019-12-20 21:32:50 -05:00
Paul Licameli
d8c2610d88 TranslatableString in AudacityCommand::MessageBox, Effect::MessageBox 2019-12-20 21:32:47 -05:00
Paul Licameli
e3ea93a624 Define and use function Verbatim...
... in cases of "TranslatableString" that are not really translated.

This makes it easier to scan the code for such unusual constructions of
TranslatableString, distinct from mere mentions of the TranslatableString type.
2019-12-19 22:49:23 -05:00
Paul Licameli
5e26ef1eba Define and use non-mutating TranslatableString::Stripped 2019-12-19 16:41:45 -05:00
Paul Licameli
092033b284 Just one accessor for the name of a ComponentInterface...
... Translate it explicitly where needed.
2019-12-19 11:47:37 -05:00
Paul Licameli
618fee21ec TranslatableString for ComponentInterface::GetDescription() 2019-12-16 14:21:57 -05:00
Paul Licameli
54e2bbd8ff Remove TranslatedInternalString, use ComponentInterfaceSymbol 2019-12-16 10:58:05 -05:00
Paul Licameli
53ee9c9800 TranslatableString for titles, names, labels of wxDialogWrappers...
... Found one missed translation in CommandTargets.cpp
2019-12-16 10:58:05 -05:00
Paul Licameli
fbebef2911 CommandFlagOptions::MessageFormatter uses TranslatableString 2019-12-16 10:58:05 -05:00
Paul Licameli
5639f834c8 CommandManager stores labels as TranslatableString 2019-12-16 10:58:05 -05:00
Paul Licameli
f2f7568383 Fix checks for tabs in CommandManager & don't write labels to file...
... Because label wasn't used when reading back, and it was, questionably,
writing localized strings out.

CommandManager serialization is used only for exporting and importing keystroke
shortcuts, and not in save and load of projects.

There was apparently confusion too about tab characters separating command name
from a menu accelerator, but such are not stored in the label field of
CommandListEntry.  Those tabs were only added by certain accessor functions,
which are here renamed.
2019-12-15 14:54:57 -05:00
Paul Licameli
9a609fe1fe TranslatableString in ProgressDialog 2019-12-14 01:48:15 -05:00
Paul Licameli
a8de4d9e50 Construct MenuItem with untranslated label, so it can be static...
... and other storage of TranslatableString instead of naked wxString, for
management of menu items, in CommandManager
2019-12-12 15:49:00 -05:00
Paul Licameli
70ec69fa3d Pass untranslated command labels to CommandManager...
... and deduce whether to exclude from macros inside NewIdentifier, simplifying
argument lists further

Also fix the localization of "..." added to names by PluginMenus.cpp
2019-12-12 15:15:59 -05:00