# HG changeset patch # User Dirk Olmes # Date 1411700230 -7200 # Node ID 2e5a12e3598e4e2fab2df4404e3fe0dd66482e65 # Parent 9d7245e4537933faa0ba6d510fee20036db37b4e add a low color mode diff -r 9d7245e45379 -r 2e5a12e3598e RemoteViewer/Connection.py --- a/RemoteViewer/Connection.py Fri Sep 26 04:33:38 2014 +0200 +++ b/RemoteViewer/Connection.py Fri Sep 26 04:57:10 2014 +0200 @@ -1,7 +1,7 @@ from uuid import uuid4 from .Viewer import VncViewer, FreeRdp -KEYS = ['geometry', 'id', 'host', 'title', 'type', 'user'] +KEYS = ['geometry', 'id', 'host', 'lowColor', 'title', 'type', 'user'] def filter_string(func): """decorator function to filter turn empty strings into None""" @@ -28,6 +28,7 @@ self.title = None self.type = 'vnc' self.user = None + self.lowColor = False def __str__(self): return 'connection@{} "{}" of type {} to {} with user {} and geometry {}'.format(self.title, id(self), self.type, self.host, self.user, self.geometry) @@ -56,6 +57,10 @@ """This is a slot that is connected to a signal in the GUI""" self.geometry = geometry + def setLowColor(self, lowColor): + """This is a slot that is connected to a signal in the GUI""" + self.lowColor = lowColor + def displayString(self): if self.title is not None: return self.title diff -r 9d7245e45379 -r 2e5a12e3598e RemoteViewer/ConnectionDialog.py --- a/RemoteViewer/ConnectionDialog.py Fri Sep 26 04:33:38 2014 +0200 +++ b/RemoteViewer/ConnectionDialog.py Fri Sep 26 04:57:10 2014 +0200 @@ -1,3 +1,4 @@ +from PyQt4.QtCore import Qt from PyQt4.QtGui import QDialog from .Connection import Connection from .Ui_ConnectionDialog import Ui_ConnectionDialog @@ -30,6 +31,10 @@ self.ui.hostname.setText(self.connection.host) self.ui.username.setText(self.connection.user) self.ui.geometry.setText(self.connection.geometry) + checkState = Qt.Unchecked + if self.connection.lowColor is True: + checkState = Qt.Checked + self.ui.lowColor.setCheckState(checkState) def __connectWidgetSlots(self): self.ui.title.textChanged.connect(self.connection.setTitle) @@ -37,6 +42,7 @@ self.ui.hostname.textChanged.connect(self.connection.setHost) self.ui.username.textChanged.connect(self.connection.setUser) self.ui.geometry.textChanged.connect(self.connection.setGeometry) + self.ui.lowColor.clicked[bool].connect(self.connection.setLowColor) def accept(self): validationErrors = self.connection.validate() diff -r 9d7245e45379 -r 2e5a12e3598e RemoteViewer/ConnectionDialog.ui --- a/RemoteViewer/ConnectionDialog.ui Fri Sep 26 04:33:38 2014 +0200 +++ b/RemoteViewer/ConnectionDialog.ui Fri Sep 26 04:57:10 2014 +0200 @@ -7,7 +7,7 @@ 0 0 400 - 212 + 233 @@ -93,6 +93,20 @@ + + + + + + + + + + + Low Color: + + + diff -r 9d7245e45379 -r 2e5a12e3598e RemoteViewer/Viewer.py --- a/RemoteViewer/Viewer.py Fri Sep 26 04:33:38 2014 +0200 +++ b/RemoteViewer/Viewer.py Fri Sep 26 04:57:10 2014 +0200 @@ -45,6 +45,9 @@ self.command = ['vncviewer'] self.append('-geometry', self.connection.geometry) self.append('-DesktopSize', self.connection.geometry) + if self.connection.lowColor: + self.command.append('-AutoSelect=0') + self.append('-LowColourLevel', '1') self.command.append(self.connection.host) def append(self, option, value): @@ -59,6 +62,8 @@ self.append('/t:', self.connection.displayString()) self.append('/u:', self.connection.user) self.append('/size:', self.connection.geometry) + if self.connection.lowColor: + self.command.append('/bpp:8') def append(self, option, value): if value is not None: