Skip to content

Commit

Permalink
skip over a keyfile that didn't have a parameter in the key file
Browse files Browse the repository at this point in the history
  • Loading branch information
teuben committed Sep 29, 2023
1 parent 6fdbe29 commit 56a5b15
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions qtrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,25 @@ def load(self):
widget = element.itemAt(widget_index).widget()

if isinstance(widget, QtWidgets.QLineEdit):
widget.setText(''.join(default_values[widget.objectName()]))
try:
widget.setText(''.join(default_values[widget.objectName()]))
except:
print("Skipping resetting new entry",widget.objectName())

elif isinstance(widget, QtWidgets.QRadioButton) or isinstance(widget, QtWidgets.QCheckBox):
if widget.text() in default_values[widget.objectName()]:
widget.setChecked(True)
try:
if widget.text() in default_values[widget.objectName()]:
widget.setChecked(True)
except:
print("Skipping resetting new button",widget.objectName())

elif isinstance(widget, QtWidgets.QSlider):
multiplier = self.slider_multiplier.pop(0)
widget.setValue(int(float(''.join(default_values[widget.objectName()]))*multiplier))
self.slider_multiplier.append(multiplier)
try:
multiplier = self.slider_multiplier.pop(0)
widget.setValue(int(float(''.join(default_values[widget.objectName()]))*multiplier))
self.slider_multiplier.append(multiplier)
except:
print("Skipping resetting new slider",widget.objectName())

def quit(self):
self.close()
Expand Down

0 comments on commit 56a5b15

Please sign in to comment.