33 def __init__(self, vcs, parent=None): |
33 def __init__(self, vcs, parent=None): |
34 """ |
34 """ |
35 Constructor |
35 Constructor |
36 |
36 |
37 @param vcs reference to the vcs object |
37 @param vcs reference to the vcs object |
38 @param parent parent widget (QWidget) |
38 @type Hg |
|
39 @param parent parent widget |
|
40 @type QWidget |
39 """ |
41 """ |
40 super().__init__(parent) |
42 super().__init__(parent) |
41 self.setupUi(self) |
43 self.setupUi(self) |
42 self.setWindowFlags(Qt.WindowType.Window) |
44 self.setWindowFlags(Qt.WindowType.Window) |
43 |
45 |
63 |
65 |
64 def closeEvent(self, e): |
66 def closeEvent(self, e): |
65 """ |
67 """ |
66 Protected slot implementing a close event handler. |
68 Protected slot implementing a close event handler. |
67 |
69 |
68 @param e close event (QCloseEvent) |
70 @param e close event |
|
71 @type QCloseEvent |
69 """ |
72 """ |
70 if self.__hgClient.isExecuting(): |
73 if self.__hgClient.isExecuting(): |
71 self.__hgClient.cancel() |
74 self.__hgClient.cancel() |
72 |
75 |
73 e.accept() |
76 e.accept() |
75 def start(self, bookmarksList): |
78 def start(self, bookmarksList): |
76 """ |
79 """ |
77 Public slot to start the bookmarks command. |
80 Public slot to start the bookmarks command. |
78 |
81 |
79 @param bookmarksList reference to string list receiving the bookmarks |
82 @param bookmarksList reference to string list receiving the bookmarks |
80 (list of strings) |
83 @type list of str |
81 """ |
84 """ |
82 self.bookmarksList.clear() |
85 self.bookmarksList.clear() |
83 self.__bookmarksDefined = False |
86 self.__bookmarksDefined = False |
84 |
87 |
85 self.errorGroup.hide() |
88 self.errorGroup.hide() |
140 |
143 |
141 def on_buttonBox_clicked(self, button): |
144 def on_buttonBox_clicked(self, button): |
142 """ |
145 """ |
143 Private slot called by a button of the button box clicked. |
146 Private slot called by a button of the button box clicked. |
144 |
147 |
145 @param button button that was clicked (QAbstractButton) |
148 @param button button that was clicked |
|
149 @type QAbstractButton |
146 """ |
150 """ |
147 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close): |
151 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close): |
148 self.close() |
152 self.close() |
149 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): |
153 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): |
150 if self.__hgClient: |
154 if self.__hgClient: |
174 |
178 |
175 def __generateItem(self, revision, changeset, status, name): |
179 def __generateItem(self, revision, changeset, status, name): |
176 """ |
180 """ |
177 Private method to generate a bookmark item in the bookmarks list. |
181 Private method to generate a bookmark item in the bookmarks list. |
178 |
182 |
179 @param revision revision of the bookmark (string) |
183 @param revision revision of the bookmark |
180 @param changeset changeset of the bookmark (string) |
184 @type str |
181 @param status of the bookmark (string) |
185 @param changeset changeset of the bookmark |
182 @param name name of the bookmark (string) |
186 @type str |
|
187 @param status of the bookmark |
|
188 @type str |
|
189 @param name name of the bookmark |
|
190 @type str |
183 """ |
191 """ |
184 itm = QTreeWidgetItem(self.bookmarksList) |
192 itm = QTreeWidgetItem(self.bookmarksList) |
185 if revision[0].isdecimal(): |
193 if revision[0].isdecimal(): |
186 # valid bookmark entry |
194 # valid bookmark entry |
187 itm.setData(0, Qt.ItemDataRole.DisplayRole, int(revision)) |
195 itm.setData(0, Qt.ItemDataRole.DisplayRole, int(revision)) |
197 |
205 |
198 def __processOutputLine(self, line): |
206 def __processOutputLine(self, line): |
199 """ |
207 """ |
200 Private method to process the lines of output. |
208 Private method to process the lines of output. |
201 |
209 |
202 @param line output line to be processed (string) |
210 @param line output line to be processed |
|
211 @type str |
203 """ |
212 """ |
204 li = line.split() |
213 li = line.split() |
205 if li[-1][0] in "1234567890": |
214 if li[-1][0] in "1234567890": |
206 # last element is a rev:changeset |
215 # last element is a rev:changeset |
207 rev, changeset = li[-1].split(":", 1) |
216 rev, changeset = li[-1].split(":", 1) |
218 |
227 |
219 def __showError(self, out): |
228 def __showError(self, out): |
220 """ |
229 """ |
221 Private slot to show some error. |
230 Private slot to show some error. |
222 |
231 |
223 @param out error to be shown (string) |
232 @param out error to be shown |
|
233 @type str |
224 """ |
234 """ |
225 self.errorGroup.show() |
235 self.errorGroup.show() |
226 self.errors.insertPlainText(out) |
236 self.errors.insertPlainText(out) |
227 self.errors.ensureCursorVisible() |
237 self.errors.ensureCursorVisible() |
228 |
238 |