[Kst] branches/work/kst/kst1kde4/kst/src/libkstapp

Zongyi Zhang freebody.kst at gmail.com
Tue Mar 23 23:09:12 CET 2010


SVN commit 1106767 by zhang:

continue kst1kde4

 M  +2 -2      kst.cpp  
 M  +7 -7      kstdatamanager.cpp  
 M  +15 -15    kstdoc.cpp  
 M  +4 -4      kstfilterdialog.cpp  


--- branches/work/kst/kst1kde4/kst/src/libkstapp/kst.cpp #1106766:1106767
@@ -25,6 +25,7 @@
 #include <qpopupmenu.h>
 #include <qprogressbar.h>
 #include <qvalidator.h>
+#include <qmessagebox.h>
 
 // include files for KDE
 #include <kaccel.h>
@@ -32,7 +33,6 @@
 #include "ksdebug.h"
 #include <kfiledialog.h>
 #include <kkeydialog.h>
-#include <kmessagebox.h>
 #include <kpopupmenu.h>
 #include <kprinter.h>
 #include <kprogress.h>
@@ -2619,7 +2619,7 @@
       return QString::null;
     }
     if (prompt) {
-      KMessageBox::sorry(this, i18n("A window with the same name already exists.  Enter a unique window name."));
+      QMessageBox::warning(this, i18n("Kst"), i18n("A window with the same name already exists.  Enter a unique window name."));
     }
   } while(true);
 
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kstdatamanager.cpp #1106766:1106767
@@ -1162,7 +1162,7 @@
     qi = DataView->selectedItems().at(0);
   } else {
     // This error message is odd to say the least.
-    //KMessageBox::sorry(this, i18n("A data item must be selected to edit."));
+    //QMessageBox::warning(this, i18n("Kst"), i18n("A data item must be selected to edit."));
     return;
   }
 
@@ -1265,7 +1265,7 @@
           KST::vectorList.lock().unlock();
           doUpdates();
         } else {
-          KMessageBox::sorry(this, i18n("Unknown error deleting static vector."));
+          QMessageBox::warning(this, i18n("Kst"), i18n("Unknown error deleting static vector."));
         }
       } else if (qi->rtti() == RTTI_OBJ_A_VECTOR) {
         KstAVectorPtr x = kst_cast<KstAVector>(*KST::vectorList.findTag(koi->tag().tagString()));
@@ -1277,7 +1277,7 @@
           KST::vectorList.lock().unlock();
           doUpdates();
         } else {
-          KMessageBox::sorry(this, i18n("Unknown error deleting static vector."));
+          QMessageBox::warning(this, i18n("Kst"), i18n("Unknown error deleting static vector."));
         }
       } else if (qi->rtti() == RTTI_OBJ_DATA_MATRIX) {
         KstRMatrixPtr x = kst_cast<KstRMatrix>(*KST::matrixList.findTag(koi->tag().tagString()));
@@ -1289,7 +1289,7 @@
           KST::matrixList.lock().unlock();
           doUpdates();
         } else {
-          KMessageBox::sorry(this, i18n("Unknown error deleting data matrix."));
+          QMessageBox::warning(this, i18n("Kst"), i18n("Unknown error deleting data matrix."));
         }
       } else if (qi->rtti() == RTTI_OBJ_STATIC_MATRIX) {
         KstSMatrixPtr x = kst_cast<KstSMatrix>(*KST::matrixList.findTag(koi->tag().tagString()));
@@ -1301,7 +1301,7 @@
           KST::matrixList.lock().unlock();
           doUpdates();
         } else {
-          KMessageBox::sorry(this, i18n("Unknown error deleting static matrix."));
+          QMessageBox::warning(this, i18n("Kst"),i18n("Unknown error deleting static matrix."));
         }
       } else if (qi->rtti() == RTTI_OBJ_A_MATRIX) {
         KstAMatrixPtr x = kst_cast<KstAMatrix>(*KST::matrixList.findTag(koi->tag().tagString()));
@@ -1313,13 +1313,13 @@
           KST::matrixList.lock().unlock();
           doUpdates();
         } else {
-          KMessageBox::sorry(this, i18n("Unknown error deleting static matrix."));
+          QMessageBox::warning(this, i18n("Kst"), i18n("Unknown error deleting static matrix."));
         }
       }
       KstApp::inst()->paintAll(KstPainter::P_PLOT);
       update();
     } else {
-      KMessageBox::sorry(this, i18n("Cannot delete objects with dependencies."));
+      QMessageBox::warning(this, i18n("Kst"),i18n("Cannot delete objects with dependencies."));
     }
   }
 }
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kstdoc.cpp #1106766:1106767
@@ -31,6 +31,7 @@
 #include <qdeepcopy.h>
 #include <qeventloop.h>
 #include <qstylesheet.h>
