[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [PATCH] Add dontAskAgainName parameter to queuedMessageBox()
From:       Ingo =?iso-8859-15?q?Kl=F6cker?= <kloecker () kde ! org>
Date:       2002-10-06 15:41:37
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Hi,

is it possible to add the dontAskAgain parameter to 
KMessageBox::queuedMessageBox(...) (and KMessageBox::messageBox(...)) 
as in the attached patch?

I wouldn't ask for such at thing now if it wouldn't be necessary in 
order to fix a crash (Bug 48688) in KMail. Currently we use a normal 
message box (with "Don't show again" check box). But this message box 
blocks the initialization of some objects in KMail which are then 
accessed by other code that is executed due to the running event loop. 
This problem could easily be solved by using a queued message box. But 
we really need a "Don't show again" checkbox because the message box 
might be shown very often for users of NFS mounted home directories. If 
possible the options parameter should also be added to make it possible 
to show links in the message with KMessageBox::AllowLink.

Regards,
Ingo


["kmessagebox.diff" (text/x-diff)]

? kmessagebox.diff
Index: kmessagebox.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kmessagebox.cpp,v
retrieving revision 1.61
diff -u -3 -p -r1.61 kmessagebox.cpp
--- kmessagebox.cpp	2002/08/26 20:33:03	1.61
+++ kmessagebox.cpp	2002/10/06 13:45:42
@@ -754,27 +754,27 @@ KMessageBox::about(QWidget *parent, cons
     return;
 }
 
-int KMessageBox::messageBox( QWidget *parent, DialogType type, const QString &text, \
const QString &caption, const KGuiItem &buttonYes, const KGuiItem &buttonNo, int \
options ) +int KMessageBox::messageBox( QWidget *parent, DialogType type, const \
QString &text, const QString &caption, const KGuiItem &buttonYes, const KGuiItem \
&buttonNo, int options, const QString &dontAskAgainName = QString::null )  {
     switch (type) {
         case QuestionYesNo:
             return KMessageBox::questionYesNo( parent,
-                                               text, caption, buttonYes, buttonNo, \
QString::null, options ); +                                               text, \
caption, buttonYes, buttonNo, dontAskAgainName, options );  case QuestionYesNoCancel:
             return KMessageBox::questionYesNoCancel( parent,
-                                               text, caption, buttonYes, buttonNo, \
QString::null, options ); +                                               text, \
caption, buttonYes, buttonNo, dontAskAgainName, options );  case WarningYesNo:
             return KMessageBox::warningYesNo( parent,
-                                              text, caption, buttonYes, buttonNo, \
QString::null, options ); +                                              text, \
caption, buttonYes, buttonNo, dontAskAgainName, options );  case \
WarningContinueCancel:  return KMessageBox::warningContinueCancel( parent,
-                                              text, caption, buttonYes.text(), \
QString::null, options ); +                                              text, \
caption, buttonYes.text(), dontAskAgainName, options );  case WarningYesNoCancel:
             return KMessageBox::warningYesNoCancel( parent,
-                                              text, caption, buttonYes, buttonNo, \
QString::null, options ); +                                              text, \
caption, buttonYes, buttonNo, dontAskAgainName, options );  case Information:
             KMessageBox::information( parent,
-                                      text, caption, QString::null, options );
+                                      text, caption, dontAskAgainName, options );
             return KMessageBox::Ok;
 
         case Error:
@@ -788,9 +788,10 @@ int KMessageBox::messageBox( QWidget *pa
     return KMessageBox::Cancel;
 }
 
-void KMessageBox::queuedMessageBox( QWidget *parent, DialogType type, const QString \
&text, const QString &caption ) +void KMessageBox::queuedMessageBox( QWidget *parent, \
DialogType type, const QString &text, const QString &caption, const QString \
&dontAskAgainName )  {
    KMessageBox_queue = true;
-   (void) messageBox(parent, type, text, caption);
+   (void) messageBox(parent, type, text, caption, KStdGuiItem::yes(),
+                     KStdGuiItem::no(), Notify, dontAskAgainName);
    KMessageBox_queue = false;
 }
Index: kmessagebox.h
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kmessagebox.h,v
retrieving revision 1.40
diff -u -3 -p -r1.40 kmessagebox.h
--- kmessagebox.h	2002/09/28 15:16:22	1.40
+++ kmessagebox.h	2002/10/06 13:45:42
@@ -594,7 +594,8 @@ public:
                     const QString &caption = QString::null,
                     const KGuiItem &buttonYes = KStdGuiItem::yes(),
                     const KGuiItem &buttonNo = KStdGuiItem::no(),
-                    int options = Notify);
+                    int options = Notify,
+                    const QString &dontAskAgainName = QString::null );
 
     /*
      * Like @ref messageBox
@@ -610,7 +611,8 @@ public:
      */
     static void queuedMessageBox( QWidget *parent,
                     DialogType type, const QString &text,
-                    const QString &caption = QString::null );
+                    const QString &caption = QString::null,
+                    const QString &dontAskAgainName = QString::null );
 
 };
 


[Attachment #6 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic