Preferences/ShortcutsDialog.py

changeset 541
00e1a5d060c5
parent 539
87f9bce38a44
child 553
5af61623ae3c
--- a/Preferences/ShortcutsDialog.py	Tue Aug 31 13:39:24 2010 +0200
+++ b/Preferences/ShortcutsDialog.py	Tue Aug 31 16:38:06 2010 +0200
@@ -293,18 +293,15 @@
                         itmseq = itm.text(col)
                         # step 1: check if shortcut is already allocated
                         if keystr == itmseq:
-                            res = E5MessageBox.warning(self,
+                            res = E5MessageBox.yesNo(self,
                                 self.trUtf8("Edit shortcuts"),
                                 self.trUtf8(\
                                     """<p><b>{0}</b> has already been allocated"""
                                     """ to the <b>{1}</b> action. """
                                     """Remove this binding?</p>""")
                                     .format(keystr, itm.text(0)),
-                                QMessageBox.StandardButtons(\
-                                    QMessageBox.No | \
-                                    QMessageBox.Yes),
-                                QMessageBox.No)
-                            if res == QMessageBox.Yes:
+                                type_ = E5MessageBox.Warning)
+                            if res:
                                 itm.setText(col, "")
                                 return True
                             else:
@@ -315,17 +312,14 @@
                         
                         # step 2: check if shortcut hides an already allocated
                         if itmseq.startswith("{0}+".format(keystr)):
-                            res = E5MessageBox.warning(self,
+                            res = E5MessageBox.yesNo(self,
                                 self.trUtf8("Edit shortcuts"),
                                 self.trUtf8(\
                                     """<p><b>{0}</b> hides the <b>{1}</b> action. """
                                     """Remove this binding?</p>""")
                                     .format(keystr, itm.text(0)),
-                                QMessageBox.StandardButtons(\
-                                    QMessageBox.No | \
-                                    QMessageBox.Yes),
-                                QMessageBox.No)
-                            if res == QMessageBox.Yes:
+                                type_ = E5MessageBox.Warning)
+                            if res:
                                 itm.setText(col, "")
                                 return True
                             else:
@@ -333,18 +327,15 @@
                         
                         # step 3: check if shortcut is hidden by an already allocated
                         if keystr.startswith("{0}+".format(itmseq)):
-                            res = E5MessageBox.warning(self,
+                            res = E5MessageBox.yesNo(self,
                                 self.trUtf8("Edit shortcuts"),
                                 self.trUtf8(\
                                     """<p><b>{0}</b> is hidden by the """
                                     """<b>{1}</b> action. """
                                     """Remove this binding?</p>""")
                                     .format(keystr, itm.text(0)),
-                                QMessageBox.StandardButtons(\
-                                    QMessageBox.No | \
-                                    QMessageBox.Yes),
-                                QMessageBox.No)
-                            if res == QMessageBox.Yes:
+                                type_ = E5MessageBox.Warning)
+                            if res:
                                 itm.setText(col, "")
                                 return True
                             else:
@@ -462,4 +453,4 @@
         @param checked state of the shortcuts radio button (boolean)
         """
         if checked:
-            self.on_searchEdit_textChanged(self.searchEdit.text())
\ No newline at end of file
+            self.on_searchEdit_textChanged(self.searchEdit.text())

eric ide

mercurial