Commit Graph

74 Commits

Author SHA1 Message Date
Paul Licameli dc39f22442 AudacityMessageBox takes TranslatableString message and caption 2019-12-20 21:32:50 -05:00
Paul Licameli ae42397d64 FileNames::SelectFile takes TranslatableString for message 2019-12-20 13:40:20 -05:00
Paul Licameli 3a633e4fd8 XMLFileWriter takes TranslatableString caption 2019-12-19 16:41:48 -05:00
Paul Licameli 89df7a3ffc Use TranslatableString in XMLFileReader & move the help URL logic 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
James Crook 5a3e9cd063 Fix dialog naming
For nicer Doxygen results, we need consistency in naming of classes.
Dialag classes are now called SomethingDialog.
2019-12-06 10:39:07 +00:00
Paul Licameli 96291c5476 Remove second argument of AddWindow(), use Position() instead 2019-12-02 22:01:22 -05:00
Paul Licameli 72df562c4a Conversion of TranslatableString to wxString is private 2019-12-01 18:17:57 -05:00
Paul Licameli e4a7c9ba5b Uses of TranslatableString as value of XO macro...
... It is not implicitly convertible from wxString, compelling many uses of
the new type to fix compilation.
2019-12-01 18:05:20 -05:00
James Crook 9d1b75a5d7 Bug 440 - Metadata Editor: Tags without values can't be added 2019-07-17 15:13:27 +01:00
Paul Licameli c1c0030013 static Tags::Get...
... not member functions of AudacityProject
2019-05-23 14:08:09 -04:00
Paul Licameli 390af96796 Dispatch read of top-level project XML tags with a table of functions...
... which makes Project.cpp a bit less dependent on some details of other
classes

This puts Tags.cpp back into the big strongly connected component of the
dependency graph.  That will be remedied later when Project.cpp becomes a
low-level file
2019-05-20 21:38:07 -04:00
Paul Licameli f86403378b Move AudacityMessageBox to its own files...
... breaking cycles among low-level files introduced by 273ba9f
2019-05-20 14:48:36 -04:00
Paul Licameli 6c57948d8f Remove unnecessary #include-s from .cpp files...
... Unnecessary because transitively included.

But each .cpp file still includes its own .h file near the top to ensure
that it compiles indenendently, even if it is reincluded transitively later.
2019-05-16 17:21:00 -04:00
James Crook f66e753c54 Add option in metadata editor to not show it again
Also added help button to it
Also fixed Bug 2038 - Metadata editor opens without grid focus
2019-04-12 20:18:17 +01:00
Paul Licameli de60edc62f Remove wx/{app,statbmp,spinctrl,scrolbar,dynlib,dcmemory}.h from *.h 2019-03-30 07:57:37 -04:00
Paul Licameli a915a510bd include <wx/setup.h> in all files where wxUSE* macros are used...
... even if it's redundant; improving on what was done at b47e2f9
2019-03-23 14:56:02 -04:00
Paul Licameli da33daf197 Some replacements of wxArrayString with auto 2019-03-10 14:47:12 -04:00
Paul Licameli 795b6a2e42 More std:: style for wxString and wxArrayString...
... Replacing:

Insert => insert
RemoveAt => erase
Remove => erase
IsSameAs => operator == or operator !=
   (but only when second argument was true or default)
2019-03-10 14:45:12 -04:00
Paul Licameli 2db49dc1f0 Use standard library style members of wxArrayString (and wxString) ...
... which will make it easier to change the types of those containers to
std::vectors of other string-like classes

for wxString,

IsEmpty => empty
Clear => clear
Alloc => reserve

for wxArrayString,

Count => size
GetCount => size
IsEmpty => empty
Add => push_back
Clear => clear
Empty => clear
Sort => std::sort (only with default comparator)
SetCount => resize
Last => back
Item => operator []
Alloc => reserve
2019-03-10 14:43:57 -04:00
Paul Licameli 5daa67dfe6 Remove uses of wxSortedArrayString 2019-03-10 14:43:53 -04:00
Steve Daulton 1be17fc7a7 Fix bug 1894 2018-07-03 00:58:41 +01:00
Paul Licameli 8e0cffb7f2 Simplify GuardedCall and default its return type to void 2018-01-13 01:32:41 -05:00
Paul Licameli bfa8a46ced Prohibit duplication of any metadata tag names (up to case); comments 2018-01-09 09:25:22 -05:00
Paul Licameli 44df6455aa Translate the special metadata tags in the edit dialog 2018-01-09 08:47:01 -05:00
Paul Licameli ff40403937 Rewrite EqualMaps again, better. 2018-01-09 08:17:27 -05:00
Paul Licameli 498747269c Correct test of equality of hash maps 2018-01-09 01:00:11 -05:00
Paul Licameli 80a958f8a4 Rewrite empty prompts to ShuttleGUI functions as {} ...
... so we might more easily redefine the type of the function argument,
some other day (not this release)
2018-01-01 22:51:25 -05:00
Paul Licameli ccb4bbac33 Translate "Message" as default title of message box...
... This required a sweeping change of all calls to wxMessageBox!  But it seems
safe to me, despite the great number of touched files.
2018-01-01 17:50:02 -05:00
Paul Licameli a9f5c9c929 Implement ComboEditor::Clone, and use override 2017-11-05 21:35:04 -05:00
Paul Licameli 6a8bba0a99 Fix all remaining misuses of macro _ in static initializers...
... I found them using a rewritten macro _ that dynamically checked
that translations have been initialized.  But I do not commit that changed
macro.
2017-10-01 17:20:05 -04:00
James Crook aee0c4cbc6 Fix for broken build (::None)
None clashed with something else under linux, probably a macro expansion.
2017-08-03 17:25:12 +01:00
Paul Licameli 5d48e96942 Where FileSelector was used, default to Documents not cwd; save prefs 2017-08-03 08:02:33 -04:00
Paul Licameli 3bb04245c5 Strong exception safety in all uses of XMLFileWriter...
... Strong, meaning that the file at the specified path is created or modified
only if all write operations complete without exceptions, barring one very
unlikely possibility that a final file rename fails, but even in that case the
output is successfully written to some path.

