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

Modified Files:
        wxMDialogs.cpp 
Log Message:
upgrade the persistent msg box data when upgrading from 0.65 too; removed backwards 
compatiblity code from MDialog_YesNoDialog() itself

Index: wxMDialogs.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMDialogs.cpp,v
retrieving revision 1.397
retrieving revision 1.398
diff -b -u -2 -r1.397 -r1.398
--- wxMDialogs.cpp      31 Aug 2003 13:04:04 -0000      1.397
+++ wxMDialogs.cpp      31 Aug 2003 20:41:17 -0000      1.398
@@ -764,50 +764,22 @@
                     const char *folderName)
 {
-   String configPath, path;
-   if ( msgBox )
-   {
-      configPath = GetPersMsgBoxName(msgBox);
+   String pathGlobal,
+          pathLocal;
 
-      // if this is a folder-specific message box, first look if it's not
-      // disabled globally
-      int storedValue;
-      if ( folderName )
-      {
-         storedValue = wxPMessageBoxIsDisabled(configPath);
-         if ( !storedValue )
+   if ( msgBox )
          {
-            // use this path instead, there is nothing at the global level
-            path << Profile::FilterProfileName(folderName) << '/' << configPath;
-
-            // an added complication: in the older versions of the program
-            // FilterProfileName() prefixed the folder path with
-            // M_PROFILE_CONFIG_SECTION - which it doesn't do any more, but we
-            // should still honour the old settings
-
-            String pathOld = Profile::GetProfilePath().c_str();
+      pathLocal =
+      pathGlobal = GetPersMsgBoxName(msgBox);
 
-            // skip the leading slash
-            pathOld.erase(0, 1);
+      // first check the global value
+      int storedValue = wxPMessageBoxIsDisabled(pathGlobal);
 
-            pathOld.Replace("/", "_");
-            pathOld << "_" << path;
-
-            storedValue = wxPMessageBoxIsDisabled(pathOld);
-         }
-         //else: we won't show it at all
-      }
-      else
+      // if this is a folder-specific message box, then look if it's not
+      // disabled just for this folder
+      if ( !storedValue && folderName )
       {
-         storedValue = 0;
-         path = configPath;
+         pathLocal << Profile::FilterProfileName(folderName) << '/' << pathGlobal;
 
-         ASSERT_MSG( !strchr(configPath, '/'), _T("configPath must be simple!") );
-      }
-
-      if ( !storedValue )
-      {
-         // try again (if we had tried without folderName above) or for the
-         // first time
-         storedValue = wxPMessageBoxIsDisabled(path);
+         storedValue = wxPMessageBoxIsDisabled(pathLocal);
       }
 
@@ -826,5 +798,5 @@
    int rc = wxPMessageBox
             (
-               path,
+               pathLocal,
                message,
                String(M_TITLE_PREFIX) + title,
@@ -843,5 +815,5 @@
       if ( folderName )
       {
-         // no recursion here as we call ourselves without configPath (nor
+         // no recursion here as we call ourselves without pathGlobal (nor
          // folderName)
          String msg = String::Format
@@ -864,8 +836,8 @@
          {
             // we don't need the local key
-            wxPMessageBoxEnable(path);
+            wxPMessageBoxEnable(pathLocal);
 
             // as we disable it globally anyhow
-            wxPMessageBoxDisable(configPath, rc);
+            wxPMessageBoxDisable(pathGlobal, rc);
          }
          //else: it's already disabled for this folder



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to