11 |
11 |
12 import os |
12 import os |
13 |
13 |
14 from PyQt5.QtCore import pyqtSlot, Qt, QProcess, QTimer, QSize |
14 from PyQt5.QtCore import pyqtSlot, Qt, QProcess, QTimer, QSize |
15 from PyQt5.QtGui import QTextCursor |
15 from PyQt5.QtGui import QTextCursor |
16 from PyQt5.QtWidgets import QWidget, QDialogButtonBox, QMenu, QHeaderView, \ |
16 from PyQt5.QtWidgets import ( |
17 QTreeWidgetItem, QLineEdit |
17 QWidget, QDialogButtonBox, QMenu, QHeaderView, QTreeWidgetItem, QLineEdit |
|
18 ) |
18 |
19 |
19 from E5Gui.E5Application import e5App |
20 from E5Gui.E5Application import e5App |
20 from E5Gui import E5MessageBox |
21 from E5Gui import E5MessageBox |
21 |
22 |
22 from .Ui_HgStatusDialog import Ui_HgStatusDialog |
23 from .Ui_HgStatusDialog import Ui_HgStatusDialog |
213 """ |
214 """ |
214 if self.__hgClient: |
215 if self.__hgClient: |
215 if self.__hgClient.isExecuting(): |
216 if self.__hgClient.isExecuting(): |
216 self.__hgClient.cancel() |
217 self.__hgClient.cancel() |
217 else: |
218 else: |
218 if self.process is not None and \ |
219 if ( |
219 self.process.state() != QProcess.NotRunning: |
220 self.process is not None and |
|
221 self.process.state() != QProcess.NotRunning |
|
222 ): |
220 self.process.terminate() |
223 self.process.terminate() |
221 QTimer.singleShot(2000, self.process.kill) |
224 QTimer.singleShot(2000, self.process.kill) |
222 self.process.waitForFinished(3000) |
225 self.process.waitForFinished(3000) |
223 |
226 |
224 if self.__mq: |
227 if self.__mq: |
392 def __finish(self): |
395 def __finish(self): |
393 """ |
396 """ |
394 Private slot called when the process finished or the user pressed |
397 Private slot called when the process finished or the user pressed |
395 the button. |
398 the button. |
396 """ |
399 """ |
397 if self.process is not None and \ |
400 if ( |
398 self.process.state() != QProcess.NotRunning: |
401 self.process is not None and |
|
402 self.process.state() != QProcess.NotRunning |
|
403 ): |
399 self.process.terminate() |
404 self.process.terminate() |
400 QTimer.singleShot(2000, self.process.kill) |
405 QTimer.singleShot(2000, self.process.kill) |
401 self.process.waitForFinished(3000) |
406 self.process.waitForFinished(3000) |
402 |
407 |
403 self.inputGroup.setEnabled(False) |
408 self.inputGroup.setEnabled(False) |
850 @return list of all items, the user has checked |
855 @return list of all items, the user has checked |
851 """ |
856 """ |
852 items = [] |
857 items = [] |
853 for index in range(self.statusList.topLevelItemCount()): |
858 for index in range(self.statusList.topLevelItemCount()): |
854 itm = self.statusList.topLevelItem(index) |
859 itm = self.statusList.topLevelItem(index) |
855 if itm.flags() & Qt.ItemIsUserCheckable and \ |
860 if ( |
856 itm.checkState(self.__toBeCommittedColumn) == Qt.Unchecked: |
861 itm.flags() & Qt.ItemIsUserCheckable and |
|
862 itm.checkState(self.__toBeCommittedColumn) == Qt.Unchecked |
|
863 ): |
857 items.append(itm) |
864 items.append(itm) |
858 return items |
865 return items |
859 |
866 |
860 def __getModifiedItems(self): |
867 def __getModifiedItems(self): |
861 """ |
868 """ |