56 @param e close event (QCloseEvent) |
56 @param e close event (QCloseEvent) |
57 """ |
57 """ |
58 if self.process is not None and \ |
58 if self.process is not None and \ |
59 self.process.state() != QProcess.NotRunning: |
59 self.process.state() != QProcess.NotRunning: |
60 self.process.terminate() |
60 self.process.terminate() |
61 QTimer.singleShot(2000, self.process, SLOT('kill()')) |
61 QTimer.singleShot(2000, self.process.kill) |
62 self.process.waitForFinished(3000) |
62 self.process.waitForFinished(3000) |
63 |
63 |
64 e.accept() |
64 e.accept() |
65 |
65 |
66 def start(self, fn): |
66 def start(self, fn): |
104 Private slot called when the process finished or the user pressed the button. |
104 Private slot called when the process finished or the user pressed the button. |
105 """ |
105 """ |
106 if self.process is not None and \ |
106 if self.process is not None and \ |
107 self.process.state() != QProcess.NotRunning: |
107 self.process.state() != QProcess.NotRunning: |
108 self.process.terminate() |
108 self.process.terminate() |
109 QTimer.singleShot(2000, self.process, SLOT('kill()')) |
109 QTimer.singleShot(2000, self.process.kill) |
110 self.process.waitForFinished(3000) |
110 self.process.waitForFinished(3000) |
111 |
111 |
112 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
112 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
113 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
113 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
114 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
114 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |