def closeEvent(self, event: QCloseEvent): reply = QMessageBox.question(self, 'Message', 'Are you sure you want to quit?', QMessageBox.No | QMessageBox.No) if reply == QMessageBox.No: event.accept() else: event.ignore()
def closeEvent(self, event:QtGui.QCloseEvent): reply = QtWidgets.QMessageBox.question(self, 'Message', 'Are you sure you want to quit, bitch?', QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No, QtWidgets.QMessageBox.No) if reply == QtWidgets.QMessageBox.Yes: event.accept() else: event.ignore()
def closeEvent(self, a0: QtGui.QCloseEvent) -> None: if a0 is not None: # TODO: postpone closing of GUI and keep GUI respponsive while other processes are still running. # while len(ipc.Log.History) > 0: # ipc.Process.main() # Inform controller of close event vxipc.send(PROCESS_CONTROLLER, Signal.shutdown) a0.setAccepted(False)
def closeEvent(self, event: QtGui.QCloseEvent) -> None: reply = QtWidgets.QMessageBox.question( self, '本程序', "是否要退出程序?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No, QtWidgets.QMessageBox.No) if reply == QtWidgets.QMessageBox.Yes: event.accept() super().closeEvent(event) else: event.ignore()
def closeEvent(self, event: QtGui.QCloseEvent): if self._check_for_edit_dialog(): event.ignore() else: if self.edit_mode: data = data_writer.write_game_description( self.game_description) if data != self._last_data: if not self.prompt_unsaved_changes_warning(): return event.ignore() super().closeEvent(event)
def closeEvent(self, a0: QtGui.QCloseEvent) -> None: if self.pb: try: self.pb.stop_signal.emit() except Exception: pass if self.main.converting: sm = QtWidgets.QMessageBox() sm.setText(f"<h2>{t('There is a conversion in process!')}</h2>") sm.addButton(t("Cancel Conversion"), QtWidgets.QMessageBox.RejectRole) sm.addButton(t("Close GUI Only"), QtWidgets.QMessageBox.DestructiveRole) sm.addButton(t("Keep FastFlix Open"), QtWidgets.QMessageBox.AcceptRole) sm.exec_() if sm.clickedButton().text() == "Cancel Conversion": self.app.fastflix.worker_queue.put(["cancel"]) time.sleep(0.5) self.main.close() elif sm.clickedButton().text() == "Close GUI Only": self.main.close(no_cleanup=True) return super(Container, self).closeEvent(a0) else: a0.ignore() return for item in self.app.fastflix.config.work_path.iterdir(): if item.is_dir() and item.stem.startswith("temp_"): shutil.rmtree(item, ignore_errors=True) if item.name.lower().endswith( (".jpg", ".jpeg", ".png", ".gif", ".tiff", ".tif")): item.unlink() shutil.rmtree(self.app.fastflix.config.work_path / "covers", ignore_errors=True) if reusables.win_based: cleanup_windows_notification() self.main.close(from_container=True) super(Container, self).closeEvent(a0)
def closeEvent(self, event: QtGui.QCloseEvent) -> None: patient_dict_container = PatientDictContainer() if patient_dict_container.get("rtss_modified") \ and hasattr(self, "structures_tab"): confirmation_dialog = QMessageBox.information( self, 'Close without saving?', 'The RTSTRUCT file has been modified. Would you like to save ' 'before exiting the program?', QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel) if confirmation_dialog == QMessageBox.Save: self.structures_tab.save_new_rtss_to_fixed_image_set() event.accept() self.cleanup() elif confirmation_dialog == QMessageBox.Discard: event.accept() self.cleanup() else: event.ignore() else: self.cleanup()
def closeEvent(self, event: QtGui.QCloseEvent) -> None: self.sig_window_closed.emit() event.accept()
def closeEvent(self, event: QCloseEvent): event.ignore() self.exit()
def closeEvent(self, event: QtGui.QCloseEvent): res = self.close_msg.exec_() if res == QtWidgets.QMessageBox.Yes: event.accept() else: event.ignore()