31 def __init__(self, vcs, parent=None): |
31 def __init__(self, vcs, parent=None): |
32 """ |
32 """ |
33 Constructor |
33 Constructor |
34 |
34 |
35 @param vcs reference to the vcs object |
35 @param vcs reference to the vcs object |
36 @param parent parent widget (QWidget) |
36 @type Hg |
|
37 @param parent parent widget |
|
38 @type QWidget |
37 """ |
39 """ |
38 super().__init__(parent) |
40 super().__init__(parent) |
39 self.setupUi(self) |
41 self.setupUi(self) |
40 |
42 |
41 self.refreshButton = self.buttonBox.addButton( |
43 self.refreshButton = self.buttonBox.addButton( |
60 |
62 |
61 def closeEvent(self, e): |
63 def closeEvent(self, e): |
62 """ |
64 """ |
63 Protected slot implementing a close event handler. |
65 Protected slot implementing a close event handler. |
64 |
66 |
65 @param e close event (QCloseEvent) |
67 @param e close event |
|
68 @type QCloseEvent |
66 """ |
69 """ |
67 self.__diffGenerator.stopProcess() |
70 self.__diffGenerator.stopProcess() |
68 e.accept() |
71 e.accept() |
69 |
72 |
70 def start(self, fn, versions=None, bundle=None, qdiff=False, refreshable=False): |
73 def start(self, fn, versions=None, bundle=None, qdiff=False, refreshable=False): |
71 """ |
74 """ |
72 Public slot to start the hg diff command. |
75 Public slot to start the hg diff command. |
73 |
76 |
74 @param fn filename to be diffed (string) |
77 @param fn filename to be diffed |
75 @param versions list of versions to be diffed (list of up to |
78 @type str |
76 2 strings or None) |
79 @param versions list of versions to be diffed or None |
77 @param bundle name of a bundle file (string) |
80 @type list of [str, str] |
78 @param qdiff flag indicating qdiff command shall be used (boolean) |
81 @param bundle name of a bundle file |
79 @param refreshable flag indicating a refreshable diff (boolean) |
82 @type str |
|
83 @param qdiff flag indicating qdiff command shall be used |
|
84 @type bool |
|
85 @param refreshable flag indicating a refreshable diff |
|
86 @type bool |
80 """ |
87 """ |
81 self.refreshButton.setVisible(refreshable) |
88 self.refreshButton.setVisible(refreshable) |
82 |
89 |
83 self.errorGroup.hide() |
90 self.errorGroup.hide() |
84 self.filename = fn |
91 self.filename = fn |
150 |
157 |
151 def on_buttonBox_clicked(self, button): |
158 def on_buttonBox_clicked(self, button): |
152 """ |
159 """ |
153 Private slot called by a button of the button box clicked. |
160 Private slot called by a button of the button box clicked. |
154 |
161 |
155 @param button button that was clicked (QAbstractButton) |
162 @param button button that was clicked |
|
163 @type QAbstractButton |
156 """ |
164 """ |
157 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Save): |
165 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Save): |
158 self.on_saveButton_clicked() |
166 self.on_saveButton_clicked() |
159 elif button == self.refreshButton: |
167 elif button == self.refreshButton: |
160 self.on_refreshButton_clicked() |
168 self.on_refreshButton_clicked() |
162 @pyqtSlot(int) |
170 @pyqtSlot(int) |
163 def on_filesCombo_activated(self, index): |
171 def on_filesCombo_activated(self, index): |
164 """ |
172 """ |
165 Private slot to handle the selection of a file. |
173 Private slot to handle the selection of a file. |
166 |
174 |
167 @param index activated row (integer) |
175 @param index activated row |
|
176 @type int |
168 """ |
177 """ |
169 para = self.filesCombo.itemData(index) |
178 para = self.filesCombo.itemData(index) |
170 |
179 |
171 if para == 0: |
180 if para == 0: |
172 tc = self.contents.textCursor() |
181 tc = self.contents.textCursor() |