78 @param e close event (QCloseEvent) |
78 @param e close event (QCloseEvent) |
79 """ |
79 """ |
80 if self.process is not None and \ |
80 if self.process is not None and \ |
81 self.process.state() != QProcess.NotRunning: |
81 self.process.state() != QProcess.NotRunning: |
82 self.process.terminate() |
82 self.process.terminate() |
83 QTimer.singleShot(2000, self.process, SLOT('kill()')) |
83 QTimer.singleShot(2000, self.process.kill) |
84 self.process.waitForFinished(3000) |
84 self.process.waitForFinished(3000) |
85 |
85 |
86 e.accept() |
86 e.accept() |
87 |
87 |
88 def start(self, fn, recursive = False): |
88 def start(self, fn, recursive = False): |
126 Private slot called when the process finished or the user pressed the button. |
126 Private slot called when the process finished or the user pressed the button. |
127 """ |
127 """ |
128 if self.process is not None and \ |
128 if self.process is not None and \ |
129 self.process.state() != QProcess.NotRunning: |
129 self.process.state() != QProcess.NotRunning: |
130 self.process.terminate() |
130 self.process.terminate() |
131 QTimer.singleShot(2000, self.process, SLOT('kill()')) |
131 QTimer.singleShot(2000, self.process.kill) |
132 self.process.waitForFinished(3000) |
132 self.process.waitForFinished(3000) |
133 |
133 |
134 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
134 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
135 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
135 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
136 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
136 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |