diff --git a/gitso/trunk/ArgsParser.py b/gitso/trunk/ArgsParser.py index 78b0bb5..e96eca7 100644 --- a/gitso/trunk/ArgsParser.py +++ b/gitso/trunk/ArgsParser.py @@ -41,7 +41,7 @@ class ArgsParser: self.paths['connect'] = '' self.paths['list'] = [] self.paths['mode'] = '' - + self.paths['low-colors'] = False if sys.platform.find('linux') != -1: self.paths['main'] = os.path.join(sys.path[0], '..', 'share', 'gitso') @@ -106,6 +106,9 @@ class ArgsParser: print "Error: '" + sys.argv[i] + "' is not a valid host with '--connect'." self.HelpMenu() + elif sys.argv[i] == '--low-colors': # --low-colors + self.paths['low-colors'] = True; + elif sys.argv[i] == '--list': # --list i = i + 1 if i >= len(sys.argv): @@ -142,6 +145,7 @@ class ArgsParser: print " --listen\t\tListen for incoming connections." print " --connect {IP|DN}\tConnects to host (support giver)." print " --list {URL|FILE}\tAlternative Support list." + print " --low-colors\t\tUse 8bit colors (for slow connections). Linux only." print " --version\t\tThe current Gitso version." print " --help\t\tThis Menu." exit(1) diff --git a/gitso/trunk/ConnectionWindow.py b/gitso/trunk/ConnectionWindow.py index ae703ec..39ba8e4 100644 --- a/gitso/trunk/ConnectionWindow.py +++ b/gitso/trunk/ConnectionWindow.py @@ -40,6 +40,7 @@ class ConnectionWindow(wx.Frame): @author: Derek Buranen @author: Aaron Gerber + @author: Markus Roth """ self.ToggleValue = 0 self.paths = paths @@ -71,10 +72,10 @@ class ConnectionWindow(wx.Frame): self.SetIcon(icon) #Buttons - self.connectButton = wx.Button(self, 10, "Start", wx.Point(xval1, 70)) + self.connectButton = wx.Button(self, 10, "Start", wx.Point(xval1, 81)) self.connectButton.SetDefault() wx.EVT_BUTTON(self, 10, self.ConnectSupport) - self.stopButton = wx.Button(self, wx.ID_STOP, "", wx.Point(xval2, 70)) + self.stopButton = wx.Button(self, wx.ID_STOP, "", wx.Point(xval2, 81)) self.stopButton.Enable(False) wx.EVT_BUTTON(self, wx.ID_STOP, self.KillPID) @@ -92,7 +93,12 @@ class ConnectionWindow(wx.Frame): self.cb1 = wx.CheckBox(self, -1, 'Use NAT-PMP', (130, 48)) self.cb1.Enable(False) - + # Checkbox for low color + self.cb2 = wx.CheckBox(self, -1, 'Use low colors', (10, 81)) + self.cb2.Set3StateValue(False) + self.cb2.SetValue(self.paths['low-colors']) # Use value of --low-colors from command line + self.cb2.Enable(False) + # the combobox Control self.sampleList = self.paths['list'] @@ -162,21 +168,24 @@ class ConnectionWindow(wx.Frame): @author: Derek Buranen @author: Aaron Gerber + @author: Markus Roth """ if self.rb1.GetValue(): self.ToggleValue = 0 self.hostField.Enable(True) + self.cb2.Enable(False) if sys.platform == 'darwin' or sys.platform.find('linux') != -1: if self.enablePMP: self.cb1.Enable(False) else: self.ToggleValue = 1 self.hostField.Enable(False) + self.cb2.Enable(True) if sys.platform == 'darwin' or sys.platform.find('linux') != -1: if self.enablePMP: self.cb1.Enable(True) - - + + def ConnectSupport(self, event): """ Call VNC in a thread. @@ -342,6 +351,7 @@ class ConnectionWindow(wx.Frame): self.threadLock.release() def createThread(self, host=""): + self.paths['low-colors'] = self.cb2.GetValue() # Set low-colors to value of checkbox self.KillPID(False) self.thread = GitsoThread.GitsoThread(self, self.paths) self.thread.setHost(host) diff --git a/gitso/trunk/Processes.py b/gitso/trunk/Processes.py index f864223..2ee9a9a 100644 --- a/gitso/trunk/Processes.py +++ b/gitso/trunk/Processes.py @@ -60,11 +60,14 @@ class Processes: vncviewer = '%scotvnc.app/Contents/MacOS/cotvnc' % self.paths['resources'] self.returnPID = os.spawnlp(os.P_NOWAIT, vncviewer, vncviewer, '--listen') elif sys.platform.find('linux') != -1: - self.returnPID = os.spawnlp(os.P_NOWAIT, 'vncviewer', 'vncviewer', '-listen') # These are the options for low-res connections. # In the future, I'd like to support cross-platform low-res options. - # self.returnPID = os.spawnlp(os.P_NOWAIT, 'vncviewer', 'vncviewer', '-bgr233', '-listen') + # What aboot a checkbox in the gui + if self.paths['low-colors'] == False: + self.returnPID = os.spawnlp(os.P_NOWAIT, 'vncviewer', 'vncviewer', '-listen') + else: + self.returnPID = os.spawnlp(os.P_NOWAIT, 'vncviewer', 'vncviewer', '-bgr233', '-listen') elif sys.platform == 'win32': import subprocess if self.paths['mode'] == 'dev': diff --git a/gitso/trunk/arch/linux/gitso.1 b/gitso/trunk/arch/linux/gitso.1 index 4fcc719..3d09248 100644 --- a/gitso/trunk/arch/linux/gitso.1 +++ b/gitso/trunk/arch/linux/gitso.1 @@ -14,6 +14,8 @@ gitso - Gitso is to support others .B --list .I list | +.B --low-colors +| .B --version | .B --help @@ -38,6 +40,9 @@ Alternative support list, where .I list is either a URL of a remote file or path to local file. .TP +.B --low-colors +Use 8bit colors (for slow connections). +.TP .B --version The current Gitso version. .TP