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

Modified Files:
        wxMDialogs.cpp 
Log Message:
pers msg boxes UI enhancements: don't predisable manually reenabled msg boxes; have 
all options in one dialog, not two (bug 775)

Index: wxMDialogs.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMDialogs.cpp,v
retrieving revision 1.403
retrieving revision 1.404
diff -b -u -2 -r1.403 -r1.404
--- wxMDialogs.cpp      27 Sep 2003 23:28:08 -0000      1.403
+++ wxMDialogs.cpp      28 Sep 2003 15:11:19 -0000      1.404
@@ -674,9 +674,11 @@
 
    long style = GetMsgBoxStyle(wxOK | wxICON_INFORMATION);
-   if ( flags & M_DLG_DISABLE )
-      style |= wxPMSGBOX_DISABLE;
    if ( flags & M_DLG_ALLOW_CANCEL )
       style |= wxCANCEL;
 
+   wxPMessageBoxParams params;
+   if ( flags & M_DLG_DISABLE )
+      params.indexDisable = 0;
+
    return wxPMessageBox
           (
@@ -685,5 +687,7 @@
             String(M_TITLE_PREFIX) + title,
             style,
-            GetDialogParent(parent)
+            GetDialogParent(parent),
+            NULL,
+            &params
           ) != wxCANCEL;
 }
@@ -767,5 +771,4 @@
    if ( msgBox )
    {
-      pathLocal =
       pathGlobal = GetPersMsgBoxName(msgBox);
 
@@ -777,6 +780,5 @@
       if ( !storedValue && folderName )
       {
-         pathLocal << '/'
-                   << Profile::FilterProfileName(folderName)
+         pathLocal << Profile::FilterProfileName(folderName)
                    << '/'
                    << pathGlobal;
@@ -796,5 +798,18 @@
    CloseSplash();
 
-   bool wasDisabled;
+   wxPMessageBoxParams params;
+   params.dontDisableOnNo = (flags & M_DLG_NOT_ON_NO) != 0;
+
+   if ( folderName )
+   {
+      params.disableOptions.Add(_("just for this &folder"));
+      params.disableOptions.Add(_("for &all folders"));
+   }
+
+   if ( flags & M_DLG_DISABLE )
+   {
+      params.indexDisable = 0;
+   }
+
    int rc = wxPMessageBox
             (
@@ -802,37 +817,15 @@
                message,
                String(M_TITLE_PREFIX) + title,
-               GetYesNoMsgBoxStyle(flags) |
-                  // these bits are equal to the corresponding wx constants
-                  (flags & (M_DLG_NOT_ON_NO | M_DLG_DISABLE)),
+               GetYesNoMsgBoxStyle(flags),
                GetDialogParent(parent),
                NULL,
-               &wasDisabled
+               &params
             );
 
-   if ( wasDisabled )
+   if ( params.indexDisable != -1 )
    {
       // a folder-specific message box can be disabled just for this folder or
       // for all of them globally
-      if ( folderName )
-      {
-         // no recursion here as we call ourselves without pathGlobal (nor
-         // folderName)
-         String msg = String::Format
-                      (
-                        _("You have chosen to disable the previous dialog and "
-                          "now you have the choice between doing it\n"
-                          "only for this folder (%s) or for all folders.\n"
-                          "\n"
-                          "If you answer \"Yes\", it will be disabled for all "
-                          "folders, otherwise only for this one. In either case\n"
-                          "you may use the \"Reenable message boxes\" button in "
-                          "the last page of the preferences dialog to restore\n"
-                          "this message box later.\n"
-                          "\n"
-                          "Disable this question for all folders?"),
-                        folderName
-                      );
-
-         if ( MDialog_YesNoDialog(msg, parent) )
+      if ( folderName && params.indexDisable == 1 )
          {
             // we don't need the local key
@@ -842,8 +835,6 @@
             wxPMessageBoxDisable(pathGlobal, rc);
          }
-         //else: it's already disabled for this folder
-      }
-      else
-      {
+      //else: it's already disabled for this folder by wxPMessageBox()
+
          // show a message about how to enable this dialog back
          MDialog_Message
@@ -857,5 +848,4 @@
             M_DLG_DISABLE
          );
-      }
    }
 



-------------------------------------------------------
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