lastSetup support in question frontends
[lilass.git] / screen.py
index 456c0bdcd6b9eb08e716dd74b3cf7b54f45ea4db..21774df08bd91cc96e9093ff3f9c05dcc01fa006 100644 (file)
--- a/screen.py
+++ b/screen.py
@@ -47,6 +47,8 @@ class RelativeScreenPosition(Enum):
         cls = self.__class__
         self._value_ = len(cls.__members__) + 1
         self.text = text
         cls = self.__class__
         self._value_ = len(cls.__members__) + 1
         self.text = text
+    def __str__(self):
+        return self.text
 
 class Resolution:
     '''Represents a resolution of a screen'''
 
 class Resolution:
     '''Represents a resolution of a screen'''
@@ -134,6 +136,13 @@ class ScreenSetup:
                 RelativeScreenPosition.MIRROR: '--same-as',
             }[self.relPosition], intName]
         return args
                 RelativeScreenPosition.MIRROR: '--same-as',
             }[self.relPosition], intName]
         return args
+    
+    def __str__(self):
+        if self.intResolution is None:
+            return "External display only, at "+str(self.extResolution)
+        if self.extResolution is None:
+            return "Internal display only, at "+str(self.intResolution)
+        return "External display %s at %s %s internal display %s at %s" % ("(primary)" if self.extIsPrimary else "", str(self.extResolution), str(self.relPosition), "" if self.extIsPrimary else "(primary)", str(self.intResolution))
 
 class Connector:
     def __init__(self, name=None):
 
 class Connector:
     def __init__(self, name=None):