return args
def getExternalArgs(self, intName):
- args = ["--mode", res2xrandr(self.extResolution)]
+ args = ["--mode", res2xrandr(self.extResolution)] # set external screen to desired resolution
if self.extIsPrimary:
args.append('--primary')
if self.relPosition == RelativeScreenPosition.LEFT:
usedExternalConnector = findAvailableConnector(externalConnectors, connectors) # *the* external connector which is actually used
if usedExternalConnector is not None: # there's an external screen connected, we need to ask what to do
# get setup
- dialogue = gui.getDialogue(connectors[internalConnector], connectors[usedExternalConnector])
- setup = dialogue.run()
+ setup = gui.setup(connectors[internalConnector], connectors[usedExternalConnector])
if setup is None: sys.exit(1) # the user canceled
# apply it
connectorArgs[internalConnector] = setup.getInternalArgs()
'''Displays a fatal error to the user'''
QtGui.QMessageBox.critical(None, 'Fatal error', message)
-def getDialogue(internalResolutions, externalResolutions):
- '''Returns a class implementing a function run() which returns a ScreenSetup instance, or None if the user canceled'''
- return PositionSelection(internalResolutions, externalResolutions)
+def setup(internalResolutions, externalResolutions):
+ '''Returns a ScreenSetup instance, or None if the user canceled'''
+ return PositionSelection(internalResolutions, externalResolutions).run()