from screen import RelativeScreenPosition, ScreenSetup
from PyQt4 import QtCore, QtGui, uic
-relPosNames = {
- RelativeScreenPosition.LEFT: "left of",
- RelativeScreenPosition.RIGHT: "right of",
- RelativeScreenPosition.ABOVE: "above",
- RelativeScreenPosition.BELOW: "below",
- RelativeScreenPosition.MIRROR: "same as",
-}
-
-
class PositionSelection(QtGui.QDialog):
def __init__(self, situation):
# set up main window
# fill relative position box
for pos in RelativeScreenPosition:
- self.relPos.addItem(relPosNames[pos], pos)
+ self.relPos.addItem(pos.text, pos)
# keep resolutions in sync when in mirror mode
def syncIfMirror(source, target):
class RelativeScreenPosition(Enum):
'''Represents the relative position of the external screen to the internal one'''
- LEFT = 0
- RIGHT = 1
- ABOVE = 2
- BELOW = 3
- MIRROR = 4
+ LEFT = ("left of")
+ RIGHT = ("right of")
+ ABOVE = ("above")
+ BELOW = ("below")
+ MIRROR = ("same as")
+ def __init__(self, text):
+ # auto numbering
+ cls = self.__class__
+ self._value_ = len(cls.__members__)
+ self.text = text
class Resolution: