X-Git-Url: https://git.ralfj.de/lilass.git/blobdiff_plain/dae20412c707b571e8c2dd28d067e914052b6279..6adc8bd3434dec9bc70c4f8f5adc0e54f990339b:/qt_frontend.py diff --git a/qt_frontend.py b/qt_frontend.py index 6e41d55..05c33ae 100644 --- a/qt_frontend.py +++ b/qt_frontend.py @@ -42,12 +42,23 @@ try: syncIfMirror(self.intRes, self.extRes) syncIfMirror(self.extRes, self.intRes) - # connect the update function, and make sure we are in a correct state + # connect the update function self.intEnabled.toggled.connect(self.updateEnabledControls) self.extEnabled.toggled.connect(self.updateEnabledControls) self.relPos.currentIndexChanged.connect(self.updateEnabledControls) + + # if situation has a lastSetup, use its values as initial state + if situation.lastSetup: + last = situation.lastSetup + self.intEnabled.setChecked(last.intResolution is not None) + self.extEnabled.setChecked(last.extResolution is not None) + if last.relPosition: + print("YO:",last.relPosition.value-1) + self.relPos.setCurrentIndex(last.relPosition.value-1) + + # make sure we are in a correct state self.updateEnabledControls() - + def getRelativeScreenPosition(self): idx = self.relPos.currentIndex() return self.relPos.itemData(idx)