Commit Graph

92 Commits

Author SHA1 Message Date
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
Paul Licameli ffe9989f7c Don't use an internal iterator in Tags 2016-02-24 19:10:38 -05:00
Paul Licameli 9bf098c7d9 Sweep unnecessary wxString copies: rest 2016-02-23 02:15:56 -05:00
Paul Licameli 97a69e9ccc A few more safenew 2016-02-18 07:17:26 -05:00
Paul Licameli 6052b5f9be Throw by value, catch by reference: don't use pointers...
... that's what the better books on C++ recommend.
2016-02-14 19:36:17 -05:00
Paul Licameli 7c4c45a0d5 "new"->"NEW" in comments, easier to find remaining naked operator new 2016-02-14 18:52:41 -05:00
Steve Daulton 23186f9bf4 Fix for bug 440 2016-01-20 23:56:57 +00:00
Leland Lucius 6a9dae20f5 Appearance on OSX is now back to normal or better
Some additional wx3 cleanup as well.
2015-08-23 20:25:01 -05:00
David Bailes f458df1c7b Changes to a number of dialogs so that the NVDA screen reader can read the titles. Missed these in my last patch. The accessibility name of the dialog is set to the title. 2015-05-18 13:57:05 +01:00
David Bailes 66084b65ef Changes to a number of dialogs so that the nvda screen reader can read their titles. The accessibility name of the dialog is set to the title of the dialog. 2015-05-16 09:35:21 +01:00
Daniel Winzen 759ff8cd0d Performance improvements 2015-04-23 16:07:25 +02:00
david avery 0319f6ea51 merging wx3 changes 2015-04-12 23:52:32 -06:00
lllucius bdcefb4850 Preliminary changes for wxWidgets 3.0.1
We can't go to 3.0.1 yet as there are still build issues on
Linux and OSX.  You can get Windows to build, but there's
still some display issues.

These changes should work with wxWidgets 2.8.12 as well, so
we can take our time to get things working properly before
switching over.
2014-10-06 08:10:50 +00:00
benjamin.drung@gmail.com 277932dccb Remove trailing spaces. 2014-06-03 20:30:19 +00:00
v.audacity 60c47829ed Bug 707 - Metadata Editor: Width and height values in .cfg not respected. Steve's patch. 2014-03-22 03:21:28 +00:00
james.k.crook@gmail.com 30e6a3dec4 Removed some per-file memory allocation debugging that is not needed (and generates warnings) now that we do it from AudacityHeaders.h 2014-01-13 21:21:14 +00:00
martynshaw99 4ce2643d5f Remove the
// Indentation settings for Vim and Emacs
etc. lines from all files, as Campbell's patch (except for other changes to Languages.cpp)
2013-09-24 00:14:37 +00:00
james.k.crook@gmail.com dba81b3f1c Cleanup: Fixed lots of trivial MSVC warnings. 2013-08-25 21:51:26 +00:00
v.audacity c2e0257da5 Metadata Editor:
* "Open Me&tadata Editor..." -> "Edit Me&tadata..." because it's more concise, matches other occurrences, and eliminates any confusion about file opening. 

* In AudacityProject::OnEditMetadata(), "Edit the metadata tags" -> "Edit Metadata Tags": more concise, and brings in line with capitalization standard for dialog titles. 

* Likewise for capitalization in other invocations of ShowEditDialog in ExportMultiple.

* In TagsEditor::PopulateOrExchange(), "RETURN key" -> "ENTER key" because I don't recall ever seeing a Return key on a comnputer (!).
2013-07-10 01:22:55 +00:00
v.audacity dc2d11b1d6 Fix bug 507, per patch from Chandranshu Garg. 2012-08-17 00:04:57 +00:00
v.audacity ebb4f530bb Apparently, wxConfigBase::Write() does not update values for next access on all platforms unless Flush() method is called. Added many calls to wxConfigBase::Flush() to make sure the Rad() calls get the right values. 2012-08-02 06:03:19 +00:00
v.audacity 59db8d4ad4 See http://bugzilla.audacityteam.org/show_bug.cgi?id=451#c31 and http://bugzilla.audacityteam.org/show_bug.cgi?id=451#c32. 2011-11-16 05:59:48 +00:00
martynshaw99 457c91b177 Remove extra Write. 2011-07-24 22:55:09 +00:00
lllucius 60af76d2b3 Bugs 188 and 225
Refer to bugzilla for discussion, but, to summarize, this removes any writing of ID3V1 tags.  ID3V1 tags will still be imported, but they will be written as ID3V2 tags.
2011-03-01 07:06:58 +00:00
ra e74978ba77 Locate and position the current Audacity source code, and clear a variety of old junk out of the way into junk-branches 2010-01-23 19:44:49 +00:00