eric6/Plugins/VcsPlugins/vcsMercurial/HgBackoutDialog.py

Tue, 02 Mar 2021 17:17:09 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 02 Mar 2021 17:17:09 +0100
changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
permissions
-rw-r--r--

Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.

220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2010 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to enter the data for a backout operation.
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
10 from PyQt5.QtCore import pyqtSlot, QDateTime
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
11 from PyQt5.QtWidgets import QDialog, QDialogButtonBox
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from .Ui_HgBackoutDialog import Ui_HgBackoutDialog
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
15
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 class HgBackoutDialog(QDialog, Ui_HgBackoutDialog):
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 """
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 Class implementing a dialog to enter the data for a backout operation.
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 """
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
20 def __init__(self, tagsList, branchesList, bookmarksList=None,
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
21 parent=None):
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 Constructor
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 @param tagsList list of tags (list of strings)
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 @param branchesList list of branches (list of strings)
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
27 @param bookmarksList list of bookmarks (list of strings)
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 @param parent parent widget (QWidget)
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
30 super(HgBackoutDialog, self).__init__(parent)
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 self.setupUi(self)
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
33 self.buttonBox.button(
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
34 QDialogButtonBox.StandardButton.Ok).setEnabled(False)
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
35
739
efbfe57c8219 Modified some list(sorted(...)) calls.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 220
diff changeset
36 self.tagCombo.addItems(sorted(tagsList))
efbfe57c8219 Modified some list(sorted(...)) calls.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 220
diff changeset
37 self.branchCombo.addItems(["default"] + sorted(branchesList))
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
38 if bookmarksList is not None:
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
39 self.bookmarkCombo.addItems(sorted(bookmarksList))
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
40 else:
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
41 self.bookmarkButton.setHidden(True)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
42 self.bookmarkCombo.setHidden(True)
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 self.__initDateTime = QDateTime.currentDateTime()
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 self.dateEdit.setDateTime(self.__initDateTime)
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
47 def __updateOK(self):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
48 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
49 Private slot to update the OK button.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
50 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
51 enabled = True
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
52 if self.noneButton.isChecked():
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
53 enabled = False
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
54 elif self.idButton.isChecked():
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
55 enabled = self.idEdit.text() != ""
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
56 elif self.tagButton.isChecked():
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
57 enabled = self.tagCombo.currentText() != ""
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
58 elif self.branchButton.isChecked():
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
59 enabled = self.branchCombo.currentText() != ""
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
60 elif self.bookmarkButton.isChecked():
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
61 enabled = self.bookmarkCombo.currentText() != ""
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
62
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
63 self.buttonBox.button(
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
64 QDialogButtonBox.StandardButton.Ok).setEnabled(enabled)
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
65
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
66 @pyqtSlot(bool)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
67 def on_idButton_toggled(self, checked):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
68 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
69 Private slot to handle changes of the ID select button.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
70
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
71 @param checked state of the button (boolean)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
72 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
73 self.__updateOK()
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
74
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
75 @pyqtSlot(bool)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
76 def on_tagButton_toggled(self, checked):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
77 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
78 Private slot to handle changes of the Tag select button.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
79
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
80 @param checked state of the button (boolean)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
81 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
82 self.__updateOK()
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
83
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
84 @pyqtSlot(bool)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
85 def on_branchButton_toggled(self, checked):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
86 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
87 Private slot to handle changes of the Branch select button.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
88
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
89 @param checked state of the button (boolean)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
90 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
91 self.__updateOK()
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
92
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
93 @pyqtSlot(bool)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
94 def on_bookmarkButton_toggled(self, checked):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
95 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
96 Private slot to handle changes of the Bookmark select button.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
97
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
98 @param checked state of the button (boolean)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
99 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
100 self.__updateOK()
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
101
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 @pyqtSlot(bool)
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 def on_noneButton_toggled(self, checked):
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 """
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 Private slot to handle the toggling of the None revision button.
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 @param checked flag indicating the checked state (boolean)
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 """
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
109 self.__updateOK()
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
110
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
111 @pyqtSlot(str)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
112 def on_idEdit_textChanged(self, txt):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
113 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
114 Private slot to handle changes of the ID edit.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
115
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
116 @param txt text of the edit (string)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
117 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
118 self.__updateOK()
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
119
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
120 @pyqtSlot(str)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
121 def on_tagCombo_editTextChanged(self, txt):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
122 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
123 Private slot to handle changes of the Tag combo.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
124
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
125 @param txt text of the combo (string)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
126 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
127 self.__updateOK()
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
128
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
129 @pyqtSlot(str)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
130 def on_branchCombo_editTextChanged(self, txt):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
131 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
132 Private slot to handle changes of the Branch combo.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
133
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
134 @param txt text of the combo (string)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
135 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
136 self.__updateOK()
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
137
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
138 @pyqtSlot(str)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
139 def on_bookmarkCombo_editTextChanged(self, txt):
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
140 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
141 Private slot to handle changes of the Bookmark combo.
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
142
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
143 @param txt text of the combo (string)
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
144 """
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
145 self.__updateOK()
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 def getParameters(self):
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 """
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149 Public method to retrieve the backout data.
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
151 @return tuple naming the revision, a flag indicating a
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 merge, the commit date, the commit user and a commit message
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 (string, boolean, string, string, string)
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 """
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155 if self.numberButton.isChecked():
3337
49faa820151a Corrected some Mercurial input dialogs offering to enter either a revision number or a changeset id to use rev() and id() to make the operation unambigous.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
156 rev = "rev({0})".format(self.numberSpinBox.value())
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 elif self.idButton.isChecked():
3337
49faa820151a Corrected some Mercurial input dialogs offering to enter either a revision number or a changeset id to use rev() and id() to make the operation unambigous.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
158 rev = "id({0})".format(self.idEdit.text())
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 elif self.tagButton.isChecked():
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 rev = self.tagCombo.currentText()
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 elif self.branchButton.isChecked():
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 rev = self.branchCombo.currentText()
1017
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
163 elif self.bookmarkButton.isChecked():
919147f2b518 Continued with Mercurial bookmark support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
164 rev = self.bookmarkCombo.currentText()
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 else:
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 rev = ""
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 if self.dateEdit.dateTime() != self.__initDateTime:
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 date = self.dateEdit.dateTime().toString("yyyy-MM-dd hh:mm")
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 else:
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 date = ""
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 if self.messageEdit.toPlainText():
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 msg = self.messageEdit.toPlainText()
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 else:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
176 msg = self.tr("Backed out changeset <{0}>.").format(rev)
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
178 return (rev,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
179 self.mergeCheckBox.isChecked,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
180 date,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
181 self.userEdit.text(),
220
92b796009140 Added files forgotten in previous commits.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 msg
3036
30c81c9e88b8 Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
183 )

eric ide

mercurial