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

List:       kde-commits
Subject:    KDE_3_1_BRANCH: kdebase/kdialog
From:       David Faure <faure () kde ! org>
Date:       2003-08-19 11:19:41
[Download RAW message or body]

CVS commit by faure: 

Backport rev 1.14 (--warningcontinuecancel), as Binner reminded me.


  M +12 -1     kdialog.cpp   1.4.2.4


--- kdebase/kdialog/kdialog.cpp  #1.4.2.3:1.4.2.4
@@ -110,4 +110,8 @@ int directCommand(KCmdLineArgs *args)
         type = KMessageBox::WarningYesNo;
     }
+    else if (args->isSet("warningcontinuecancel")) {
+        option = "warningcontinuecancel";
+        type = KMessageBox::WarningContinueCancel;
+    }
     else if (args->isSet("warningyesnocancel")) {
         option = "warningyesnocancel";
@@ -129,4 +133,6 @@ int directCommand(KCmdLineArgs *args)
     if ( !option.isEmpty() )
     {
+        int ret;
+
         QString text = QString::fromLocal8Bit(args->getOption( option ));
         int pos;
@@ -136,5 +142,10 @@ int directCommand(KCmdLineArgs *args)
         }
 
-        int ret = KMessageBox::messageBox( 0, type, text, title /*, TODO configurable button texts*/ );
+        if ( type == KMessageBox::WarningContinueCancel ) {
+            /* TODO configurable button texts*/
+            ret = KMessageBox::messageBox( 0, type, text, title, KStdGuiItem::cont() ); 
+        } else {
+            ret = KMessageBox::messageBox( 0, type, text, title /*, TODO configurable button texts*/ );
+        }
         // ret is 1 for Ok, 2 for Cancel, 3 for Yes, 4 for No and 5 for Continue.
         // We want to return 0 for ok, yes and continue, 1 for no and 2 for cancel


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

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