remove spurious spaces
[lilass.git] / question_frontend.py
index fc9e8c6dd0048f7c585f500d671451843c24e26e..8fe4a7aabce209d1b1102e26364883200873d2b0 100644 (file)
@@ -40,26 +40,26 @@ class QuestionFrontend:
         return self.userChoose("Select resolution for %s"%displayname, modedescs, availablemodes, None)
 
     def setup (self, situation):
         return self.userChoose("Select resolution for %s"%displayname, modedescs, availablemodes, None)
 
     def setup (self, situation):
-        if situation.lastSetup:
-            applyLast = self.userChoose("This display is known. The last setup for it was like this:\n%s.\nApply the last used configuration?" % str(situation.lastSetup), ("Apply last setup", "Enter different setup"), (True,False), None)
-            if applyLast is None:
+        if situation.previousSetup:
+            applyPrevious = self.userChoose("This display is known. The last setup for it was like this:\n%s.\nApply the last used configuration?" % str(situation.previousSetup), ("Apply last setup", "Enter different setup"), (True,False), None)
+            if applyPrevious is None:
                 return None
                 return None
-            if applyLast is True:
-                return situation.lastSetup
-            assert applyLast is False
+            if applyPrevious is True:
+                return situation.previousSetup
+            assert applyPrevious is False
         operationmodes = list(OperationMode)
         operationmodedescs = list(map(lambda x: x.text, operationmodes))
         operationmode = self.userChoose ("Display setup", operationmodedescs, operationmodes, None)
         if operationmode is None:
             return None
         elif operationmode is OperationMode.INTERNAL_ONLY:
         operationmodes = list(OperationMode)
         operationmodedescs = list(map(lambda x: x.text, operationmodes))
         operationmode = self.userChoose ("Display setup", operationmodedescs, operationmodes, None)
         if operationmode is None:
             return None
         elif operationmode is OperationMode.INTERNAL_ONLY:
-            intres = self.selectResolution("the internal screen", situation.internalResolutions())
+            intres = self.selectResolution("the internal screen", situation.internalConnector.getResolutionList())
             if intres is None:
                 return None
             else:
                 return ScreenSetup(intres, None, None, False)
         elif operationmode is OperationMode.EXTERNAL_ONLY:
             if intres is None:
                 return None
             else:
                 return ScreenSetup(intres, None, None, False)
         elif operationmode is OperationMode.EXTERNAL_ONLY:
-            extres = self.selectResolution("the external screen", situation.externalResolutions())
+            extres = self.selectResolution("the external screen", situation.externalConnector.getResolutionList())
             if extres is None:
                 return None
             else:
             if extres is None:
                 return None
             else:
@@ -78,10 +78,10 @@ class QuestionFrontend:
                     return None
                 return ScreenSetup(commonres,commonres,relpos,False)
             # select resolutions independently
                     return None
                 return ScreenSetup(commonres,commonres,relpos,False)
             # select resolutions independently
-            intres = self.selectResolution("the internal screen", situation.internalResolutions())
+            intres = self.selectResolution("the internal screen", situation.internalConnector.getResolutionList())
             if intres is None:
                 return None
             if intres is None:
                 return None
-            extres = self.selectResolution("the external screen", situation.externalResolutions())
+            extres = self.selectResolution("the external screen", situation.externalConnector.getResolutionList())
             if extres is None:
                 return None
             extprim = self.userChoose("Select primary screen", ["Internal screen is primary","External screen is primary"], [False,True], None)
             if extres is None:
                 return None
             extprim = self.userChoose("Select primary screen", ["Internal screen is primary","External screen is primary"], [False,True], None)