From 8c1da76dff71c9ab620c667322486f1136466b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20I=C3=B1iguez=20Goia?= Date: Wed, 19 Feb 2025 00:04:39 +0100 Subject: [PATCH] ui: avoid restart messages when changing node options When saving the preferences, we check if the user changed the address of the node. Usually the current node address is the same than the one loaded, but some gRPC versions does not report it, so we use "unix:/local" as the address of the node. As this address is different than the one configured, we were displaying unnecessary restart messages to the users. --- ui/opensnitch/dialogs/preferences.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/opensnitch/dialogs/preferences.py b/ui/opensnitch/dialogs/preferences.py index 23bbbb9b..93962b30 100644 --- a/ui/opensnitch/dialogs/preferences.py +++ b/ui/opensnitch/dialogs/preferences.py @@ -929,7 +929,9 @@ class PreferencesDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]): return error # exclude this message if there're more than one node connected - if self.comboNodes.currentText() != self.comboNodeAddress.currentText() or \ + # XXX: unix:/local is a special name for the node, when the gRPC + # does not return the correct address of the node. + if (self.comboNodes.currentText() != "unix:/local" and self.comboNodes.currentText() != self.comboNodeAddress.currentText()) or \ self.comboServerAddr.currentText() != self.comboNodeAddress.currentText(): self._changes_needs_restart = QC.translate("preferences", "Node address changed (update GUI address if needed)")