def closeEvent(self, event): """...""" if GuiUtils.question_dialog(self, 'Quit', 'Are you sure to quit wechat tools?'): event.accept() else: event.ignore()
def _delete_filter(self): try: _item = self._filter.currentItem() if GuiUtils.question_dialog(self, 'Filter', 'Delete filter: ' + _item.text()): _item = self._filter.takeItem(self._filter.currentRow()) del _item self._save_filter() except Exception as e: _msg = 'Choose one item before deleting.' print(_msg)