From e25d741f768e47d7a101612e56523357063e2c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20I=C3=B1iguez=20Goia?= Date: Tue, 18 Feb 2025 15:44:51 +0100 Subject: [PATCH] ui: improved compatibility with python3.8 - Do not use placeholdertext with comboboxes. - Do not use removesuffix(). --- ui/opensnitch/dialogs/preferences.py | 8 ++++---- ui/opensnitch/res/preferences.ui | 11 ++++------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/ui/opensnitch/dialogs/preferences.py b/ui/opensnitch/dialogs/preferences.py index 1d949e37..028d6a27 100644 --- a/ui/opensnitch/dialogs/preferences.py +++ b/ui/opensnitch/dialogs/preferences.py @@ -474,15 +474,15 @@ class PreferencesDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]): fwOptions = node_config.get('FwOptions') if fwOptions == None: fwOptions = {} - if fwOptions.get('MonitorInterval') == None: - fwOptions['MonitorInterval'] = "15" + if fwOptions.get('MonitorInterval') == None or fwOptions.get('MonitorInterval') == "": + fwOptions['MonitorInterval'] = "15s" if fwOptions.get('QueueBypass') == None: fwOptions['QueueBypass'] = True node_config['FwOptions'] = fwOptions - monInterval = fwOptions['MonitorInterval'].removesuffix("s") - self.checkNodeBypassQueue.setChecked(fwOptions.get('QueueBypass')) + monInterval = fwOptions['MonitorInterval'][:-1] self.lineNodeFwMonInterval.setText(monInterval) + self.checkNodeBypassQueue.setChecked(fwOptions.get('QueueBypass')) stats = node_config.get('Stats') if stats == None: diff --git a/ui/opensnitch/res/preferences.ui b/ui/opensnitch/res/preferences.ui index 6c376e70..48131fe1 100644 --- a/ui/opensnitch/res/preferences.ui +++ b/ui/opensnitch/res/preferences.ui @@ -826,9 +826,6 @@ wayland - - - @@ -866,8 +863,8 @@ wayland 0 0 - 599 - 323 + 318 + 207 @@ -1120,8 +1117,8 @@ or a network socket: 127.0.0.1:50051 0 0 - 599 - 323 + 321 + 136