Continued replacing QMessageBox.

Thu, 02 Sep 2010 16:36:23 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 02 Sep 2010 16:36:23 +0200
changeset 546
c3e7bf5648be
parent 545
1538031b5175
child 547
cceececd1312

Continued replacing QMessageBox.

Cooperation/ChatWidget.py file | annotate | diff | comparison | revisions
Graphics/UMLGraphicsView.py file | annotate | diff | comparison | revisions
IconEditor/IconEditorWindow.py file | annotate | diff | comparison | revisions
MultiProject/MultiProject.py file | annotate | diff | comparison | revisions
Plugins/PluginAbout.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgDiffDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/hg.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsPySvn/SvnDiffDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsSubversion/SvnDiffDialog.py file | annotate | diff | comparison | revisions
Plugins/WizardPlugins/PyRegExpWizard/PyRegExpWizardDialog.py file | annotate | diff | comparison | revisions
Plugins/WizardPlugins/QRegExpWizard/QRegExpWizardDialog.py file | annotate | diff | comparison | revisions
Project/Project.py file | annotate | diff | comparison | revisions
QScintilla/Editor.py file | annotate | diff | comparison | revisions
QScintilla/Exporters/ExporterBase.py file | annotate | diff | comparison | revisions
UI/DiffDialog.py file | annotate | diff | comparison | revisions
diff -r 1538031b5175 -r c3e7bf5648be Cooperation/ChatWidget.py
--- a/Cooperation/ChatWidget.py	Thu Sep 02 08:58:41 2010 +0200
+++ b/Cooperation/ChatWidget.py	Thu Sep 02 16:36:23 2010 +0200
@@ -8,8 +8,7 @@
 """
 
 from PyQt4.QtCore import Qt, pyqtSlot, pyqtSignal, QDateTime, QPoint, QFileInfo
-from PyQt4.QtGui import QWidget, QColor, QListWidgetItem, QMenu, QFileDialog, \
-    QMessageBox, QApplication
+from PyQt4.QtGui import QWidget, QColor, QListWidgetItem, QMenu, QFileDialog, QApplication
 
 from E5Gui.E5Application import e5App
 from E5Gui import E5MessageBox
@@ -544,15 +543,12 @@
                     if ex:
                         fname += ex
                 if QFileInfo(fname).exists():
-                    res = E5MessageBox.warning(self,
+                    res = E5MessageBox.yesNo(self,
                         self.trUtf8("Save Chat"),
-                        self.trUtf8("<p>The file <b>{0}</b> already exists.</p>")
-                            .format(fname),
-                        QMessageBox.StandardButtons(\
-                            QMessageBox.Abort | \
-                            QMessageBox.Save),
-                        QMessageBox.Abort)
-                    if res != QMessageBox.Save:
+                        self.trUtf8("<p>The file <b>{0}</b> already exists."
+                                    " Overwrite it?</p>").format(fname),
+                        type_ = E5MessageBox.Warning)
+                    if not res:
                         return
                     fname = Utilities.toNativeSeparators(fname)
                 
@@ -672,4 +668,4 @@
             QDateTime.currentDateTime().toString(Qt.SystemLocaleLongDate) + ":")
         self.chatEdit.append(self.trUtf8("* {0} has been banned and kicked.\n").format(
             itm.text().split(":")[0]))
-        self.chatEdit.setTextColor(color)
\ No newline at end of file
+        self.chatEdit.setTextColor(color)
diff -r 1538031b5175 -r c3e7bf5648be Graphics/UMLGraphicsView.py
--- a/Graphics/UMLGraphicsView.py	Thu Sep 02 08:58:41 2010 +0200
+++ b/Graphics/UMLGraphicsView.py	Thu Sep 02 16:36:23 2010 +0200
@@ -337,15 +337,12 @@
                 if ex:
                     fname += ex
             if QFileInfo(fname).exists():
-                res = E5MessageBox.warning(self,
+                res = E5MessageBox.yesNo(self,
                     self.trUtf8("Save Diagram"),
-                    self.trUtf8("<p>The file <b>{0}</b> already exists.</p>")
-                        .format(fname),
-                    QMessageBox.StandardButtons(\
-                        QMessageBox.Abort | \
-                        QMessageBox.Save),
-                    QMessageBox.Abort)
-                if res == QMessageBox.Abort or res == QMessageBox.Cancel:
+                    self.trUtf8("<p>The file <b>{0}</b> already exists."
+                                " Overwrite it?</p>").format(fname),
+                    type_ = E5MessageBox.Warning)
+                if not res:
                     return
             
             success = self.saveImage(fname, QFileInfo(fname).suffix().upper())
@@ -489,4 +486,4 @@
                           (itemrect.y() + itemrect.height() // 2)
             item.moveBy(xOffset, yOffset)
         
-        self.scene().update()
\ No newline at end of file
+        self.scene().update()
diff -r 1538031b5175 -r c3e7bf5648be IconEditor/IconEditorWindow.py
--- a/IconEditor/IconEditorWindow.py	Thu Sep 02 08:58:41 2010 +0200
+++ b/IconEditor/IconEditorWindow.py	Thu Sep 02 16:36:23 2010 +0200
@@ -1001,15 +1001,12 @@
             if ex:
                 fileName += ex
         if QFileInfo(fileName).exists():
-            res = E5MessageBox.warning(self,
+            res = E5MessageBox.yesNo(self,
                 self.trUtf8("Save icon file"),
-                self.trUtf8("<p>The file <b>{0}</b> already exists.</p>")
-                    .format(fileName),
-                QMessageBox.StandardButtons(\
-                    QMessageBox.Abort | \
-                    QMessageBox.Save),
-                QMessageBox.Abort)
-            if res == QMessageBox.Abort or res == QMessageBox.Cancel:
+                self.trUtf8("<p>The file <b>{0}</b> already exists."
+                            " Overwrite it?</p>").format(fileName),
+                type_ = E5MessageBox.Warning)
+            if not res:
                 return False
         
         return self.__saveIconFile(fileName)
@@ -1223,4 +1220,4 @@
         """
         Private slot called in to enter Whats This mode.
         """
-        QWhatsThis.enterWhatsThisMode()
\ No newline at end of file
+        QWhatsThis.enterWhatsThisMode()
diff -r 1538031b5175 -r c3e7bf5648be MultiProject/MultiProject.py
--- a/MultiProject/MultiProject.py	Thu Sep 02 08:58:41 2010 +0200
+++ b/MultiProject/MultiProject.py	Thu Sep 02 16:36:23 2010 +0200
@@ -600,15 +600,12 @@
                 if ex:
                     fn += ex
             if QFileInfo(fn).exists():
-                res = E5MessageBox.warning(self.parent(),
+                res = E5MessageBox.yesNo(self.parent(),
                     self.trUtf8("Save File"),
-                    self.trUtf8("""<p>The file <b>{0}</b> already exists.</p>""")
-                        .format(fn),
-                    QMessageBox.StandardButtons(\
-                        QMessageBox.Abort | \
-                        QMessageBox.Save),
-                    QMessageBox.Abort)
-                if res != QMessageBox.Save:
+                    self.trUtf8("<p>The file <b>{0}</b> already exists."
+                                " Overwrite it?</p>").format(fileName),
+                    type_ = E5MessageBox.Warning)
+                if not res:
                     return False
                 
             self.name = QFileInfo(fn).baseName()
@@ -987,4 +984,4 @@
         for project in self.projects:
             if not project['master']:
                 files.append(project['file'])
-        return files
\ No newline at end of file
+        return files
diff -r 1538031b5175 -r c3e7bf5648be Plugins/PluginAbout.py
--- a/Plugins/PluginAbout.py	Thu Sep 02 08:58:41 2010 +0200
+++ b/Plugins/PluginAbout.py	Thu Sep 02 16:36:23 2010 +0200
@@ -8,7 +8,6 @@
 """
 
 from PyQt4.QtCore import QObject
