From: Constantin Berhard Date: Tue, 24 Nov 2015 12:23:27 +0000 (+0100) Subject: pre select last used setup in qt gui X-Git-Url: https://git.ralfj.de/lilass.git/commitdiff_plain/6adc8bd3434dec9bc70c4f8f5adc0e54f990339b?ds=inline pre select last used setup in qt gui --- 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)