+ # if situation has a previousSetup, use its values as initial state
+ if situation.previousSetup:
+ p = situation.previousSetup
+ self.intEnabled.setChecked(p.intResolution is not None)
+ self.extEnabled.setChecked(p.extResolution is not None)
+ if p.relPosition:
+ self.relPos.setCurrentIndex(p.relPosition.value - 1)
+ if p.extIsPrimary:
+ self.extPrimary.setChecked(True)
+ else:
+ self.intPrimary.setChecked(True)
+ # Pre-select the previous resolution
+ self._intDefaultRes = p.intResolution
+ self._extDefaultRes = p.extResolution
+ self._mirrorDefaultRes = p.intResolution if p.relPosition == RelativeScreenPosition.MIRROR else None # in case of a mirror, they would be the same anyway
+ else:
+ self._intDefaultRes = situation.internalConnector.getPreferredResolution()
+ self._extDefaultRes = situation.externalConnector.getPreferredResolution()
+ self._mirrorDefaultRes = None
+