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')
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:

View file

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