--- a/VultureChecker/VultureCheckerDialog.py Sat Dec 31 16:27:41 2022 +0100 +++ b/VultureChecker/VultureCheckerDialog.py Fri May 26 10:45:38 2023 +0200 @@ -397,6 +397,26 @@ ) itm.setFirstColumnSpanned(True) + def __cancel(self): + """ + Private method to cancel the current check run. + """ + self.cancelled = True + if self.__batch: + self.vultureService.cancelVultureCheckBatch() + QTimer.singleShot(1000, self.__finish) + else: + self.__finish() + + def closeEvent(self, evt): + """ + Protected method to handle a close event. + + @param evt reference to the close event + @type QCloseEvent + """ + self.__cancel() + @pyqtSlot(QAbstractButton) def on_buttonBox_clicked(self, button): """ @@ -408,12 +428,7 @@ if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close): self.close() elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): - self.cancelled = True - if self.__batch: - self.vultureService.cancelVultureCheckBatch() - QTimer.singleShot(1000, self.__finish) - else: - self.__finish() + self.__cancel() @pyqtSlot() def on_startButton_clicked(self):