(message, allow_continue=False)
| 83 | |
| 84 | |
| 85 | def show_error_popup(message, allow_continue=False): |
| 86 | app = QApplication.instance() or QApplication(sys.argv) |
| 87 | overlay_states = [] |
| 88 | for w in app.topLevelWidgets(): |
| 89 | if w.objectName().startswith("overlay_"): |
| 90 | overlay_states.append((w, w.isVisible())) |
| 91 | w.hide() |
| 92 | if QThread.currentThread() == QCoreApplication.instance().thread(): |
| 93 | result = _show_dialog_direct(message, allow_continue) |
| 94 | else: |
| 95 | manager = _get_manager() |
| 96 | event = threading.Event() |
| 97 | event.result = False |
| 98 | manager.showDialog.emit(message, allow_continue, event) |
| 99 | event.wait() |
| 100 | result = event.result |
| 101 | if result: |
| 102 | for w, was_visible in overlay_states: |
| 103 | if was_visible: |
| 104 | w.show() |
| 105 | if not result: |
| 106 | sys.exit(1) |
| 107 | return True |
no test coverage detected