-from PyQt4.QtGui import QMessageBox
 
 from UI.Info import *
 import UI.PixmapCache
@@ -125,4 +124,4 @@
         """
         Private slot to handle the About Qt dialog.
         """
-        E5MessageBox.aboutQt(self.__ui, Program)
\ No newline at end of file
+        E5MessageBox.aboutQt(self.__ui, Program)
diff -r 1538031b5175 -r c3e7bf5648be Plugins/VcsPlugins/vcsMercurial/HgDiffDialog.py
--- a/Plugins/VcsPlugins/vcsMercurial/HgDiffDialog.py	Thu Sep 02 08:58:41 2010 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgDiffDialog.py	Thu Sep 02 16:36:23 2010 +0200
@@ -10,7 +10,7 @@
 import os
 
 from PyQt4.QtCore import pyqtSlot, QProcess, QTimer, QFileInfo
-from PyQt4.QtGui import QWidget, QDialogButtonBox, QBrush, QColor, QMessageBox, \
+from PyQt4.QtGui import QWidget, QDialogButtonBox, QBrush, QColor, \
     QTextCursor, QFileDialog, QLineEdit
 
 from E5Gui import E5MessageBox
@@ -277,15 +277,12 @@
             if ex:
                 fname += ex
         if QFileInfo(fname).exists():
