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 Subversion |
|
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 |
44 |
43 self.refreshButton = self.buttonBox.addButton( |
45 self.refreshButton = self.buttonBox.addButton( |
64 |
66 |
65 def closeEvent(self, e): |
67 def closeEvent(self, e): |
66 """ |
68 """ |
67 Protected slot implementing a close event handler. |
69 Protected slot implementing a close event handler. |
68 |
70 |
69 @param e close event (QCloseEvent) |
71 @param e close event |
|
72 @type QCloseEvent |
70 """ |
73 """ |
71 if ( |
74 if ( |
72 self.process is not None |
75 self.process is not None |
73 and self.process.state() != QProcess.ProcessState.NotRunning |
76 and self.process.state() != QProcess.ProcessState.NotRunning |
74 ): |
77 ): |
80 |
83 |
81 def __getVersionArg(self, version): |
84 def __getVersionArg(self, version): |
82 """ |
85 """ |
83 Private method to get a svn revision argument for the given revision. |
86 Private method to get a svn revision argument for the given revision. |
84 |
87 |
85 @param version revision (integer or string) |
88 @param version revision |
86 @return version argument (string) |
89 @type int or str |
|
90 @return version argument |
|
91 @rtype str |
87 """ |
92 """ |
88 if version == "WORKING": |
93 if version == "WORKING": |
89 return None |
94 return None |
90 else: |
95 else: |
91 return str(version) |
96 return str(version) |
92 |
97 |
93 def start(self, fn, versions=None, urls=None, summary=False, refreshable=False): |
98 def start(self, fn, versions=None, urls=None, summary=False, refreshable=False): |
94 """ |
99 """ |
95 Public slot to start the svn diff command. |
100 Public slot to start the svn diff command. |
96 |
101 |
97 @param fn filename to be diffed (string) |
102 @param fn filename to be diffed |
98 @param versions list of versions to be diffed (list of up to 2 strings |
103 @type str |
99 or None) |
104 @param versions list of versions to be diffed |
100 @param urls list of repository URLs (list of 2 strings) |
105 @type list of up to 2 str or None |
|
106 @param urls list of repository URLs |
|
107 @type list of [str, str] |
101 @param summary flag indicating a summarizing diff |
108 @param summary flag indicating a summarizing diff |
102 (only valid for URL diffs) (boolean) |
109 (only valid for URL diffs) |
103 @param refreshable flag indicating a refreshable diff (boolean) |
110 @type bool |
|
111 @param refreshable flag indicating a refreshable diff |
|
112 @type bool |
104 """ |
113 """ |
105 self.refreshButton.setVisible(refreshable) |
114 self.refreshButton.setVisible(refreshable) |
106 |
115 |
107 self.errorGroup.hide() |
116 self.errorGroup.hide() |
108 self.inputGroup.show() |
117 self.inputGroup.show() |
195 @pyqtSlot(int, QProcess.ExitStatus) |
204 @pyqtSlot(int, QProcess.ExitStatus) |
196 def __procFinished(self, exitCode, exitStatus): |
205 def __procFinished(self, exitCode, exitStatus): |
197 """ |
206 """ |
198 Private slot connected to the finished signal. |
207 Private slot connected to the finished signal. |
199 |
208 |
200 @param exitCode exit code of the process (integer) |
209 @param exitCode exit code of the process |
201 @param exitStatus exit status of the process (QProcess.ExitStatus) |
210 @type int |
|
211 @param exitStatus exit status of the process |
|
212 @type QProcess.ExitStatus |
202 """ |
213 """ |
203 self.inputGroup.setEnabled(False) |
214 self.inputGroup.setEnabled(False) |
204 self.inputGroup.hide() |
215 self.inputGroup.hide() |
205 self.refreshButton.setEnabled(True) |
216 self.refreshButton.setEnabled(True) |
206 |
217 |
231 |
242 |
232 def __appendText(self, txt): |
243 def __appendText(self, txt): |
233 """ |
244 """ |
234 Private method to append text to the end of the contents pane. |
245 Private method to append text to the end of the contents pane. |
235 |
246 |
236 @param txt text to insert (string) |
247 @param txt text to insert |
|
248 @type str |
237 """ |
249 """ |
238 tc = self.contents.textCursor() |
250 tc = self.contents.textCursor() |
239 tc.movePosition(QTextCursor.MoveOperation.End) |
251 tc.movePosition(QTextCursor.MoveOperation.End) |
240 self.contents.setTextCursor(tc) |
252 self.contents.setTextCursor(tc) |
241 self.contents.insertPlainText(txt) |
253 self.contents.insertPlainText(txt) |
242 |
254 |
243 def __extractFileName(self, line): |
255 def __extractFileName(self, line): |
244 """ |
256 """ |
245 Private method to extract the file name out of a file separator line. |
257 Private method to extract the file name out of a file separator line. |
246 |
258 |
247 @param line line to be processed (string) |
259 @param line line to be processed |
248 @return extracted file name (string) |
260 @type str |
|
261 @return extracted file name |
|
262 @rtype str |
249 """ |
263 """ |
250 f = line.split(None, 1)[1] |
264 f = line.split(None, 1)[1] |
251 f = f.rsplit(None, 2)[0] |
265 f = f.rsplit(None, 2)[0] |
252 return f |
266 return f |
253 |
267 |
254 def __processFileLine(self, line): |
268 def __processFileLine(self, line): |
255 """ |
269 """ |
256 Private slot to process a line giving the old/new file. |
270 Private slot to process a line giving the old/new file. |
257 |
271 |
258 @param line line to be processed (string) |
272 @param line line to be processed |
|
273 @type str |
259 """ |
274 """ |
260 if line.startswith("---"): |
275 if line.startswith("---"): |
261 self.__oldFileLine = self.paras |
276 self.__oldFileLine = self.paras |
262 self.__oldFile = self.__extractFileName(line) |
277 self.__oldFile = self.__extractFileName(line) |
263 else: |
278 else: |
306 |
321 |
307 def on_buttonBox_clicked(self, button): |
322 def on_buttonBox_clicked(self, button): |
308 """ |
323 """ |
309 Private slot called by a button of the button box clicked. |
324 Private slot called by a button of the button box clicked. |
310 |
325 |
311 @param button button that was clicked (QAbstractButton) |
326 @param button button that was clicked |
|
327 @type QAbstractButton |
312 """ |
328 """ |
313 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Save): |
329 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Save): |
314 self.on_saveButton_clicked() |
330 self.on_saveButton_clicked() |
315 elif button == self.refreshButton: |
331 elif button == self.refreshButton: |
316 self.on_refreshButton_clicked() |
332 self.on_refreshButton_clicked() |
318 @pyqtSlot(int) |
334 @pyqtSlot(int) |
319 def on_filesCombo_activated(self, index): |
335 def on_filesCombo_activated(self, index): |
320 """ |
336 """ |
321 Private slot to handle the selection of a file. |
337 Private slot to handle the selection of a file. |
322 |
338 |
323 @param index activated row (integer) |
339 @param index activated row |
|
340 @type int |
324 """ |
341 """ |
325 para = self.filesCombo.itemData(index) |
342 para = self.filesCombo.itemData(index) |
326 |
343 |
327 if para == 0: |
344 if para == 0: |
328 tc = self.contents.textCursor() |
345 tc = self.contents.textCursor() |
429 |
446 |
430 def on_passwordCheckBox_toggled(self, isOn): |
447 def on_passwordCheckBox_toggled(self, isOn): |
431 """ |
448 """ |
432 Private slot to handle the password checkbox toggled. |
449 Private slot to handle the password checkbox toggled. |
433 |
450 |
434 @param isOn flag indicating the status of the check box (boolean) |
451 @param isOn flag indicating the status of the check box |
|
452 @type bool |
435 """ |
453 """ |
436 if isOn: |
454 if isOn: |
437 self.input.setEchoMode(QLineEdit.EchoMode.Password) |
455 self.input.setEchoMode(QLineEdit.EchoMode.Password) |
438 else: |
456 else: |
439 self.input.setEchoMode(QLineEdit.EchoMode.Normal) |
457 self.input.setEchoMode(QLineEdit.EchoMode.Normal) |