Commit Graph

65 Commits

Author SHA1 Message Date
Paul Licameli e6e96de0fd Replace most inclusions of MemoryX.h with <memory> ...
... Most often it was needed for a custom definition of std::make_unique, but
we build C++14 now.
2021-06-02 07:08:19 -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 2c5c0f9dfd Class AudacityPrefs renamed, moved, reused in PluginManager...
... And construction of the main instance is hoisted into AudacityApp
2021-01-31 11:11:03 -05:00
Paul Licameli 05d5f2677c Fix comments, remove unnecessary #include 2021-01-31 08:51:31 -05:00
Leland Lucius 21296b0cf1 New wrapper for wxFileConfig to fix several bugs
Bug 2135 - Audacity crashes if launched with a locked pluginregistry.cfg file
Bug 2651 - If pluginregistry.cfg gets locked while Audacity is active the Plug-in Manager is blocked - with no help
Bug 2650 - Virgin launch fails with no pluginregistry.cfg file created
Bug 1264 - Writing to locked audacity.cfg not reported to user
Bug 2649 - Launching Audacity with a locked audacity.cfg file gives not one but three error messages - and no help
Bug 2652 - User is not warned if they launch Audacity with a locked pluginsettings.cfg file
2021-01-31 04:24:35 -06:00
Paul Licameli 2c8c5799f6 Correct menu ordering after "Reset Configuration" command, see f5afb28 2020-05-25 14:24:14 -04:00
Paul Licameli 046ee21e72 Move GetEditClipsCanMove to global function in TracksBehaviorsPrefs.cpp 2020-03-09 11:23:08 -04:00
Paul Licameli 75996a851c ShuttleGui::AddChoice and TieChoice take TranslatableStrings 2019-12-23 15:35:47 -05:00
Paul Licameli dc39f22442 AudacityMessageBox takes TranslatableString message and caption 2019-12-20 21:32:50 -05:00
James Crook 23f05c618c Fix signed/unsigned comparison warnings. 2019-12-06 11:33:22 +00:00
Paul Licameli b351eabf47 ComponentInterfaceSymbol contains TranslatableString 2019-12-01 18:08:56 -05:00
Paul Licameli 0d910bbe02 EnumSetting has a template parameter 2019-11-27 13:37:24 -05:00
Paul Licameli 85b06fe6d0 Define ChoiceSetting::ReadWithDefault ...
... because some calls might not have used the same defaults as in the Tie...
functions
2019-11-27 13:37:24 -05:00
Paul Licameli bc08f571dc ChoiceSetting default is changeable and can be unspecified 2019-11-27 13:37:23 -05:00
Paul Licameli 1236c5bfed class EnumValueSymbols lets you specify a table...
... of EnumValueSymbol either row-wise or column-wise
2019-11-27 13:37:23 -05:00
Paul Licameli 9b67e7538f ChoiceSetting contains vectors; simplify constructions of it 2019-11-27 13:37:23 -05:00
Paul Licameli c98ab0aec9 Make RecordingPrefs.cpp independent of Warning 2019-07-13 19:54:41 -04:00
Paul Licameli a08bd5782b Break cycle of Prefs, Languages, FileNames 2019-07-09 12:21:08 -04:00
Paul Licameli 1fa46eb085 Bug2135: startup should not fail quietly when audacity.cfg is locked...
simplest fix is simply to put up a message box explaining it
2019-06-28 10:51:41 -04:00
Paul Licameli 56a05cc646 Avoid Win startup crash...
... Because of different ordering of file-scope static initializations, visiting
TrackInfo.cpp before wxApp is initialized.  (This didn't happen on Mac.)

This requires other changes to PrefsListener so that safe unbinding is
guaranteed by destructors, even if the PrefsListener is destroyed after the
global wxApp object.
2019-06-27 09:26:43 -04:00
Paul Licameli 62899a32f4 All things with an UpdatePrefs() message listen for an event...
... Still to do, improve the handling of updates of only subsets of the prefs
2019-05-20 21:38:13 -04:00
Paul Licameli cc635e0498 Emit an event when the preferences dialog closes 2019-05-20 21:38:13 -04:00
Paul Licameli 5c1ae17f6d Prefs.cpp has fewer dependencies...
... when special initial population of preferences is lifted into
AudacityApp.cpp.

This takes four files out of the big strongly connected component of the graph
into low levels, but three of them (Prefs, Languages, FileNames) are still in
a small cycle.  FileHistory is the fourth, depending on the others.
2019-05-18 20:29:25 -04:00
Paul Licameli 4a4f8ebe4e Move language setting and event from AudacityApp.h to GUIPrefs.h 2019-05-17 16:29:04 -04:00
Paul Licameli 236c8ed51e Move version keys from AudacityApp to AudacityPrefs 2019-05-17 16:29:04 -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
Paul Licameli 1649e3669e Rename EnumSetting -> ChoiceSetting, EncodedEnumSetting -> EnumSetting 2019-04-07 16:42:11 -04:00
Paul Licameli 39f2d1ca52 We don't need wx/config.h at all...
...because we don't use the (platform-dependent) typedef wxConfig at all.  We
use wxFileConfig directly instead, even on Windows, not using the native
Windows registry.
2019-03-31 14:27:06 -04:00
Paul Licameli 6ce24d3cd8 Utilities to get current app language & reset it to default...
... Renaming "InitLang" to "SetLang", then reusing the name "InitLang"
2019-03-27 12:29:18 -04:00
Paul Licameli da895783fd A few more uses of type alias EnumValueSymbol where more proper 2019-03-19 15:15:09 -04:00
Paul Licameli 5e7d41ec07 Each .cpp/.mm file includes corresponding header before any other...
... except Audacity.h

This forces us to make each header contain all forward declarations or nested
headers that it requires, rather than depend on context.
2019-03-17 22:54:52 -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
James Crook 466e9c179e Create ComponentInterface
It combines the old IdentInterface with the ParamsInterface, providing an identifier and parameters (if needed).
The main purpose of the change is to make the class hierarchy (as viewed via doxygen) much easier to follow.
2018-11-02 17:04:43 +00:00
James Crook 657159d542 Fix C4189 and C4100 Warnings
C4189 is 'Local variable initialised but not used'
C4100 is 'Unreferenced parameter'

Fixed some other warnings, e.g. about empty if, too.
2018-10-10 19:46:24 +01:00
James Crook 2d2f282c83 Bug 825 - Sync Lock behaves inconsistently when moving of clips is disabled
Sync Lock on now means clips can move.  So it 'trumps' that setting, when on.
2018-04-11 18:51:31 +01:00
Paul Licameli 7f7f739fe5 Define EnumSetting and EncodedEnumSetting 2018-03-25 13:45:29 -04:00
David Bailes cfdb7950f1 Update fix for #1554
This is an update to commit 516af71. The Dock key is now retained in the config file, so that if a user goes back to a version before the fix, the toolbar layout remains unchanged.

Note that when ToolManager::ReadConfig() is called, InitPreferences has already been called which has set the version keys to the current version of Audacity. Therefore the initial values of these keys are stored in AudacityApp.
2018-01-10 11:33:05 +00:00
Paul Licameli c6696f1b49 Move definition of _ and related into Internat.h 2018-01-06 21:03:32 -05:00
Paul Licameli 7fd78183d2 Remove needless uses of wxString::c_str() in wxString::Format...
... and similar wx "variadics," which all treat wxString smartly enough that
you don't need this.

Don't need c_str either to convert wxString to const wxChar * because
wxString has a conversion operator that does the same.
2018-01-01 20:34:33 -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
James Crook f463eda36c Clean up some dead code and MSVC warnings.
- Dead code from experiments in SelectionBar removed.
- Many warnings about unused parameters fixed with WXUNUSED()
- Many warnings about signed / unsigned comparisons cleaned up.
- Several 'local variable declared but not used' warnings fixed.
2017-12-08 15:20:39 +00:00
James Crook 46154d0dca Upgraders to 2.2.0 retain the full set of default shortcuts.
If they delete audacity.cfg they get the new smaller set of defaults.  Also if they explicitly ask for the standard set.
2017-06-30 21:38:20 +01:00
James Crook 53c3adfbe7 Bug 1577 - Application configuration file location incorrect on Linux/case-sensitive Macs
On windows the capitalisation does not matter.
On Mac/Windows we use 'audacity' in path names, even if the directories wxWidgets suggests have 'Audacity'.
2017-01-25 22:15:03 +00:00
Paul Licameli f9f95471b5 Don't compile unused static function 2016-09-19 11:47:48 -04:00
Paul Licameli 942c62b6f6 Remove some naked new amd delete in: various 2016-08-08 07:51:24 -04:00
Paul Licameli f00144e9a5 Sweep for filename copying: various 2016-04-10 22:26:28 -04:00
Paul Licameli 7c4c45a0d5 "new"->"NEW" in comments, easier to find remaining naked operator new 2016-02-14 18:52:41 -05:00
Paul Licameli 907c950a0e Bug1288: Don't crash when changing language to "Simplified"...
... but give a warning message about the unknown language.
2016-01-26 20:09:54 -05:00
Leland Lucius 054ec3ee1a Fix for bug #673 2015-06-03 01:22:18 -05:00