395 itm = QTreeWidgetItem( |
395 itm = QTreeWidgetItem( |
396 self.resultList, [self.tr("No unused code found.")] |
396 self.resultList, [self.tr("No unused code found.")] |
397 ) |
397 ) |
398 itm.setFirstColumnSpanned(True) |
398 itm.setFirstColumnSpanned(True) |
399 |
399 |
|
400 def __cancel(self): |
|
401 """ |
|
402 Private method to cancel the current check run. |
|
403 """ |
|
404 self.cancelled = True |
|
405 if self.__batch: |
|
406 self.vultureService.cancelVultureCheckBatch() |
|
407 QTimer.singleShot(1000, self.__finish) |
|
408 else: |
|
409 self.__finish() |
|
410 |
|
411 def closeEvent(self, evt): |
|
412 """ |
|
413 Protected method to handle a close event. |
|
414 |
|
415 @param evt reference to the close event |
|
416 @type QCloseEvent |
|
417 """ |
|
418 self.__cancel() |
|
419 |
400 @pyqtSlot(QAbstractButton) |
420 @pyqtSlot(QAbstractButton) |
401 def on_buttonBox_clicked(self, button): |
421 def on_buttonBox_clicked(self, button): |
402 """ |
422 """ |
403 Private slot called by a button of the button box clicked. |
423 Private slot called by a button of the button box clicked. |
404 |
424 |
406 @type QAbstractButton |
426 @type QAbstractButton |
407 """ |
427 """ |
408 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close): |
428 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close): |
409 self.close() |
429 self.close() |
410 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): |
430 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): |
411 self.cancelled = True |
431 self.__cancel() |
412 if self.__batch: |
|
413 self.vultureService.cancelVultureCheckBatch() |
|
414 QTimer.singleShot(1000, self.__finish) |
|
415 else: |
|
416 self.__finish() |
|
417 |
432 |
418 @pyqtSlot() |
433 @pyqtSlot() |
419 def on_startButton_clicked(self): |
434 def on_startButton_clicked(self): |
420 """ |
435 """ |
421 Private slot to start a code metrics run. |
436 Private slot to start a code metrics run. |