class QuestionFrontend:
def userChoose (self, title, choices, returns, fallback):
raise Exception("The abstract method 'userChoose' has not been implemented by %s"%str(self.__class__))
+
def selectResolution(self, displayname, availablemodes):
modedescs = list(map(str, availablemodes))
return self.userChoose("Select resolution for %s"%displayname, modedescs, availablemodes, None)
+
def setup (self, situation):
+ 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
+ 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)