ui: improved compatibility with python3.8

- Do not use placeholdertext with comboboxes.
 - Do not use removesuffix().
This commit is contained in:
Gustavo Iñiguez Goia 2025-02-18 15:44:51 +01:00
parent 65d6cccd63
commit e25d741f76
Failed to generate hash of commit
2 changed files with 8 additions and 11 deletions

View file

@ -474,15 +474,15 @@ class PreferencesDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
fwOptions = node_config.get('FwOptions') fwOptions = node_config.get('FwOptions')
if fwOptions == None: if fwOptions == None:
fwOptions = {} fwOptions = {}
if fwOptions.get('MonitorInterval') == None: if fwOptions.get('MonitorInterval') == None or fwOptions.get('MonitorInterval') == "":
fwOptions['MonitorInterval'] = "15" fwOptions['MonitorInterval'] = "15s"
if fwOptions.get('QueueBypass') == None: if fwOptions.get('QueueBypass') == None:
fwOptions['QueueBypass'] = True fwOptions['QueueBypass'] = True
node_config['FwOptions'] = fwOptions node_config['FwOptions'] = fwOptions
monInterval = fwOptions['MonitorInterval'].removesuffix("s") monInterval = fwOptions['MonitorInterval'][:-1]
self.checkNodeBypassQueue.setChecked(fwOptions.get('QueueBypass'))
self.lineNodeFwMonInterval.setText(monInterval) self.lineNodeFwMonInterval.setText(monInterval)
self.checkNodeBypassQueue.setChecked(fwOptions.get('QueueBypass'))
stats = node_config.get('Stats') stats = node_config.get('Stats')
if stats == None: if stats == None:

View file

@ -826,9 +826,6 @@ wayland</string>
<property name="currentText"> <property name="currentText">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="placeholderText">
<string notr="true"/>
</property>
<item> <item>
<property name="text"> <property name="text">
<string/> <string/>
@ -866,8 +863,8 @@ wayland</string>
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>599</width> <width>318</width>
<height>323</height> <height>207</height>
</rect> </rect>
</property> </property>
<attribute name="label"> <attribute name="label">
@ -1120,8 +1117,8 @@ or a network socket: 127.0.0.1:50051</string>
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>599</width> <width>321</width>
<height>323</height> <height>136</height>
</rect> </rect>
</property> </property>
<attribute name="label"> <attribute name="label">