This commit does not add throws, but changes the type thrown to a subclass of
AudacityException, so that GuardedCall will cause the user to see an error
dialog in all cases.

Duplicated logic for making temporary files and backups is now all in one
place, the class XMLWriter.

There may be more new GuardedCalls than necessary -- the catch-all for the
event loop, AudacityApp::OnExceptionInMainLoop, might be trusted instead in
some cases --  but they are sufficient.
2017-03-18 11:45:33 -04:00
Paul Licameli b81cdee7e3 Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
Paul Licameli 81285ee0c1 More const and override 2017-03-17 17:52:20 -04:00
David Bailes 06dc9073ab Fix for bug 1550 - metadata editor: esc does not cancel
Problem: on Windows, Esc does not cancel metadata editor.

Fix:
1. In tag.h, for windows, don't override IsEscapeKey().
2. In tag.cpp, for windows, include a return in the function DoCancel, so that if a cell is being edited and the user presses Esc, this just cancels the edit, and not the dialog.

This fix returns the behaviour of the dialog on Windows back to the behaviour prior to commit c1ca055. It only affects the behaviour on Windows.
2017-02-24 16:41:08 +00:00
Paul Licameli 6909bdf398 Define and use IteratorRange 2016-08-13 16:31:31 -04:00
James Crook c3ef4d1571 Bug 1389 - Metadata Editor: First character entered in Genre field is not displayed. 2016-07-15 12:15:29 +01:00
Paul Licameli 84c0337aba Fix TAB key navigation on Mac for all dialogs (not only for panels) 2016-07-10 17:12:27 -04:00
Paul Licameli 79eeb03a50 Bug1382 again: Don't dirty undo stack exporting with no tag change 2016-06-23 23:16:46 -04:00
Paul Licameli c1ca055fa4 Bug1273: Restore 2.1.1 behavior of Metadata editor OK, Cancel, ESC...
Click twice on a grid cell; Cancel or OK dismiss the dialog.  But ESC does not,
and a second ESC does not either.  ESC dismisses the dialog only if the focus
is not in the grid.
2016-06-23 02:58:11 -04:00
Paul Licameli a0290c09d2 Bug1382: Should not make an undo item when exporting with no metadata changes 2016-04-19 18:14:35 -04:00
Paul Licameli 42fcfdab98 Fewer naked news and deletes in Tags.cpp and LabelDialog.cpp 2016-04-08 21:16:18 -04:00
Paul Licameli c87eb0804b Unreported bugs: memory leaks, assertions dismissing Tags and Label editors...
Symptoms were:

Edit metadata; ESC; exit audacity -- memory leaks.

Edit metadata; single-click "Genre" field twice; ESC -- assertion violaion in
Windows debug build.

Make a label; Track > Edit Labels; single-click time field twice; esc -- also
caused assertions, then memory leak at exit.

However, there are still two small memory leaks at exit after using Label
editor, yet unexplained.
2016-04-08 20:48:58 -04:00
Paul Licameli 0c9deb398c Fix mac build. No standard headers in Audacity.h. 2016-03-01 12:22:37 -05:00
Paul Licameli 970205527b Fix argument error, found using override! 2016-02-26 12:35:27 -05:00
Paul Licameli 7824e94030 Harmlessly qualify classes as final (or explicitly comment not)...
... Should have no effect on generated code, except perhaps some slight faster
virtual function calls.  Mostly useful as documentation of design intent.

Tried to mark every one of our classes that inherits from another, or is a
base for others, or has abstract virtual functions, and a few others besides.
2016-02-24 20:58:30 -05:00
Paul Licameli 88eeebcb8b Undoing and redoing of Tags...
Use reference counting (in std::shared_ptr) to avoid replicating Tags with each
Undo state.
2016-02-24 19:25:39 -05:00
Paul Licameli a5b6c9fd8f Add some const qualifiers; define TrackListConstIterator 2016-02-24 19:10:39 -05:00