From 6adc8bd3434dec9bc70c4f8f5adc0e54f990339b Mon Sep 17 00:00:00 2001 From: Constantin Berhard Date: Tue, 24 Nov 2015 13:23:27 +0100 Subject: [PATCH] pre select last used setup in qt gui --- qt_frontend.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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) -- 2.30.2