Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv7299/src/gui

Modified Files:
        wxMApp.cpp 
Log Message:
added --userdir cmd line option

Index: wxMApp.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMApp.cpp,v
retrieving revision 1.284
retrieving revision 1.285
diff -b -u -2 -r1.284 -r1.285
--- wxMApp.cpp  12 Jan 2004 17:48:29 -0000      1.284
+++ wxMApp.cpp  16 Jan 2004 23:37:34 -0000      1.285
@@ -2168,7 +2168,9 @@
 // ----------------------------------------------------------------------------
 
+// the names of cmd line options
 #define OPTION_BCC         _T("bcc")
 #define OPTION_BODY        _T("body")
 #define OPTION_CC          _T("cc")
+#define OPTION_USERDIR     _T("userdir")
 #define OPTION_CONFIG      _T("config")
 #define OPTION_DEBUGMAIL   _T("debug")
@@ -2210,4 +2212,12 @@
       },
 
+      // --userdir=dir to specify an alternative home directory to use
+      {
+         wxCMD_LINE_OPTION,
+         NULL,
+         OPTION_USERDIR,
+         gettext_noop("specify a non default directory for user files"),
+      },
+
       // --config=file to specify an alternative config file to use
       {
@@ -2334,5 +2344,23 @@
    }
 
-   parser.Found(OPTION_CONFIG, &m_cmdLineOptions->configFile);
+   // check for non default local dir and config file
+   //
+   // consider that config file is supposed to be in the user dir under Unix.
+   // under Windows we don't use config file at all unless it was specified
+#ifndef OS_WIN
+   const bool hasDir =
+#endif // OS_WIN
+   parser.Found(OPTION_USERDIR, &m_cmdLineOptions->userDir);
+   if ( !parser.Found(OPTION_CONFIG, &m_cmdLineOptions->configFile) )
+   {
+#ifndef OS_WIN
+      if ( hasDir )
+      {
+         m_cmdLineOptions->configFile = m_cmdLineOptions->userDir +
+                                          wxFILE_SEP_PATH + _T("config");
+      }
+#endif // !OS_WIN
+   }
+
    m_cmdLineOptions->useFolder = parser.Found(OPTION_FOLDER,
                                               &m_cmdLineOptions->folder);
@@ -2540,5 +2568,5 @@
 
 // the version of the CmdLineOptions::ToString() format
-#define CMD_LINE_OPTS_VERSION 1.1
+#define CMD_LINE_OPTS_VERSION 1.2
 
 // the string versions of TRUE and FALSE
@@ -2550,4 +2578,5 @@
 {
    CmdLineOptions_Version,
+   CmdLineOptions_UserDir,
    CmdLineOptions_Config,
    CmdLineOptions_Bcc,
@@ -2566,4 +2595,5 @@
    String s;
    s << s.Format(_T("%f"), CMD_LINE_OPTS_VERSION) << CMD_LINE_OPTS_SEP
+     << userDir << CMD_LINE_OPTS_SEP
      << configFile << CMD_LINE_OPTS_SEP
      << composer.bcc << CMD_LINE_OPTS_SEP
@@ -2589,4 +2619,5 @@
       return false;
 
+   userDir = tokens[CmdLineOptions_UserDir];
    configFile = tokens[CmdLineOptions_Config];
    composer.bcc = tokens[CmdLineOptions_Bcc];



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to