Commit Graph

243 Commits

Author SHA1 Message Date
Paul Licameli 010fe7bff2 Fix complaint from xgettext about empty string 2021-05-21 20:41:27 -04:00
Paul Licameli 5fef82dccf Define Setting classes, bundling config path with settings value...
... the intention being, that no string literal for a path, or its default
value, shall ever occur twice in the code, relying on long-distance coincidence
of literal values.  Instead, a named Setting object is constructed once, then
read and written.

For now, the Tie... functions in ShuttleGuiBase will take references to
implicitly constructed temporary Setting objects.  But all should later be
made static objects, and the constructors made explicit.
2021-05-17 08:46:08 -04:00
Paul Licameli c5ebc396eb Audacity.h has shrunk to nothing, now remove it! 2021-05-10 00:05:23 -05:00
Paul Licameli e653b4aaf8 Eliminate Experimental.h, configure compile options instead...
... This makes it impossible to forget to include the EXPERIMENTAL definitions
(such as when cutting and pasting code) and so get unintended quiet changes of
behavior.

The EXPERIMENTAL flags are now specified instead in new file Experimental.cmake
2021-04-27 12:40:07 -04:00
James Crook 67dff35a12 Bug 2640 - Plot Spectrum and Contrast analyzers are not "Repeatable"
Completing the update by John Colket.  The plan always was that
these new 'repeat' entries were optional commands bindable to
keyboard shortcuts by advanced users.

Users visiting the menus can re-select the item they want.
For these menu users it would be confusing/overload to list
these repeat commands in the menu.  Repeat last effect in the Effects
menu is more important.  It is there in the menu to signal to
users that there is the Ctrl+R key binding for it.
2021-02-03 11:40:21 +00:00
JohnColket a3d9f41fb4
Bug 2582 - Enh: Repeat last Process, Part 2 (#734) 2021-02-03 11:02:49 +00:00
luzpaz 7a3bdcf3f2
Fix typos (user facing and non-user facing) (#727)
Found via `codespell v2.1.dev0`  
`codespell -q 3 -S *.po,./lib-src -L parm,parms,toke`
2021-01-24 09:46:08 +00:00
Leland Lucius 50e803a974 Rework of commit b4a0be9
See comments 6-9 in bug #2642 for the problem it caused.
2021-01-22 15:16:38 -06:00
Leland Lucius 4e6e3c2089 Swapped cut/copy IDs 2021-01-22 09:23:36 -06:00
Leland Lucius b4a0be99cd Bug 1579 - Mac: Cut/Copy from file save dialogs using shortcuts does not work
And Bug 1300 - Mac: COMMAND + V paste limitations in standard file save dialogs
2021-01-21 18:45:01 -06:00
freddii 534359de6c
Fix minor typos (#720)
Co-authored-by: freddii <https://freddii@github.com>
2021-01-12 11:56:09 +00:00
Paul Licameli 3313b33050 Move helper structure definitions out of CommandManager.h...
... and remove an indirection in handling one of them
2020-05-26 09:49:22 -04:00
Paul Licameli 0ef7213a2e Bug2453: Shoudln't show & accelerators in dialog text for key prefs 2020-05-25 19:57:20 -04:00
Paul Licameli 8ce72748bf CommandManager stores only stripped menu names (no & characters)...
... Keyboard preference dialog does not need to repeat the stripping
2020-05-23 22:42:21 -04:00
Paul Licameli 1ef29b7a51 Don't encode command options as part of accelerator string...
... also restore the intended meaning of "allowDup" (for debugging checks only),
which had never been properly implemented because the label, not the
accelerator, was scanned for it; see commit f2f7568
2020-05-23 22:41:35 -04:00
Leland Lucius 1ca911ed38 Convert all __WXDEBUG__ tests to use new _DEBUG symbol
This symbol is based on the NDEBUG symbol that's automatically
defined by CMake.
2020-04-25 02:36:27 -05:00
Yuri Chornoivan d1ada5f08c Fix minor typos 2020-04-11 10:06:24 +01:00
David Bailes b67c82171c Bug 2329 - Keyboard shortcuts: new or changed defaults can create duplicates
Problem:
If a new version of Audacity introduces a new default shortcut, or changes an existing one, then this may be the same shortcut as a user has previously assigned to another command. Both commands will have the same shortcut, and the shortcut will only execute one of those commands.

Fix:
Check for any such duplicates when a user opens a version of audacity using an audacity.cfg file which was created with a different version.
For each duplicate found, remove the shortcut from the command which has a new or changed default.
If duplicates where found, open a message box informing the user of the removed shortcuts.
2020-02-19 15:02:08 +00:00
Paul Licameli 7f4d61257a Command manager stores checkmark predicates...
... and we use them to simplify (the misnamed) MenuManager::ModifyToolbarMenus.

It looked wrong that statically constructed menu descriptions should ever hold
constant boolean checkmark values, rather than functions to re-eveluate the
checkmark state as needed.
2020-02-01 12:53:55 -05:00
Binary Wisdom 9bce51a60e Bug 624: Keyboard Prefs: importing XML file can cause duplicated bindings
The fix follows the agreed behavior (see emails from around October 25) . For the sake of convenience see the agreed behavior below:

_"- first, check the xml-file. If it contains illegal shortcut duplicates, refuse importing. Shortcut duplicates are LEGAL if default settings also have those operations with the matching shortcuts. A refusal to import shortcuts must happen with the message that warns the user of a failure and explains the reason.

if the xml-file looks ok, import the shortcuts. As discussed before, because different versions of Audacity might have different sets of operations with shortcuts, it is still possible to end up with illegal shortcut duplicates for a perfectly correct xml-file. This situation must be monitored. In case of any conflicts, the shortcut from the xml-file is used, and the pre-existing shortcut is wiped clean.
When telling the user the commands which have had their shortcut removed, I think it would be useful to tell the user the name of the command, the shortcut, and and name of the command which still has that shortcut."_

I didn't find a clean way to intercept the imported content before it makes its way to the shortcut preferences, so I had to jump through some hoops right in KeyConfigPrefs::OnImport().
In general, I tried to keep changes minimal.
2020-01-31 11:32:23 +00:00
Paul Licameli 56cd24a062 Rewrite insertion of menu items by null and Nyquist modules...
... using the new registration system, and without the fragile hacks making
assumptions about the positions of menus within the menu bar.
2020-01-30 15:09:30 -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 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
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 dc39f22442 AudacityMessageBox takes TranslatableString message and caption 2019-12-20 21:32:50 -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 54e2bbd8ff Remove TranslatedInternalString, use ComponentInterfaceSymbol 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 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
Paul Licameli 5cbafc6086 Clarifying name change in CommandManager & simplify PluginMenus...
... The purpose of the boolean field in command entries was to exclude certain
menu commands from being steps in macros, because they require user interaction.

Effects are never meant to be excluded, even though they normally have dialogs,
but in the context of macro execution, the parameters are supplied by other
means.
2019-12-12 15:15:59 -05:00
Paul Licameli db96d1ab10 AddItemList no longer parses names for accelerators...
... This capability was unused.  The only uses of item lists are in
TrackMenus.cpp, for aligning tracks.

The parsing of a translated string for encoded infomration was questionable.
2019-12-12 15:15:59 -05:00
Paul Licameli e4968761ad CommandManager::NewIdentifier bundles some arguments in Options 2019-12-12 15:15:59 -05:00
Paul Licameli 6f28f228a1 Remove unused functions CommandManager::AddCommand 2019-12-12 15:15:59 -05:00
Paul Licameli 1e52400936 Remove overload of NewIdentifier that was used only once 2019-12-12 15:15:59 -05:00
James Crook 582d8afdcb Bug 2118 - "Q" shortcut for "Toggle Spectral Selection is not in the Standard set 2019-07-15 08:53:16 +01:00
Paul Licameli 7e1c469d7f Remove some unnecessary #include directives 2019-07-09 12:45:50 -04:00
Paul Licameli 796301efda CommandManager.cpp does not include AudacityHeaders.h ...
... which I think was only meant to define a precompiled header for speed on
Windows, and is not necessary for compilation.  It is not included in many
other places.

The result is to shrink the big s.c.c. from 44 to 38.  Five files remain in
a new small component:

CommandManager
Menus
ToolBar
ToolDock
ToolManager

The sixth freed file is AudacityHeaders itself.
2019-06-18 18:30:40 -04:00
Paul Licameli b84f5b66f0 CommandManager.cpp does not depend on EffectManager...
... some code lifted into BatchCommands.cpp to realize this.

It also doesn't depend on PluginManager, but that is not important for breaking
cycles.
2019-06-16 01:24:29 -04:00
Paul Licameli f9b0281b47 Move TellUserWhyDisallowed into MenuManager...
... so we don't have MenuManager calling CommandManager which calls it back.
2019-06-16 01:21:04 -04:00
Paul Licameli 9a4c18255e Eliminate type alias CommandMask 2019-06-14 10:12:45 -04:00
Paul Licameli e5a786c420 4th arg of ReportIfActionNotAllowed always == 3rd; eliminate it 2019-06-14 10:12:45 -04:00
Paul Licameli ca5259712c HandleCommandEntry's 3rd parameter was two-valued, make it bool...
... false when it was NoFlagsSpecified, true when it was AlwaysEnabledFlag
2019-06-14 10:12:45 -04:00
Paul Licameli 0f2278d394 Eliminate the confusing mask from CommandManager entries...
... In fact it was only ever different from flags when flags had the special
NoAutoSelect and mask did not.  Now put that bit in the mask too, and make
the special NoAutoSelect always true in MenuManager::GetUpdateFlags().  This
still preserves the intended effects of NoAutoSelect.
2019-06-14 10:12:45 -04:00
Paul Licameli 64650b9a55 Third argument of EnableUsingFlags was always all-ones; eliminate it 2019-06-14 10:12:45 -04:00
Paul Licameli a34f1cbba5 Reimplement the rejection of select-all-on-none for certain commands...
... Specify it in the menu descriptions.  Don't put special ad hoc logic
in Menus.cpp.
2019-06-14 10:12:44 -04:00
Paul Licameli 36e3a03c7f Redo CommandFlags as std::bitset, allow registration of values 2019-06-14 00:31:15 -04:00
Paul Licameli ef8c100cee MenuManager holds a back-reference to project; simplifies calls 2019-06-12 11:08:50 -04:00