-            res = E5MessageBox.warning(self,
+            res = E5MessageBox.yesNo(self,
                 self.trUtf8("Save Diff"),
-                self.trUtf8("<p>The patch file <b>{0}</b> already exists.</p>")
-                    .format(fname),
-                QMessageBox.StandardButtons(\
-                    QMessageBox.Abort | \
-                    QMessageBox.Save),
-                QMessageBox.Abort)
-            if res != QMessageBox.Save:
+                self.trUtf8("<p>The patch file <b>{0}</b> already exists."
+                            " Overwrite it?</p>").format(fname),
+                type_ = E5MessageBox.Warning)
+            if not res:
                 return
         fname = Utilities.toNativeSeparators(fname)
         
@@ -347,4 +344,4 @@
             self.intercept = False
             evt.accept()
             return
-        QWidget.keyPressEvent(self, evt)
\ No newline at end of file
+        QWidget.keyPressEvent(self, evt)
diff -r 1538031b5175 -r c3e7bf5648be Plugins/VcsPlugins/vcsMercurial/hg.py
--- a/Plugins/VcsPlugins/vcsMercurial/hg.py	Thu Sep 02 08:58:41 2010 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/hg.py	Thu Sep 02 16:36:23 2010 +0200
@@ -12,7 +12,7 @@
 import urllib.request, urllib.parse, urllib.error
 
 from PyQt4.QtCore import QProcess, pyqtSignal, QFileInfo
-from PyQt4.QtGui import QMessageBox, QApplication, QDialog, QInputDialog, QFileDialog
+from PyQt4.QtGui import QApplication, QDialog, QInputDialog, QFileDialog
 
 from E5Gui.E5Application import e5App
 from E5Gui import E5MessageBox
@@ -1733,16 +1733,13 @@
                 if ex:
                     fname += ex
             if QFileInfo(fname).exists():
-                res = E5MessageBox.warning(self.__ui,
+                res = E5MessageBox.yesNo(self.__ui,
                     self.trUtf8("Create changegroup"),
                     self.trUtf8("<p>The Mercurial changegroup file <b>{0}</b> "
-                                "already exists.</p>")
+                                "already exists. Overwrite it?</p>")
                         .format(fname),
-                    QMessageBox.StandardButtons(\
-                        QMessageBox.Abort | \
-                        QMessageBox.Save),
-                    QMessageBox.Abort)
-                if res != QMessageBox.Save:
+                    type_ = E5MessageBox.Warning)
+                if not res:
                     return
             fname = Utilities.toNativeSeparators(fname)
             