+#include <qmessagebox.h>
 
 // include files for KDE
 #include <dcopclient.h>
@@ -38,7 +39,6 @@
 #include <kdeversion.h>
 #include <kfiledialog.h>
 #include <kio/netaccess.h>
-#include <kmessagebox.h>
 #include <kmdimainfrm.h>
 #include <kprogress.h>
 #include <ksavefile.h>
@@ -123,9 +123,9 @@
   if (_modified) {
     KstApp *win = KstApp::inst();
     if (win->activeWindow()) {
-      int want_save = KMessageBox::warningYesNoCancel( win, i18n("The current plot definition has been modified. Do you want to save it?"), i18n("Question"));
+      int want_save = QMessageBox::warning( win, i18n("Question"), i18n("The current plot definition has been modified. Do you want to save it?"));
       switch (want_save) {
-        case KMessageBox::Yes:
+        case QMessageBox::Yes:
           if (_title == "Untitled") {
             if (!win->slotFileSaveAs()) {
               return false;
@@ -140,7 +140,7 @@
           completed = true;
           break;
 
-        case KMessageBox::No:
+        case QMessageBox::No:
           if (doDelete) {
             setModified(false);
             deleteContents();
@@ -148,7 +148,7 @@
           completed = true;
           break;
 
-        case KMessageBox::Cancel:
+        case QMessageBox::Cancel:
           completed = false;
           break;
 
@@ -168,7 +168,7 @@
 
 bool KstDoc::newDocument() {
   // FIXME: implement this properly
-  //if (KMessageBox::Yes == KMessageBox::warningYesNo(KstApp::inst(), i18n("Are you sure you wish to erase all your data and plots?"))) {
+  //if (QMessageBox::Yes == QMessageBox::warningYesNo(KstApp::inst(), i18n("Are you sure you wish to erase all your data and plots?"))) {
     deleteContents();
     _modified = false;
     _absFilePath = QDir::homeDirPath();
@@ -195,13 +195,13 @@
     tmpFile = url.path();
   } else {
     if (!KIO::NetAccess::exists(url, true, KstApp::inst())) {
-      KMessageBox::sorry(KstApp::inst(), i18n("%1: There is no file with that name to open.").arg(url.prettyURL()));
+      QMessageBox::warning(KstApp::inst(), i18n("kst"), i18n("%1: There is no file with that name to open.").arg(url.prettyURL()));
 
       return false;
     }
 
     if (!KIO::NetAccess::download(url, tmpFile, KstApp::inst())) {
-      KMessageBox::sorry(KstApp::inst(), i18n("%1: There is no file with that name to open.").arg(url.prettyURL()));
+      QMessageBox::warning(KstApp::inst(), i18n("kst"), i18n("%1: There is no file with that name to open.").arg(url.prettyURL()));
 
       return false;
     }
@@ -218,7 +218,7 @@
   QFile f(tmpFile);
 
   if (!f.exists()) {
-    KMessageBox::sorry(KstApp::inst(), i18n("%1: There is no file with that name to open.").arg(url.prettyURL()));
+    QMessageBox::warning(KstApp::inst(), i18n("kst"), i18n("%1: There is no file with that name to open.").arg(url.prettyURL()));
     opening = false;
     _updating = false;
     KstApp::inst()->setPaused(false);
@@ -237,7 +237,7 @@
   QDomDocument doc(_title);
 
   if (!f.open(IO_ReadOnly)) {
-    KMessageBox::sorry(KstApp::inst(), i18n("%1: File exists, but kst could not open it.").arg(url.prettyURL()));
+    QMessageBox::warning(KstApp::inst(), i18n("kst"), i18n("%1: File exists, but kst could not open it.").arg(url.prettyURL()));
     opening = false;
     _updating = false;
     KstApp::inst()->setPaused(false);
@@ -250,7 +250,7 @@
   }
 
   if (!doc.setContent(&f)) {
-    KMessageBox::sorry(KstApp::inst(), i18n("%1: Not a valid kst plot specification file.").arg(url.prettyURL()));
+    QMessageBox::warning(KstApp::inst(), i18n("kst"), i18n("%1: Not a valid kst plot specification file.").arg(url.prettyURL()));
     f.close();
     opening = false;
     _updating = false;
@@ -278,7 +278,7 @@
   if (docElem.tagName() != "kstdoc") {
     QString err = i18n("Error opening file %1.  Does not appear to be a Kst file.").arg(url.prettyURL());
     KstDebug::self()->log(err, KstDebug::Error);
-    KMessageBox::sorry(KstApp::inst(), err);
+    QMessageBox::warning(KstApp::inst(), i18n("kst"), err);
     opening = false;
     _updating = false;
     KstApp::inst()->setPaused(false);
@@ -511,7 +511,7 @@
 
   if (warnOldKstFile) {
     QApplication::restoreOverrideCursor();
-    KMessageBox::sorry(KstApp::inst(), i18n("You tried to load an old Kst file.  Curves created by equations or spectra will not be loaded."));
+    QMessageBox::warning(KstApp::inst(), i18n("kst"), i18n("You tried to load an old Kst file.  Curves created by equations or spectra will not be loaded."));
     QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
   }
 
@@ -827,8 +827,8 @@
 
   if (KIO::NetAccess::exists(url, false, KstApp::inst())) {
     if (prompt) {
-      int rc = KMessageBox::warningYesNo(KstApp::inst(), i18n("File %1 exists.  Overwrite?").arg(url.prettyURL()), i18n("Kst"));
-      if (rc == KMessageBox::No) {
+      int rc = QMessageBox::warning(KstApp::inst(), i18n("Kst"), i18n("File %1 exists.  Overwrite?").arg(url.prettyURL()));
+      if (rc == QMessageBox::No) {
         return false;
       }
     }
--- branches/work/kst/kst1kde4/kst/src/libkstapp/kstfilterdialog.cpp #1106766:1106767
@@ -261,7 +261,7 @@
           if (saveOutputs(plugin, pPtr)) {
             if (plugin->isValid()) {
               if (!createCurve(plugin)) {
-                KMessageBox::sorry(this, i18n("There is an error in the plugin you entered."));
+                QMessageBox::warning(this, i18n("Kst"), i18n("There is an error in the plugin you entered."));
                 return false;
               } else {
                 KST::dataObjectList.lock().writeLock();
@@ -269,15 +269,15 @@
                 KST::dataObjectList.lock().unlock();
               }
             } else {
-              KMessageBox::sorry(this, i18n("There is an error in the plugin you entered."));
+              QMessageBox::warning(this, i18n("Kst"), i18n("There is an error in the plugin you entered."));
               return false;
             }
           } else {
-            KMessageBox::sorry(this, i18n("There is an error in the outputs you entered."));
+            QMessageBox::warning(this, i18n("Kst"), i18n("There is an error in the outputs you entered."));
             return false;
           }
         } else {
-          KMessageBox::sorry(this, i18n("There is an error in the inputs you entered."));
+          QMessageBox::warning(this, i18n("Kst"), i18n("There is an error in the inputs you entered."));
           return false;
         }
       }


More information about the Kst mailing list