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

List:       kde-core-devel
Subject:    [PATCH] kmessagebox, kdialogbase & setPlainCaption
From:       Oswald Buddenhagen <ossi () kde ! org>
Date:       2004-08-16 17:45:04
Message-ID: 20040816174504.GA14986 () ugly ! local
[Download RAW message or body]

hoi,

just noticed, that i can't use a plain caption directly with a message
box. so i came up with adding a value to the Options enum -
PlainCaption.
unfortunately one can't prevent kdialogbase from initially setting a
caption - not sure what to do about this. just ignore it?

commit?

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.

["kmessagebox.diff" (text/plain)]

Index: kmessagebox.h
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kmessagebox.h,v
retrieving revision 1.58
diff -U2 -r1.58 kmessagebox.h
--- kmessagebox.h	25 Jun 2004 09:34:40 -0000	1.58
+++ kmessagebox.h	16 Aug 2004 17:43:24 -0000
@@ -74,4 +74,5 @@
   * @li AllowLink The message may contain links.
   * @li Dangerous The action to be confirmed by the dialog is a potentially destructive one
+  * @li PlainCaption Do not use KApplication::makeStdCaption()
   */
  enum OptionsType
@@ -79,5 +80,6 @@
    Notify = 1,
    AllowLink = 2,
-   Dangerous = 4
+   Dangerous = 4,
+   PlainCaption = 8
  };
 
Index: kmessagebox.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kmessagebox.cpp,v
retrieving revision 1.95
diff -U2 -r1.95 kmessagebox.cpp
--- kmessagebox.cpp	11 Aug 2004 19:58:49 -0000	1.95
+++ kmessagebox.cpp	16 Aug 2004 17:43:25 -0000
@@ -426,4 +426,6 @@
                        parent, "questionYesNo", true, true,
                        buttonYes, buttonNo);
+    if( options & PlainCaption )
+        dialog->setPlainCaption( caption );
     if( parent == NULL && parent_id != 0 )
         XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id );
@@ -473,4 +475,6 @@
                        parent, "questionYesNoCancel", true, true,
                        buttonYes, buttonNo);
+    if( options & PlainCaption )
+        dialog->setPlainCaption( caption );
     if( parent == NULL && parent_id != 0 )
         XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id );
@@ -551,4 +555,6 @@
                        parent, "warningYesNoList", true, true,
                        buttonYes, buttonNo);
+    if( options & PlainCaption )
+        dialog->setPlainCaption( caption );
     if( parent == NULL && parent_id != 0 )
         XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id );
@@ -619,4 +625,6 @@
                        parent, "warningYesNo", true, true,
                        buttonContinue, KStdGuiItem::cancel() );
+    if( options & PlainCaption )
+        dialog->setPlainCaption( caption );
     if( parent == NULL && parent_id != 0 )
         XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id );
@@ -691,4 +699,6 @@
                        parent, "warningYesNoCancel", true, true,
                        buttonYes, buttonNo);
+    if( options & PlainCaption )
+        dialog->setPlainCaption( caption );
     if( parent == NULL && parent_id != 0 )
         XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id );
@@ -724,4 +734,6 @@
                        parent, "error", true, true,
                        KStdGuiItem::ok() );
+    if( options & PlainCaption )
+        dialog->setPlainCaption( caption );
     if( parent == NULL && parent_id != 0 )
         XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id );
@@ -750,4 +762,6 @@
                        parent, "error", true, true,
                        KStdGuiItem::ok() );
+    if( options & PlainCaption )
+        dialog->setPlainCaption( caption );
     if( parent == NULL && parent_id != 0 )
         XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id );
@@ -793,4 +807,6 @@
                        parent, "sorry", true, true,
                        KStdGuiItem::ok() );
+    if( options & PlainCaption )
+        dialog->setPlainCaption( caption );
     if( parent == NULL && parent_id != 0 )
         XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id );
@@ -819,4 +835,6 @@
                        parent, "sorry", true, true,
                        KStdGuiItem::ok() );
+    if( options & PlainCaption )
+        dialog->setPlainCaption( caption );
     if( parent == NULL && parent_id != 0 )
         XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id );
@@ -861,4 +879,6 @@
                        parent, "information", true, true,
                        KStdGuiItem::ok() );
+    if( options & PlainCaption )
+        dialog->setPlainCaption( caption );
     if( parent == NULL && parent_id != 0 )
         XSetTransientForHint( qt_xdisplay(), dialog->winId(), parent_id );


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

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