Update of /cvsroot/audacity/audacity-src/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv13117
Modified Files:
AudacityApp.cpp AudacityApp.h
Log Message:
A better way of doing command line help, so it is translateable
Index: AudacityApp.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AudacityApp.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- AudacityApp.h 7 Aug 2007 20:16:27 -0000 1.38
+++ AudacityApp.h 16 Sep 2007 15:16:32 -0000 1.39
@@ -146,6 +146,9 @@
bool InitTempDir();
bool CreateSingleInstanceChecker(wxString dir);
+ /* utility method for printing the command line help message */
+ void PrintCommandLineHelp(void);
+
//LDA - Until we have a better way to save/restore binary data.
// ToDo: ... look into how wxConfig works.
// ToDo: NoiseGate is an array of 1024 floats that is the "persistent
result"
Index: AudacityApp.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AudacityApp.cpp,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -d -r1.179 -r1.180
--- AudacityApp.cpp 16 Sep 2007 13:45:58 -0000 1.179
+++ AudacityApp.cpp 16 Sep 2007 15:16:32 -0000 1.180
@@ -344,6 +344,7 @@
#endif
IMPLEMENT_APP(AudacityApp)
+/* make the application class known to wxWidgets for dynamic construction */
#ifdef __WXMAC__
@@ -795,25 +796,8 @@
continue;
bool handled = false;
-// JKC: In order to have long strings that span multiple lines,
-// and for this to work with i18n, use the magic formula
-// of wrapping continuations with wxT() but not the first
-// part of the string.
-// Why does it work? Because in unicode _(s) and wxT(s) both
-// prepend an L to s. That's why you don't want a wxT on the
-// first string.
-
if (!wxString(wxT("-help")).CmpNoCase(argv[option])) {
- wxPrintf(/* i18n-hint: '-help', '-version', '-test' and
- '-blocksize' need to stay in English. */
- _(
- "Command-line options supported:\n"
- wxT(" -help (this message)\n")
- wxT(" -version (display Audacity version)\n")
- wxT(" -test (run self diagnostics)\n")
- wxT(" -blocksize ### (set max disk block size in
bytes)\n\n")
- wxT("In addition, specify the name of an audio file or
Audacity project\n")
- wxT("to open it.\n\n")));
+ PrintCommandLineHelp(); // print the help message out
exit(0);
}
@@ -890,15 +874,7 @@
wxString fileToOpen;
if (!wxString(wxT("-help")).CmpNoCase(argv[option])) {
- wxPrintf(/* i18n-hint: '-help', '-test' and
- '-blocksize' need to stay in English. */
- _("Command-line options supported:\n"
- " -help (this message)\n"
- " -test (run self diagnostics)\n"
- " -blocksize ### (set max disk block size in bytes)\n"
- "\n"
- "In addition, specify the name of an audio file or "
- "Audacity project\n" "to open it.\n" "\n"));
+ PrintCommandLineHelp(); // print the help message out
exit(0);
}
@@ -1146,6 +1122,28 @@
return true;
}
+void AudacityApp::PrintCommandLineHelp(void)
+{
+ wxPrintf(wxT("%s\n%s\n%s\n%s\n%s\n\n%s\n"),
+ _("Command-line options supported:"),
+ /*i18n-hint: '-help' is the option and needs to stay in
+ * English. This displays a list of available options */
+ _("\t-help (this message)"),
+ /*i18n-hint '-version' needs to stay in English. */
+ _("\t-version (display Audacity version)"),
+ /*i18n-hint '-test' is the option and needs to stay in
+ * English. This runs a set of automatic tests on audacity
+ * itself */
+ _("\t-test (run self diagnostics)"),
+ /*i18n-hint '-blocksize' is the option and needs to stay in
+ * English. 'nnn' is any integer number. This controls the
+ * size pieces that audacity uses when writing files to the
+ * disk */
+ _("\t-blocksize nnn (set max disk block size in bytes)"),
+ _("In addition, specify the name of an audio file or
Audacity project to open it."));
+
+}
+
// static
void AudacityApp::AddUniquePathToPathList(wxString path,
wxArrayString &pathList)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs