VCS/ProjectHelper.py

changeset 543
a558e3cb7b5a
parent 538
7f1a56e80124
child 564
b3d966393ba9
--- a/VCS/ProjectHelper.py	Tue Aug 31 16:38:06 2010 +0200
+++ b/VCS/ProjectHelper.py	Wed Sep 01 19:24:30 2010 +0200
@@ -155,14 +155,10 @@
                 self.project.pdata["VCS"] = [vcsSystem]
                 self.project.vcs = self.project.initVCS(vcsSystem)
                 # edit VCS command options
-                vcores = E5MessageBox.question(self.parent(),
+                vcores = E5MessageBox.yesNo(self.parent(),
                     self.trUtf8("New Project"),
-                    self.trUtf8("""Would you like to edit the VCS command options?"""),
-                    QMessageBox.StandardButtons(\
-                        QMessageBox.No | \
-                        QMessageBox.Yes),
-                    QMessageBox.No)
-                if vcores == QMessageBox.Yes:
+                    self.trUtf8("""Would you like to edit the VCS command options?"""))
+                if vcores:
                     codlg = vcsCommandOptionsDialog(self.project.vcs)
                     if codlg.exec_() == QDialog.Accepted:
                         self.project.vcs.vcsSetOptions(codlg.getOptions())
@@ -212,17 +208,14 @@
                             self.project.setDirty(True)
                             self.project.saveProject()
                     else:
-                        res = E5MessageBox.question(self.parent(),
+                        res = E5MessageBox.yesNo(self.parent(),
                             self.trUtf8("New project from repository"),
                             self.trUtf8("The project retrieved from the repository"
                                 " does not contain an eric project file"
                                 " (*.e4p *.e4pz)."
                                 " Create it?"),
-                            QMessageBox.StandardButtons(\
-                                QMessageBox.No | \
-                                QMessageBox.Yes),
-                            QMessageBox.Yes)
-                        if res == QMessageBox.Yes:
+                            yesDefault = True)
+                        if res:
                             self.project.ppath = projectdir
                             self.project.opened = True
                             
@@ -243,15 +236,12 @@
                                 self.project.saveProject()
                                 self.project.openProject(self.project.pfile)
                                 if not export:
-                                    res = E5MessageBox.question(self.parent(),
+                                    res = E5MessageBox.yesNo(self.parent(),
                                         self.trUtf8("New project from repository"),
                                         self.trUtf8("Shall the project file be added to"
                                             " the repository?"),
-                                        QMessageBox.StandardButtons(\
-                                            QMessageBox.No | \
-                                            QMessageBox.Yes),
-                                        QMessageBox.Yes)
-                                    if res == QMessageBox.Yes:
+                                        yesDefault = True)
+                                    if res:
                                         self.project.vcs.vcsAdd(self.project.pfile)
                 else:
                     E5MessageBox.critical(self.parent(),
@@ -323,14 +313,10 @@
             if vcsdlg.exec_() == QDialog.Accepted:
                 vcsDataDict = vcsdlg.getData()
                 # edit VCS command options
-                vcores = E5MessageBox.question(self.parent(),
+                vcores = E5MessageBox.yesNo(self.parent(),
                     self.trUtf8("Import Project"),
-                    self.trUtf8("""Would you like to edit the VCS command options?"""),
-                    QMessageBox.StandardButtons(\
-                        QMessageBox.No | \
-                        QMessageBox.Yes),
-                    QMessageBox.No)
-                if vcores == QMessageBox.Yes:
+                    self.trUtf8("""Would you like to edit the VCS command options?"""))
+                if vcores:
                     codlg = vcsCommandOptionsDialog(self.project.vcs)
                     if codlg.exec_() == QDialog.Accepted:
                         self.project.vcs.vcsSetOptions(codlg.getOptions())
@@ -356,14 +342,11 @@
         """
         shouldReopen = self.vcs.vcsUpdate(self.project.ppath)
         if shouldReopen:
-            res = E5MessageBox.question(self.parent(),
+            res = E5MessageBox.yesNo(self.parent(),
                 self.trUtf8("Update"),
                 self.trUtf8("""The project should be reread. Do this now?"""),
-                QMessageBox.StandardButtons(\
-                    QMessageBox.No | \
-                    QMessageBox.Yes),
-                QMessageBox.Yes)
-            if res == QMessageBox.Yes:
+                yesDefault = True)
+            if res:
                 self.project.reopenProject()
         
     def _vcsCommit(self):
@@ -383,15 +366,11 @@
         Depending on the parameters set in the vcs object the project
         may be removed from the local disk as well.
         """
-        res = E5MessageBox.question(self.parent(),
+        res = E5MessageBox.yesNo(self.parent(),
             self.trUtf8("Remove project from repository"),
             self.trUtf8("Dou you really want to remove this project from"
-                " the repository (and disk)?"),
-            QMessageBox.StandardButtons(\
-                QMessageBox.No | \
-                QMessageBox.Yes),
-            QMessageBox.No)
-        if res == QMessageBox.Yes:
+                " the repository (and disk)?"))
+        if res:
             self.vcs.vcsRemove(self.project.ppath, True)
             self._vcsCommit()
             if not os.path.exists(self.project.pfile):
@@ -469,4 +448,4 @@
         """
         info = self.vcs.vcsRepositoryInfos(self.project.ppath)
         dlg = VcsRepositoryInfoDialog(None, info)
-        dlg.exec_()
\ No newline at end of file
+        dlg.exec_()

eric ide

mercurial