Sun, 29 Sep 2013 15:08:57 +0200
Continued correcting doc strings by using the new doc string checker.
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
2302
f29e9405c851
Updated copyright for 2013.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1608
diff
changeset
|
3 | # Copyright (c) 2012 - 2013 Detlev Offenbach <detlev@die-offenbachs.de> |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing a dialog to enter data for the Mercurial Phase operation. |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
10 | from PyQt4.QtCore import pyqtSlot |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | from PyQt4.QtGui import QDialog, QDialogButtonBox |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | from .Ui_HgPhaseDialog import Ui_HgPhaseDialog |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
14 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
15 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | class HgPhaseDialog(QDialog, Ui_HgPhaseDialog): |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
17 | """ |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | Class dimplementing a dialog to enter data for the Mercurial Phase operation. |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | """ |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | def __init__(self, parent=None): |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | """ |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | Constructor |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | @param parent reference to the parent widget (QWidget) |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | """ |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
26 | super().__init__(parent) |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | self.setupUi(self) |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | self.phaseCombo.addItem("", "") |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | self.phaseCombo.addItem(self.trUtf8("Public"), "p") |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | self.phaseCombo.addItem(self.trUtf8("Draft"), "d") |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | self.phaseCombo.addItem(self.trUtf8("Secret"), "s") |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | def __updateOk(self): |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | """ |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | Private slot to update the state of the OK button. |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | """ |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | self.buttonBox.button(QDialogButtonBox.Ok).setEnabled( |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
41 | self.revisionsEdit.toPlainText().strip() != "" and |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | self.phaseCombo.currentText().strip() != "") |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
43 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
44 | @pyqtSlot() |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
45 | def on_revisionsEdit_textChanged(self): |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
46 | """ |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
47 | Private slot to react upon changes of revisions. |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
48 | """ |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
49 | self.__updateOk() |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
50 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
51 | @pyqtSlot(str) |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
52 | def on_phaseCombo_activated(self, txt): |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
53 | """ |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
54 | Private slot to react upon changes of the phase. |
2962
d6c9d1ca2da4
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2302
diff
changeset
|
55 | |
d6c9d1ca2da4
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2302
diff
changeset
|
56 | @param txt activated entry (string) |
1608
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
57 | """ |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
58 | self.__updateOk() |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
59 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
60 | def getData(self): |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
61 | """ |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
62 | Public method to retrieve the entered data. |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
63 | |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
64 | @return tuple with list of revisions, phase and a flag indicating |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
65 | a forced operation (list of strings, string, boolean) |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
66 | """ |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
67 | return ( |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
68 | self.revisionsEdit.toPlainText().strip().splitlines(), |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
69 | self.phaseCombo.itemData(self.phaseCombo.currentIndex()), |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
70 | self.forceCheckBox.isChecked() |
b6390d242303
Added capability to change the phase of changesets to the project VCS menu and the Mercurial log-browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
71 | ) |