From c0be3d15dc9e59d862d2cc3e7ba9417a2d78e125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20I=C3=B1iguez=20Goia?= Date: Mon, 6 Jan 2025 20:22:49 +0100 Subject: [PATCH] ui: fixed closing the GUI with a popup active --- ui/opensnitch/dialogs/prompt/__init__.py | 8 +++++++- ui/opensnitch/service.py | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/opensnitch/dialogs/prompt/__init__.py b/ui/opensnitch/dialogs/prompt/__init__.py index ff17effc..37f1d0f4 100644 --- a/ui/opensnitch/dialogs/prompt/__init__.py +++ b/ui/opensnitch/dialogs/prompt/__init__.py @@ -210,7 +210,8 @@ class PromptDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]): else: self.actionButton.setText(self._action_text[action_idx]) self.actionButton.setIcon(self._action_icon[action_idx]) - self._tick_thread.stop = True + if self._tick_thread != None: + self._tick_thread.stop = True def _check_advanced_toggled(self, state): self.checkDstIP.setVisible(state) @@ -496,6 +497,11 @@ class PromptDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]): self._send_rule() e.ignore() + def close(self): + self._stop_countdown() + self._done.set() + self.hide() + def _add_fixed_options_to_combo(self, combo, con, uid): # the order of these combobox entries must match those in the preferences dialog # prefs -> UI -> Default target diff --git a/ui/opensnitch/service.py b/ui/opensnitch/service.py index ac15478d..da184fcd 100644 --- a/ui/opensnitch/service.py +++ b/ui/opensnitch/service.py @@ -292,6 +292,7 @@ class UIService(ui_pb2_grpc.UIServicer, QtWidgets.QGraphicsObject): def _on_close(self): self._exit = True self._tray.setIcon(self.off_icon) + self._prompt_dialog.close() self._app.processEvents() self._nodes.stop_notifications() self._nodes.update_all(Nodes.OFFLINE)