- ## resolution selection
- resBox = QtGui.QGroupBox('Screen resolutions', self)
- # external screen
- self.extResLabel = QtGui.QLabel('Resolution of external screen:', resBox)
- self.extResolutions = externalResolutions
- self.extResolutionsBox = QtGui.QComboBox(resBox)
- for res in externalResolutions:
- self.extResolutionsBox.addItem(res2user(res))
- self.extResolutionsBox.setCurrentIndex(0) # select first resolution
- self.extRow = makeLayout(QtGui.QHBoxLayout(), [self.extResLabel, self.extResolutionsBox])
- # internal screen
- self.intResLabel = QtGui.QLabel('Resolution of internal screen:', resBox)
- self.intResolutions = internalResolutions
- self.intResolutionsBox = QtGui.QComboBox(resBox)
- for res in internalResolutions:
- self.intResolutionsBox.addItem(res2user(res))
- self.intResolutionsBox.setCurrentIndex(0) # select first resolution
- self.intRow = makeLayout(QtGui.QHBoxLayout(), [self.intResLabel, self.intResolutionsBox])
- # both screens
- self.mirrorResLabel = QtGui.QLabel('Resolution of both screens:', resBox)
- self.mirrorResolutions = commonResolutions
- self.mirrorResolutionsBox = QtGui.QComboBox(resBox)
- for res in commonResolutions:
- self.mirrorResolutionsBox.addItem(res2user(res))
- self.mirrorResolutionsBox.setCurrentIndex(0) # select first resolution
- self.mirrorRow = makeLayout(QtGui.QHBoxLayout(), [self.mirrorResLabel, self.mirrorResolutionsBox])
- # show them all
- resBox.setLayout(makeLayout(QtGui.QVBoxLayout(), [self.extRow, self.intRow, self.mirrorRow]))