25 def __init__(self, vcs, mode, parent=None): |
25 def __init__(self, vcs, mode, parent=None): |
26 """ |
26 """ |
27 Constructor |
27 Constructor |
28 |
28 |
29 @param vcs reference to the vcs object |
29 @param vcs reference to the vcs object |
|
30 @type Hg |
30 @param mode mode of the dialog (HgBookmarksInOutDialog.INCOMING, |
31 @param mode mode of the dialog (HgBookmarksInOutDialog.INCOMING, |
31 HgBookmarksInOutDialog.OUTGOING) |
32 HgBookmarksInOutDialog.OUTGOING) |
32 @param parent reference to the parent widget (QWidget) |
33 @type int |
|
34 @param parent reference to the parent widget |
|
35 @type QWidget |
33 @exception ValueError raised to indicate an invalid dialog mode |
36 @exception ValueError raised to indicate an invalid dialog mode |
34 """ |
37 """ |
35 super().__init__(parent) |
38 super().__init__(parent) |
36 self.setupUi(self) |
39 self.setupUi(self) |
37 self.setWindowFlags(Qt.WindowType.Window) |
40 self.setWindowFlags(Qt.WindowType.Window) |
58 |
61 |
59 def closeEvent(self, e): |
62 def closeEvent(self, e): |
60 """ |
63 """ |
61 Protected slot implementing a close event handler. |
64 Protected slot implementing a close event handler. |
62 |
65 |
63 @param e close event (QCloseEvent) |
66 @param e close event |
|
67 @type QCloseEvent |
64 """ |
68 """ |
65 if self.__hgClient.isExecuting(): |
69 if self.__hgClient.isExecuting(): |
66 self.__hgClient.cancel() |
70 self.__hgClient.cancel() |
67 |
71 |
68 e.accept() |
72 e.accept() |
119 |
123 |
120 def on_buttonBox_clicked(self, button): |
124 def on_buttonBox_clicked(self, button): |
121 """ |
125 """ |
122 Private slot called by a button of the button box clicked. |
126 Private slot called by a button of the button box clicked. |
123 |
127 |
124 @param button button that was clicked (QAbstractButton) |
128 @param button button that was clicked |
|
129 @type QAbstractButton |
125 """ |
130 """ |
126 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close): |
131 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close): |
127 self.close() |
132 self.close() |
128 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): |
133 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): |
129 if self.__hgClient: |
134 if self.__hgClient: |
151 |
156 |
152 def __generateItem(self, changeset, name): |
157 def __generateItem(self, changeset, name): |
153 """ |
158 """ |
154 Private method to generate a bookmark item in the bookmarks list. |
159 Private method to generate a bookmark item in the bookmarks list. |
155 |
160 |
156 @param changeset changeset of the bookmark (string) |
161 @param changeset changeset of the bookmark |
157 @param name name of the bookmark (string) |
162 @type str |
|
163 @param name name of the bookmark |
|
164 @type str |
158 """ |
165 """ |
159 QTreeWidgetItem(self.bookmarksList, [name, changeset]) |
166 QTreeWidgetItem(self.bookmarksList, [name, changeset]) |
160 |
167 |
161 def __processOutputLine(self, line): |
168 def __processOutputLine(self, line): |
162 """ |
169 """ |
163 Private method to process the lines of output. |
170 Private method to process the lines of output. |
164 |
171 |
165 @param line output line to be processed (string) |
172 @param line output line to be processed |
|
173 @type str |
166 """ |
174 """ |
167 if line.startswith(" "): |
175 if line.startswith(" "): |
168 li = line.strip().split() |
176 li = line.strip().split() |
169 changeset = li[-1] |
177 changeset = li[-1] |
170 del li[-1] |
178 del li[-1] |
173 |
181 |
174 def __showError(self, out): |
182 def __showError(self, out): |
175 """ |
183 """ |
176 Private slot to show some error. |
184 Private slot to show some error. |
177 |
185 |
178 @param out error to be shown (string) |
186 @param out error to be shown |
|
187 @type str |
179 """ |
188 """ |
180 self.errorGroup.show() |
189 self.errorGroup.show() |
181 self.errors.insertPlainText(out) |
190 self.errors.insertPlainText(out) |
182 self.errors.ensureCursorVisible() |
191 self.errors.ensureCursorVisible() |