87 def __cancel(self): |
87 def __cancel(self): |
88 """ |
88 """ |
89 Private slot to cancel the current action. |
89 Private slot to cancel the current action. |
90 """ |
90 """ |
91 self.__processQueue = [] |
91 self.__processQueue = [] |
92 |
92 self.__finish() |
93 if ( |
|
94 self.proc is not None and |
|
95 self.proc.state() != QProcess.NotRunning |
|
96 ): |
|
97 self.proc.terminate() |
|
98 QTimer.singleShot(2000, self.proc.kill) |
|
99 self.proc.waitForFinished(3000) |
|
100 |
|
101 self.proc = None |
|
102 |
|
103 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
|
104 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
|
105 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
|
106 self.buttonBox.button(QDialogButtonBox.Close).setFocus( |
|
107 Qt.OtherFocusReason) |
|
108 |
93 |
109 @pyqtSlot(QAbstractButton) |
94 @pyqtSlot(QAbstractButton) |
110 def on_buttonBox_clicked(self, button): |
95 def on_buttonBox_clicked(self, button): |
111 """ |
96 """ |
112 Private slot called by a button of the button box clicked. |
97 Private slot called by a button of the button box clicked. |