56 self.refreshButton.setEnabled(False) |
56 self.refreshButton.setEnabled(False) |
57 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
57 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
58 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
58 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
59 |
59 |
60 self.diff = None |
60 self.diff = None |
61 self.process = None |
|
62 self.vcs = vcs |
61 self.vcs = vcs |
63 self.vcs.committed.connect(self.__committed) |
62 self.vcs.committed.connect(self.__committed) |
64 self.__hgClient = self.vcs.getClient() |
63 self.__hgClient = self.vcs.getClient() |
65 self.__mq = mq |
64 self.__mq = mq |
|
65 if self.__hgClient: |
|
66 self.process = None |
|
67 else: |
|
68 self.process = QProcess() |
|
69 self.process.finished.connect(self.__procFinished) |
|
70 self.process.readyReadStandardOutput.connect(self.__readStdout) |
|
71 self.process.readyReadStandardError.connect(self.__readStderr) |
66 |
72 |
67 self.statusList.headerItem().setText(self.__lastColumn, "") |
73 self.statusList.headerItem().setText(self.__lastColumn, "") |
68 self.statusList.header().setSortIndicator( |
74 self.statusList.header().setSortIndicator( |
69 self.__pathColumn, Qt.AscendingOrder) |
75 self.__pathColumn, Qt.AscendingOrder) |
70 |
76 |
247 self.forgetButton.setEnabled(False) |
253 self.forgetButton.setEnabled(False) |
248 self.restoreButton.setEnabled(False) |
254 self.restoreButton.setEnabled(False) |
249 |
255 |
250 self.statusFilterCombo.clear() |
256 self.statusFilterCombo.clear() |
251 self.__statusFilters = [] |
257 self.__statusFilters = [] |
|
258 self.statusList.clear() |
252 |
259 |
253 if self.__mq: |
260 if self.__mq: |
254 self.setWindowTitle( |
261 self.setWindowTitle( |
255 self.tr("Mercurial Queue Repository Status")) |
262 self.tr("Mercurial Queue Repository Status")) |
256 else: |
263 else: |
295 break |
303 break |
296 self.__finish() |
304 self.__finish() |
297 else: |
305 else: |
298 if self.process: |
306 if self.process: |
299 self.process.kill() |
307 self.process.kill() |
300 else: |
|
301 self.process = QProcess() |
|
302 self.process.finished.connect(self.__procFinished) |
|
303 self.process.readyReadStandardOutput.connect(self.__readStdout) |
|
304 self.process.readyReadStandardError.connect(self.__readStderr) |
|
305 |
308 |
306 self.process.setWorkingDirectory(repodir) |
309 self.process.setWorkingDirectory(repodir) |
307 |
310 |
308 self.process.start('hg', args) |
311 self.process.start('hg', args) |
309 procStarted = self.process.waitForStarted(5000) |
312 procStarted = self.process.waitForStarted(5000) |
316 self.tr( |
319 self.tr( |
317 'The process {0} could not be started. ' |
320 'The process {0} could not be started. ' |
318 'Ensure, that it is in the search path.' |
321 'Ensure, that it is in the search path.' |
319 ).format('hg')) |
322 ).format('hg')) |
320 else: |
323 else: |
|
324 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
|
325 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True) |
|
326 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
|
327 |
321 self.inputGroup.setEnabled(True) |
328 self.inputGroup.setEnabled(True) |
322 self.inputGroup.show() |
329 self.inputGroup.show() |
|
330 self.refreshButton.setEnabled(False) |
323 |
331 |
324 def __finish(self): |
332 def __finish(self): |
325 """ |
333 """ |
326 Private slot called when the process finished or the user pressed |
334 Private slot called when the process finished or the user pressed |
327 the button. |
335 the button. |
346 self.__statusFilters.insert(0, "<{0}>".format(self.tr("all"))) |
354 self.__statusFilters.insert(0, "<{0}>".format(self.tr("all"))) |
347 self.statusFilterCombo.addItems(self.__statusFilters) |
355 self.statusFilterCombo.addItems(self.__statusFilters) |
348 |
356 |
349 for act in self.menuactions: |
357 for act in self.menuactions: |
350 act.setEnabled(True) |
358 act.setEnabled(True) |
351 |
|
352 self.process = None |
|
353 |
359 |
354 self.__resort() |
360 self.__resort() |
355 self.__resizeColumns() |
361 self.__resizeColumns() |
356 |
362 |
357 self.__updateButtons() |
363 self.__updateButtons() |
482 @pyqtSlot() |
488 @pyqtSlot() |
483 def on_refreshButton_clicked(self): |
489 def on_refreshButton_clicked(self): |
484 """ |
490 """ |
485 Private slot to refresh the status display. |
491 Private slot to refresh the status display. |
486 """ |
492 """ |
487 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
|
488 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True) |
|
489 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
|
490 |
|
491 self.inputGroup.setEnabled(True) |
|
492 self.inputGroup.show() |
|
493 self.refreshButton.setEnabled(False) |
|
494 |
|
495 self.statusList.clear() |
|
496 |
|
497 self.start(self.args) |
493 self.start(self.args) |
498 |
494 |
499 def __updateButtons(self): |
495 def __updateButtons(self): |
500 """ |
496 """ |
501 Private method to update the VCS buttons status. |
497 Private method to update the VCS buttons status. |