diff -r 1538031b5175 -r c3e7bf5648be Plugins/VcsPlugins/vcsPySvn/SvnDiffDialog.py
--- a/Plugins/VcsPlugins/vcsPySvn/SvnDiffDialog.py	Thu Sep 02 08:58:41 2010 +0200
+++ b/Plugins/VcsPlugins/vcsPySvn/SvnDiffDialog.py	Thu Sep 02 16:36:23 2010 +0200
@@ -330,15 +330,12 @@
             if ex:
                 fname += ex
         if QFileInfo(fname).exists():
-            res = E5MessageBox.warning(self,
+            res = E5MessageBox.yesNo(self,
                 self.trUtf8("Save Diff"),
-                self.trUtf8("<p>The patch file <b>{0}</b> already exists.</p>")
-                    .format(fname),
-                QMessageBox.StandardButtons(\
-                    QMessageBox.Abort | \
-                    QMessageBox.Save),
-                QMessageBox.Abort)
-            if res != QMessageBox.Save:
+                self.trUtf8("<p>The patch file <b>{0}</b> already exists."
+                            " Overwrite it?</p>").format(fname),
+                type_ = E5MessageBox.Warning)
+            if not res:
                 return
         fname = Utilities.toNativeSeparators(fname)
         
@@ -360,4 +357,4 @@
         """
         self.errorGroup.show()
         self.errors.insertPlainText(msg)
-        self.errors.ensureCursorVisible()
\ No newline at end of file
+        self.errors.ensureCursorVisible()
diff -r 1538031b5175 -r c3e7bf5648be Plugins/VcsPlugins/vcsSubversion/SvnDiffDialog.py
--- a/Plugins/VcsPlugins/vcsSubversion/SvnDiffDialog.py	Thu Sep 02 08:58:41 2010 +0200
+++ b/Plugins/VcsPlugins/vcsSubversion/SvnDiffDialog.py	Thu Sep 02 16:36:23 2010 +0200
@@ -290,15 +290,12 @@
             if ex:
                 fname += ex
         if QFileInfo(fname).exists():
-            res = E5MessageBox.warning(self,
+            res = E5MessageBox.yesNo(self,
                 self.trUtf8("Save Diff"),
-                self.trUtf8("<p>The patch file <b>{0}</b> already exists.</p>")
-                    .format(fname),
-                QMessageBox.StandardButtons(\
-                    QMessageBox.Abort | \
-                    QMessageBox.Save),
-                QMessageBox.Abort)
-            if res != QMessageBox.Save:
+                self.trUtf8("<p>The patch file <b>{0}</b> already exists."
+                            " Overwrite it?</p>").format(fname),
+                type_ = E5MessageBox.Warning)
+            if not res:
                 return
         fname = Utilities.toNativeSeparators(fname)
         
@@ -360,4 +357,4 @@
             self.intercept = False
             evt.accept()
             return
-        QWidget.keyPressEvent(self, evt)
\ No newline at end of file
+        QWidget.keyPressEvent(self, evt)
diff -r 1538031b5175 -r c3e7bf5648be Plugins/WizardPlugins/PyRegExpWizard/PyRegExpWizardDialog.py
--- a/Plugins/WizardPlugins/PyRegExpWizard/PyRegExpWizardDialog.py	Thu Sep 02 08:58:41 2010 +0200
+++ b/Plugins/WizardPlugins/PyRegExpWizard/PyRegExpWizardDialog.py	Thu Sep 02 16:36:23 2010 +0200
@@ -311,15 +311,12 @@
                 if ex:
                     fname += ex
             if QFileInfo(fname).exists():
-                res = E5MessageBox.warning(self,
+                res = E5MessageBox.yesNo(self,
                     self.trUtf8("Save regular expression"),
-                    self.trUtf8("<p>The file <b>{0}</b> already exists.</p>")
-                        .format(fname),
-                    QMessageBox.StandardButtons(\
-                        QMessageBox.Abort | \
-                        QMessageBox.Save),
-                    QMessageBox.Abort)
-                if res == QMessageBox.Abort or res == QMessageBox.Cancel:
+                    self.trUtf8("<p>The file <b>{0}</b> already exists."
+                            " Overwrite it?</p>").format(fname),
+                    type_ = E5MessageBox.Warning)
+                if not res:
                     return
             
             try:
@@ -680,4 +677,4 @@
         self.resize(size)
         
         self.cw.buttonBox.accepted[()].connect(self.close)
-        self.cw.buttonBox.rejected[()].connect(self.close)
\ No newline at end of file
+        self.cw.buttonBox.rejected[()].connect(self.close)
diff -r 1538031b5175 -r c3e7bf5648be Plugins/WizardPlugins/QRegExpWizard/QRegExpWizardDialog.py
--- a/Plugins/WizardPlugins/QRegExpWizard/QRegExpWizardDialog.py	Thu Sep 02 08:58:41 2010 +0200
+++ b/Plugins/WizardPlugins/QRegExpWizard/QRegExpWizardDialog.py	Thu Sep 02 16:36:23 2010 +0200
@@ -225,15 +225,12 @@
                 if ex:
                     fname += ex
             if QFileInfo(fname).exists():
-                res = E5MessageBox.warning(self,
+                res = E5MessageBox.yesNo(self,
                     self.trUtf8("Save regular expression"),
-                    self.trUtf8("<p>The file <b>{0}</b> already exists.</p>")
-                        .format(fname),
-                    QMessageBox.StandardButtons(\
-                        QMessageBox.Abort | \
-                        QMessageBox.Save),
-                    QMessageBox.Abort)
-                if res == QMessageBox.Abort or res == QMessageBox.Cancel:
+                    self.trUtf8("<p>The file <b>{0}</b> already exists."
+                            " Overwrite it?</p>").format(fname),
+                    type_ = E5MessageBox.Warning)
+                if not res:
                     return
             
             try:
@@ -528,4 +525,4 @@
         self.resize(size)
         
         self.cw.buttonBox.accepted[()].connect(self.close)
-        self.cw.buttonBox.rejected[()].connect(self.close)
\ No newline at end of file
+        self.cw.buttonBox.rejected[()].connect(self.close)
diff -r 1538031b5175 -r c3e7bf5648be Project/Project.py
--- a/Project/Project.py	Thu Sep 02 08:58:41 2010 +0200
+++ b/Project/Project.py	Thu Sep 02 16:36:23 2010 +0200
@@ -2874,15 +2874,12 @@
                 if ex:
                     fn += ex
             if QFileInfo(fn).exists():
-                res = E5MessageBox.warning(self.ui,
+                res = E5MessageBox.yesNo(self.ui,
                     self.trUtf8("Save File"),
-                    self.trUtf8("""<p>The file <b>{0}</b> already exists.</p>""")
-                        .format(fn),
-                    QMessageBox.StandardButtons(\
-                        QMessageBox.Abort | \
-                        QMessageBox.Save),
-                    QMessageBox.Abort)
-                if res != QMessageBox.Save:
+                    self.trUtf8("""<p>The file <b>{0}</b> already exists."""
+                                """ Overwrite it?</p>""").format(fn),
+                    type_ = E5MessageBox.Warning)
+                if not res:
                     return False
                 
             self.name = QFileInfo(fn).baseName()
diff -r 1538031b5175 -r c3e7bf5648be QScintilla/Editor.py
--- a/QScintilla/Editor.py	Thu Sep 02 08:58:41 2010 +0200
+++ b/QScintilla/Editor.py	Thu Sep 02 16:36:23 2010 +0200
@@ -2371,15 +2371,12 @@
                     if ex:
                         fn += ex
                 if QFileInfo(fn).exists():
-                    res = E5MessageBox.warning(self,
+                    res = E5MessageBox.yesNo(self,
                         self.trUtf8("Save File"),
-                        self.trUtf8("<p>The file <b>{0}</b> already exists.</p>")
-                            .format(fn),
-                        QMessageBox.StandardButtons(\
-                            QMessageBox.Abort | \
-                            QMessageBox.Save),
-                        QMessageBox.Abort)
-                    if res == QMessageBox.Abort or res == QMessageBox.Cancel:
+                        self.trUtf8("<p>The file <b>{0}</b> already exists."
+                                    " Overwrite it?</p>").format(fn),
+                        type_ = E5MessageBox.Warning)
+                    if not res:
                         return (False, None)
                 fn = Utilities.toNativeSeparators(fn)
                 newName = fn
@@ -4643,15 +4640,12 @@
             if ex:
                 fname += ex
         if QFileInfo(fname).exists():
-            res = E5MessageBox.warning(self,
+            res = E5MessageBox.yesNo(self,
                 self.trUtf8("Save macro"),
-                self.trUtf8("<p>The macro file <b>{0}</b> already exists.</p>")
-                    .format(fname),
-                QMessageBox.StandardButtons(\
-                    QMessageBox.Abort | \
-                    QMessageBox.Save),
-                QMessageBox.Abort)
-            if res == QMessageBox.Abort or res == QMessageBox.Cancel:
+                self.trUtf8("<p>The macro file <b>{0}</b> already exists."
+                            " Overwrite it?</p>").format(fname),
+                type_ = E5MessageBox.Warning)
+            if not res:
                 return
         fname = Utilities.toNativeSeparators(fname)
         
diff -r 1538031b5175 -r c3e7bf5648be QScintilla/Exporters/ExporterBase.py
--- a/QScintilla/Exporters/ExporterBase.py	Thu Sep 02 08:58:41 2010 +0200
+++ b/QScintilla/Exporters/ExporterBase.py	Thu Sep 02 16:36:23 2010 +0200
@@ -53,15 +53,12 @@
                 if ex:
                     fn += ex
             if QFileInfo(fn).exists():
-                res = E5MessageBox.warning(self.editor,
+                res = E5MessageBox.yesNo(self.editor,
                     self.trUtf8("Export source"),
-                    self.trUtf8("<p>The file <b>{0}</b> already exists.</p>")
-                        .format(fn),
-                    QMessageBox.StandardButtons(\
-                        QMessageBox.Abort | \
-                        QMessageBox.Save),
-                    QMessageBox.Abort)
-                if res == QMessageBox.Abort or res == QMessageBox.Cancel:
+                    self.trUtf8("<p>The file <b>{0}</b> already exists."
+                                " Overwrite it?</p>").format(fn),
+                    type_ = E5MessageBox.Warning)
+                if not res:
                     return ""
             
             fn = Utilities.toNativeSeparators(fn)
@@ -74,4 +71,4 @@
         
         This method must be overridden by the real exporters.
         """
