Fixed an issue in E5MessageBox.

Sat, 11 Sep 2010 19:00:10 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 11 Sep 2010 19:00:10 +0200
changeset 588
573767cf6bde
parent 587
3078a9781573
child 589
a9a4620f6767

Fixed an issue in E5MessageBox.

E5Gui/E5MessageBox.py file | annotate | diff | comparison | revisions
--- a/E5Gui/E5MessageBox.py	Sat Sep 11 18:09:03 2010 +0200
+++ b/E5Gui/E5MessageBox.py	Sat Sep 11 19:00:10 2010 +0200
@@ -78,8 +78,13 @@
         """
         QMessageBox.__init__(self, parent)
         self.setIcon(icon)
-        if modal and parent is not None:
-            self.setWindowModality(Qt.WindowModal)
+        if modal:
+            if parent is not None:
+                self.setWindowModality(Qt.WindowModal)
+            else:
+                self.setWindowModality(Qt.ApplicationModal)
+        else:
+            self.setWindowModality(Qt.NonModal)
         if title == "":
             self.setWindowTitle("{0}".format(
                 QApplication.applicationName()))
@@ -87,6 +92,8 @@
             self.setWindowTitle("{0} - {1}".format(
                 QApplication.applicationName(), title))
         self.setText(text)
+        if buttons == QMessageBox.NoButton:
+            buttons = QMessageBox.StandardButtons(QMessageBox.Ok)
         self.setStandardButtons(buttons)
 
 ################################################################################

eric ide

mercurial