24 |
28 |
25 class GitRemoteRepositoriesDialog(QWidget, Ui_GitRemoteRepositoriesDialog): |
29 class GitRemoteRepositoriesDialog(QWidget, Ui_GitRemoteRepositoriesDialog): |
26 """ |
30 """ |
27 Class implementing a dialog to show available remote repositories. |
31 Class implementing a dialog to show available remote repositories. |
28 """ |
32 """ |
|
33 |
29 def __init__(self, vcs, parent=None): |
34 def __init__(self, vcs, parent=None): |
30 """ |
35 """ |
31 Constructor |
36 Constructor |
32 |
37 |
33 @param vcs reference to the vcs object |
38 @param vcs reference to the vcs object |
34 @param parent parent widget (QWidget) |
39 @param parent parent widget (QWidget) |
35 """ |
40 """ |
36 super().__init__(parent) |
41 super().__init__(parent) |
37 self.setupUi(self) |
42 self.setupUi(self) |
38 |
43 |
39 self.vcs = vcs |
44 self.vcs = vcs |
40 self.process = QProcess() |
45 self.process = QProcess() |
41 self.process.finished.connect(self.__procFinished) |
46 self.process.finished.connect(self.__procFinished) |
42 self.process.readyReadStandardOutput.connect(self.__readStdout) |
47 self.process.readyReadStandardOutput.connect(self.__readStdout) |
43 self.process.readyReadStandardError.connect(self.__readStderr) |
48 self.process.readyReadStandardError.connect(self.__readStderr) |
44 |
49 |
45 self.refreshButton = self.buttonBox.addButton( |
50 self.refreshButton = self.buttonBox.addButton( |
46 self.tr("Refresh"), QDialogButtonBox.ButtonRole.ActionRole) |
51 self.tr("Refresh"), QDialogButtonBox.ButtonRole.ActionRole |
|
52 ) |
47 self.refreshButton.setToolTip( |
53 self.refreshButton.setToolTip( |
48 self.tr("Press to refresh the repositories display")) |
54 self.tr("Press to refresh the repositories display") |
|
55 ) |
49 self.refreshButton.setEnabled(False) |
56 self.refreshButton.setEnabled(False) |
50 self.buttonBox.button( |
57 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled(False) |
51 QDialogButtonBox.StandardButton.Close).setEnabled(False) |
58 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setDefault(True) |
52 self.buttonBox.button( |
59 |
53 QDialogButtonBox.StandardButton.Cancel).setDefault(True) |
|
54 |
|
55 self.__lastColumn = self.repolist.columnCount() |
60 self.__lastColumn = self.repolist.columnCount() |
56 |
61 |
57 self.repolist.headerItem().setText(self.__lastColumn, "") |
62 self.repolist.headerItem().setText(self.__lastColumn, "") |
58 self.repolist.header().setSortIndicator(0, Qt.SortOrder.AscendingOrder) |
63 self.repolist.header().setSortIndicator(0, Qt.SortOrder.AscendingOrder) |
59 |
64 |
60 self.__ioEncoding = Preferences.getSystem("IOEncoding") |
65 self.__ioEncoding = Preferences.getSystem("IOEncoding") |
61 |
66 |
62 def __resort(self): |
67 def __resort(self): |
63 """ |
68 """ |
64 Private method to resort the list. |
69 Private method to resort the list. |
65 """ |
70 """ |
66 self.repolist.sortItems( |
71 self.repolist.sortItems( |
67 self.repolist.sortColumn(), |
72 self.repolist.sortColumn(), self.repolist.header().sortIndicatorOrder() |
68 self.repolist.header().sortIndicatorOrder()) |
73 ) |
69 |
74 |
70 def __resizeColumns(self): |
75 def __resizeColumns(self): |
71 """ |
76 """ |
72 Private method to resize the list columns. |
77 Private method to resize the list columns. |
73 """ |
78 """ |
74 self.repolist.header().resizeSections( |
79 self.repolist.header().resizeSections(QHeaderView.ResizeMode.ResizeToContents) |
75 QHeaderView.ResizeMode.ResizeToContents) |
|
76 self.repolist.header().setStretchLastSection(True) |
80 self.repolist.header().setStretchLastSection(True) |
77 |
81 |
78 def __generateItem(self, name, url, oper): |
82 def __generateItem(self, name, url, oper): |
79 """ |
83 """ |
80 Private method to generate a status item in the status list. |
84 Private method to generate a status item in the status list. |
81 |
85 |
82 @param name name of the remote repository (string) |
86 @param name name of the remote repository (string) |
83 @param url URL of the remote repository (string) |
87 @param url URL of the remote repository (string) |
84 @param oper operation the remote repository may be used for (string) |
88 @param oper operation the remote repository may be used for (string) |
85 """ |
89 """ |
86 foundItems = self.repolist.findItems( |
90 foundItems = self.repolist.findItems(name, Qt.MatchFlag.MatchExactly, 0) |
87 name, Qt.MatchFlag.MatchExactly, 0) |
|
88 if foundItems: |
91 if foundItems: |
89 # modify the operations column only |
92 # modify the operations column only |
90 foundItems[0].setText( |
93 foundItems[0].setText(2, "{0} + {1}".format(foundItems[0].text(2), oper)) |
91 2, "{0} + {1}".format(foundItems[0].text(2), oper)) |
|
92 else: |
94 else: |
93 QTreeWidgetItem(self.repolist, [name, url, oper]) |
95 QTreeWidgetItem(self.repolist, [name, url, oper]) |
94 |
96 |
95 def closeEvent(self, e): |
97 def closeEvent(self, e): |
96 """ |
98 """ |
97 Protected slot implementing a close event handler. |
99 Protected slot implementing a close event handler. |
98 |
100 |
99 @param e close event (QCloseEvent) |
101 @param e close event (QCloseEvent) |
100 """ |
102 """ |
101 if ( |
103 if ( |
102 self.process is not None and |
104 self.process is not None |
103 self.process.state() != QProcess.ProcessState.NotRunning |
105 and self.process.state() != QProcess.ProcessState.NotRunning |
104 ): |
106 ): |
105 self.process.terminate() |
107 self.process.terminate() |
106 QTimer.singleShot(2000, self.process.kill) |
108 QTimer.singleShot(2000, self.process.kill) |
107 self.process.waitForFinished(3000) |
109 self.process.waitForFinished(3000) |
108 |
110 |
109 e.accept() |
111 e.accept() |
110 |
112 |
111 def start(self, projectDir): |
113 def start(self, projectDir): |
112 """ |
114 """ |
113 Public slot to start the git remote command. |
115 Public slot to start the git remote command. |
114 |
116 |
115 @param projectDir name of the project directory (string) |
117 @param projectDir name of the project directory (string) |
116 """ |
118 """ |
117 self.repolist.clear() |
119 self.repolist.clear() |
118 |
120 |
119 self.errorGroup.hide() |
121 self.errorGroup.hide() |
120 self.intercept = False |
122 self.intercept = False |
121 self.projectDir = projectDir |
123 self.projectDir = projectDir |
122 |
124 |
123 self.__ioEncoding = Preferences.getSystem("IOEncoding") |
125 self.__ioEncoding = Preferences.getSystem("IOEncoding") |
124 |
126 |
125 self.removeButton.setEnabled(False) |
127 self.removeButton.setEnabled(False) |
126 self.renameButton.setEnabled(False) |
128 self.renameButton.setEnabled(False) |
127 self.pruneButton.setEnabled(False) |
129 self.pruneButton.setEnabled(False) |
128 self.showInfoButton.setEnabled(False) |
130 self.showInfoButton.setEnabled(False) |
129 |
131 |
130 args = self.vcs.initCommand("remote") |
132 args = self.vcs.initCommand("remote") |
131 args.append('--verbose') |
133 args.append("--verbose") |
132 |
134 |
133 # find the root of the repo |
135 # find the root of the repo |
134 repodir = self.projectDir |
136 repodir = self.projectDir |
135 while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)): |
137 while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)): |
136 repodir = os.path.dirname(repodir) |
138 repodir = os.path.dirname(repodir) |
137 if os.path.splitdrive(repodir)[1] == os.sep: |
139 if os.path.splitdrive(repodir)[1] == os.sep: |
138 return |
140 return |
139 |
141 |
140 self.process.kill() |
142 self.process.kill() |
141 self.process.setWorkingDirectory(repodir) |
143 self.process.setWorkingDirectory(repodir) |
142 |
144 |
143 self.process.start('git', args) |
145 self.process.start("git", args) |
144 procStarted = self.process.waitForStarted(5000) |
146 procStarted = self.process.waitForStarted(5000) |
145 if not procStarted: |
147 if not procStarted: |
146 self.inputGroup.setEnabled(False) |
148 self.inputGroup.setEnabled(False) |
147 self.inputGroup.hide() |
149 self.inputGroup.hide() |
148 EricMessageBox.critical( |
150 EricMessageBox.critical( |
149 self, |
151 self, |
150 self.tr('Process Generation Error'), |
152 self.tr("Process Generation Error"), |
151 self.tr( |
153 self.tr( |
152 'The process {0} could not be started. ' |
154 "The process {0} could not be started. " |
153 'Ensure, that it is in the search path.' |
155 "Ensure, that it is in the search path." |
154 ).format('git')) |
156 ).format("git"), |
|
157 ) |
155 else: |
158 else: |
156 self.buttonBox.button( |
159 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled( |
157 QDialogButtonBox.StandardButton.Close).setEnabled(False) |
160 False |
158 self.buttonBox.button( |
161 ) |
159 QDialogButtonBox.StandardButton.Cancel).setEnabled(True) |
162 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setEnabled( |
160 self.buttonBox.button( |
163 True |
161 QDialogButtonBox.StandardButton.Cancel).setDefault(True) |
164 ) |
162 |
165 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setDefault( |
|
166 True |
|
167 ) |
|
168 |
163 self.inputGroup.setEnabled(True) |
169 self.inputGroup.setEnabled(True) |
164 self.inputGroup.show() |
170 self.inputGroup.show() |
165 self.refreshButton.setEnabled(False) |
171 self.refreshButton.setEnabled(False) |
166 |
172 |
167 def __finish(self): |
173 def __finish(self): |
168 """ |
174 """ |
169 Private slot called when the process finished or the user pressed |
175 Private slot called when the process finished or the user pressed |
170 the button. |
176 the button. |
171 """ |
177 """ |
172 if ( |
178 if ( |
173 self.process is not None and |
179 self.process is not None |
174 self.process.state() != QProcess.ProcessState.NotRunning |
180 and self.process.state() != QProcess.ProcessState.NotRunning |
175 ): |
181 ): |
176 self.process.terminate() |
182 self.process.terminate() |
177 QTimer.singleShot(2000, self.process.kill) |
183 QTimer.singleShot(2000, self.process.kill) |
178 self.process.waitForFinished(3000) |
184 self.process.waitForFinished(3000) |
179 |
185 |
180 self.inputGroup.setEnabled(False) |
186 self.inputGroup.setEnabled(False) |
181 self.inputGroup.hide() |
187 self.inputGroup.hide() |
182 self.refreshButton.setEnabled(True) |
188 self.refreshButton.setEnabled(True) |
183 |
189 |
184 self.buttonBox.button( |
190 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled(True) |
185 QDialogButtonBox.StandardButton.Close).setEnabled(True) |
191 self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setEnabled(False) |
186 self.buttonBox.button( |
192 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setDefault(True) |
187 QDialogButtonBox.StandardButton.Cancel).setEnabled(False) |
193 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setFocus( |
188 self.buttonBox.button( |
194 Qt.FocusReason.OtherFocusReason |
189 QDialogButtonBox.StandardButton.Close).setDefault(True) |
195 ) |
190 self.buttonBox.button( |
196 |
191 QDialogButtonBox.StandardButton.Close).setFocus( |
|
192 Qt.FocusReason.OtherFocusReason) |
|
193 |
|
194 self.__resort() |
197 self.__resort() |
195 self.__resizeColumns() |
198 self.__resizeColumns() |
196 |
199 |
197 self.__updateButtons() |
200 self.__updateButtons() |
198 |
201 |
199 def on_buttonBox_clicked(self, button): |
202 def on_buttonBox_clicked(self, button): |
200 """ |
203 """ |
201 Private slot called by a button of the button box clicked. |
204 Private slot called by a button of the button box clicked. |
202 |
205 |
203 @param button button that was clicked (QAbstractButton) |
206 @param button button that was clicked (QAbstractButton) |
204 """ |
207 """ |
205 if button == self.buttonBox.button( |
208 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close): |
206 QDialogButtonBox.StandardButton.Close |
|
207 ): |
|
208 self.close() |
209 self.close() |
209 elif button == self.buttonBox.button( |
210 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): |
210 QDialogButtonBox.StandardButton.Cancel |
|
211 ): |
|
212 self.__finish() |
211 self.__finish() |
213 elif button == self.refreshButton: |
212 elif button == self.refreshButton: |
214 self.on_refreshButton_clicked() |
213 self.on_refreshButton_clicked() |
215 |
214 |
216 def __procFinished(self, exitCode, exitStatus): |
215 def __procFinished(self, exitCode, exitStatus): |
217 """ |
216 """ |
218 Private slot connected to the finished signal. |
217 Private slot connected to the finished signal. |
219 |
218 |
220 @param exitCode exit code of the process (integer) |
219 @param exitCode exit code of the process (integer) |
221 @param exitStatus exit status of the process (QProcess.ExitStatus) |
220 @param exitStatus exit status of the process (QProcess.ExitStatus) |
222 """ |
221 """ |
223 self.__finish() |
222 self.__finish() |
224 |
223 |
225 def __readStdout(self): |
224 def __readStdout(self): |
226 """ |
225 """ |
227 Private slot to handle the readyReadStandardOutput signal. |
226 Private slot to handle the readyReadStandardOutput signal. |
228 |
227 |
229 It reads the output of the process, formats it and inserts it into |
228 It reads the output of the process, formats it and inserts it into |
230 the contents pane. |
229 the contents pane. |
231 """ |
230 """ |
232 if self.process is not None: |
231 if self.process is not None: |
233 self.process.setReadChannel(QProcess.ProcessChannel.StandardOutput) |
232 self.process.setReadChannel(QProcess.ProcessChannel.StandardOutput) |
234 |
233 |
235 while self.process.canReadLine(): |
234 while self.process.canReadLine(): |
236 line = str(self.process.readLine(), self.__ioEncoding, |
235 line = str( |
237 'replace').strip() |
236 self.process.readLine(), self.__ioEncoding, "replace" |
238 |
237 ).strip() |
|
238 |
239 name, line = line.split(None, 1) |
239 name, line = line.split(None, 1) |
240 url, oper = line.rsplit(None, 1) |
240 url, oper = line.rsplit(None, 1) |
241 oper = oper[1:-1] # it is enclosed in () |
241 oper = oper[1:-1] # it is enclosed in () |
242 self.__generateItem(name, url, oper) |
242 self.__generateItem(name, url, oper) |
243 |
243 |
244 def __readStderr(self): |
244 def __readStderr(self): |
245 """ |
245 """ |
246 Private slot to handle the readyReadStandardError signal. |
246 Private slot to handle the readyReadStandardError signal. |
247 |
247 |
248 It reads the error output of the process and inserts it into the |
248 It reads the error output of the process and inserts it into the |
249 error pane. |
249 error pane. |
250 """ |
250 """ |
251 if self.process is not None: |
251 if self.process is not None: |
252 s = str(self.process.readAllStandardError(), |
252 s = str(self.process.readAllStandardError(), self.__ioEncoding, "replace") |
253 self.__ioEncoding, 'replace') |
|
254 self.errorGroup.show() |
253 self.errorGroup.show() |
255 self.errors.insertPlainText(s) |
254 self.errors.insertPlainText(s) |
256 self.errors.ensureCursorVisible() |
255 self.errors.ensureCursorVisible() |
257 |
256 |
258 def on_passwordCheckBox_toggled(self, isOn): |
257 def on_passwordCheckBox_toggled(self, isOn): |
259 """ |
258 """ |
260 Private slot to handle the password checkbox toggled. |
259 Private slot to handle the password checkbox toggled. |
261 |
260 |
262 @param isOn flag indicating the status of the check box (boolean) |
261 @param isOn flag indicating the status of the check box (boolean) |
263 """ |
262 """ |
264 if isOn: |
263 if isOn: |
265 self.input.setEchoMode(QLineEdit.EchoMode.Password) |
264 self.input.setEchoMode(QLineEdit.EchoMode.Password) |
266 else: |
265 else: |
267 self.input.setEchoMode(QLineEdit.EchoMode.Normal) |
266 self.input.setEchoMode(QLineEdit.EchoMode.Normal) |
268 |
267 |
269 @pyqtSlot() |
268 @pyqtSlot() |
270 def on_sendButton_clicked(self): |
269 def on_sendButton_clicked(self): |
271 """ |
270 """ |
272 Private slot to send the input to the git process. |
271 Private slot to send the input to the git process. |
273 """ |
272 """ |
274 inputTxt = self.input.text() |
273 inputTxt = self.input.text() |
275 inputTxt += os.linesep |
274 inputTxt += os.linesep |
276 |
275 |
277 if self.passwordCheckBox.isChecked(): |
276 if self.passwordCheckBox.isChecked(): |
278 self.errors.insertPlainText(os.linesep) |
277 self.errors.insertPlainText(os.linesep) |
279 self.errors.ensureCursorVisible() |
278 self.errors.ensureCursorVisible() |
280 else: |
279 else: |
281 self.errors.insertPlainText(inputTxt) |
280 self.errors.insertPlainText(inputTxt) |
282 self.errors.ensureCursorVisible() |
281 self.errors.ensureCursorVisible() |
283 |
282 |
284 self.process.write(strToQByteArray(inputTxt)) |
283 self.process.write(strToQByteArray(inputTxt)) |
285 |
284 |
286 self.passwordCheckBox.setChecked(False) |
285 self.passwordCheckBox.setChecked(False) |
287 self.input.clear() |
286 self.input.clear() |
288 |
287 |
289 def on_input_returnPressed(self): |
288 def on_input_returnPressed(self): |
290 """ |
289 """ |
291 Private slot to handle the press of the return key in the input field. |
290 Private slot to handle the press of the return key in the input field. |
292 """ |
291 """ |
293 self.intercept = True |
292 self.intercept = True |
294 self.on_sendButton_clicked() |
293 self.on_sendButton_clicked() |
295 |
294 |
296 def keyPressEvent(self, evt): |
295 def keyPressEvent(self, evt): |
297 """ |
296 """ |
298 Protected slot to handle a key press event. |
297 Protected slot to handle a key press event. |
299 |
298 |
300 @param evt the key press event (QKeyEvent) |
299 @param evt the key press event (QKeyEvent) |
301 """ |
300 """ |
302 if self.intercept: |
301 if self.intercept: |
303 self.intercept = False |
302 self.intercept = False |
304 evt.accept() |
303 evt.accept() |
305 return |
304 return |
306 super().keyPressEvent(evt) |
305 super().keyPressEvent(evt) |
307 |
306 |
308 @pyqtSlot() |
307 @pyqtSlot() |
309 def on_refreshButton_clicked(self): |
308 def on_refreshButton_clicked(self): |
310 """ |
309 """ |
311 Private slot to refresh the status display. |
310 Private slot to refresh the status display. |
312 """ |
311 """ |
313 self.start(self.projectDir) |
312 self.start(self.projectDir) |
314 |
313 |
315 def __updateButtons(self): |
314 def __updateButtons(self): |
316 """ |
315 """ |
317 Private method to update the buttons status. |
316 Private method to update the buttons status. |
318 """ |
317 """ |
319 enable = len(self.repolist.selectedItems()) == 1 |
318 enable = len(self.repolist.selectedItems()) == 1 |
320 |
319 |
321 self.removeButton.setEnabled(enable) |
320 self.removeButton.setEnabled(enable) |
322 self.pruneButton.setEnabled(enable) |
321 self.pruneButton.setEnabled(enable) |
323 self.showInfoButton.setEnabled(enable) |
322 self.showInfoButton.setEnabled(enable) |
324 self.renameButton.setEnabled(enable) |
323 self.renameButton.setEnabled(enable) |
325 self.changeUrlButton.setEnabled(enable) |
324 self.changeUrlButton.setEnabled(enable) |
326 self.credentialsButton.setEnabled(enable) |
325 self.credentialsButton.setEnabled(enable) |
327 |
326 |
328 @pyqtSlot() |
327 @pyqtSlot() |
329 def on_repolist_itemSelectionChanged(self): |
328 def on_repolist_itemSelectionChanged(self): |
330 """ |
329 """ |
331 Private slot to act upon changes of selected items. |
330 Private slot to act upon changes of selected items. |
332 """ |
331 """ |
333 self.__updateButtons() |
332 self.__updateButtons() |
334 |
333 |
335 @pyqtSlot() |
334 @pyqtSlot() |
336 def on_addButton_clicked(self): |
335 def on_addButton_clicked(self): |
337 """ |
336 """ |
338 Private slot to add a remote repository. |
337 Private slot to add a remote repository. |
339 """ |
338 """ |
340 self.vcs.gitAddRemote(self.projectDir) |
339 self.vcs.gitAddRemote(self.projectDir) |
341 self.on_refreshButton_clicked() |
340 self.on_refreshButton_clicked() |
342 |
341 |
343 @pyqtSlot() |
342 @pyqtSlot() |
344 def on_removeButton_clicked(self): |
343 def on_removeButton_clicked(self): |
345 """ |
344 """ |
346 Private slot to remove a remote repository. |
345 Private slot to remove a remote repository. |
347 """ |
346 """ |
348 remoteName = self.repolist.selectedItems()[0].text(0) |
347 remoteName = self.repolist.selectedItems()[0].text(0) |
349 self.vcs.gitRemoveRemote(self.projectDir, remoteName) |
348 self.vcs.gitRemoveRemote(self.projectDir, remoteName) |
350 self.on_refreshButton_clicked() |
349 self.on_refreshButton_clicked() |
351 |
350 |
352 @pyqtSlot() |
351 @pyqtSlot() |
353 def on_showInfoButton_clicked(self): |
352 def on_showInfoButton_clicked(self): |
354 """ |
353 """ |
355 Private slot to show information about a remote repository. |
354 Private slot to show information about a remote repository. |
356 """ |
355 """ |
357 remoteName = self.repolist.selectedItems()[0].text(0) |
356 remoteName = self.repolist.selectedItems()[0].text(0) |
358 self.vcs.gitShowRemote(self.projectDir, remoteName) |
357 self.vcs.gitShowRemote(self.projectDir, remoteName) |
359 |
358 |
360 @pyqtSlot() |
359 @pyqtSlot() |
361 def on_pruneButton_clicked(self): |
360 def on_pruneButton_clicked(self): |
362 """ |
361 """ |
363 Private slot to prune all stale remote-tracking branches. |
362 Private slot to prune all stale remote-tracking branches. |
364 """ |
363 """ |
365 remoteName = self.repolist.selectedItems()[0].text(0) |
364 remoteName = self.repolist.selectedItems()[0].text(0) |
366 self.vcs.gitPruneRemote(self.projectDir, remoteName) |
365 self.vcs.gitPruneRemote(self.projectDir, remoteName) |
367 |
366 |
368 @pyqtSlot() |
367 @pyqtSlot() |
369 def on_renameButton_clicked(self): |
368 def on_renameButton_clicked(self): |
370 """ |
369 """ |
371 Private slot to rename a remote repository. |
370 Private slot to rename a remote repository. |
372 """ |
371 """ |
373 remoteName = self.repolist.selectedItems()[0].text(0) |
372 remoteName = self.repolist.selectedItems()[0].text(0) |
374 self.vcs.gitRenameRemote(self.projectDir, remoteName) |
373 self.vcs.gitRenameRemote(self.projectDir, remoteName) |
375 self.on_refreshButton_clicked() |
374 self.on_refreshButton_clicked() |
376 |
375 |
377 @pyqtSlot() |
376 @pyqtSlot() |
378 def on_changeUrlButton_clicked(self): |
377 def on_changeUrlButton_clicked(self): |
379 """ |
378 """ |
380 Private slot to change the URL of a remote repository. |
379 Private slot to change the URL of a remote repository. |
381 """ |
380 """ |
382 repositoryItem = self.repolist.selectedItems()[0] |
381 repositoryItem = self.repolist.selectedItems()[0] |
383 remoteName = repositoryItem.text(0) |
382 remoteName = repositoryItem.text(0) |
384 remoteUrl = repositoryItem.text(1) |
383 remoteUrl = repositoryItem.text(1) |
385 self.vcs.gitChangeRemoteUrl(self.projectDir, remoteName, remoteUrl) |
384 self.vcs.gitChangeRemoteUrl(self.projectDir, remoteName, remoteUrl) |
386 self.on_refreshButton_clicked() |
385 self.on_refreshButton_clicked() |
387 |
386 |
388 @pyqtSlot() |
387 @pyqtSlot() |
389 def on_credentialsButton_clicked(self): |
388 def on_credentialsButton_clicked(self): |
390 """ |
389 """ |
391 Private slot to change the credentials of a remote repository. |
390 Private slot to change the credentials of a remote repository. |
392 """ |
391 """ |
393 repositoryItem = self.repolist.selectedItems()[0] |
392 repositoryItem = self.repolist.selectedItems()[0] |
394 remoteName = repositoryItem.text(0) |
393 remoteName = repositoryItem.text(0) |
395 remoteUrl = repositoryItem.text(1) |
394 remoteUrl = repositoryItem.text(1) |
396 self.vcs.gitChangeRemoteCredentials(self.projectDir, remoteName, |
395 self.vcs.gitChangeRemoteCredentials(self.projectDir, remoteName, remoteUrl) |
397 remoteUrl) |
396 self.on_refreshButton_clicked() |
398 self.on_refreshButton_clicked() |
|