-        raise NotImplementedError
\ No newline at end of file
+        raise NotImplementedError
diff -r 1538031b5175 -r c3e7bf5648be UI/DiffDialog.py
--- a/UI/DiffDialog.py	Thu Sep 02 08:58:41 2010 +0200
+++ b/UI/DiffDialog.py	Thu Sep 02 16:36:23 2010 +0200
@@ -286,15 +286,12 @@
             if ex:
                 fileName += ex
         if QFileInfo(fname).exists():
-            res = E5MessageBox.warning(self,
+            res = E5MessageBox.yesNo(self,
                 self.trUtf8("Save Diff"),
-                self.trUtf8("<p>The patch file <b>{0}</b> already exists.</p>")
-                    .format(fname),
-                QMessageBox.StandardButtons(\
-                    QMessageBox.Abort | \
-                    QMessageBox.Save),
-                QMessageBox.Abort)
-            if res != QMessageBox.Save:
+                self.trUtf8("<p>The patch file <b>{0}</b> already exists."
+                            " Overwrite it?</p>").format(fname),
+                type_ = E5MessageBox.Warning)
+            if not res:
                 return
         fname = Utilities.toNativeSeparators(fname)
         
@@ -512,4 +509,4 @@
             QApplication.exit()
             return True
         
-        return False
\ No newline at end of file
+        return False

eric ide

mercurial