Cooperation/ChatWidget.py

changeset 546
c3e7bf5648be
parent 539
87f9bce38a44
child 553
5af61623ae3c
--- 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)

eric ide

mercurial