Skip to content

Commit

Permalink
the display number is optional in ssh mode, so leave it empty unless …
Browse files Browse the repository at this point in the history
…it is specified

git-svn-id: https://xpra.org/svn/Xpra/trunk@18424 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 13, 2018
1 parent efc8ac2 commit e1a13d1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/xpra/client/gtk_base/client_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,16 +793,20 @@ def update_gui_from_config(self):
self.username_entry.set_text(self.config.username)
self.password_entry.set_text(self.config.password)
self.host_entry.set_text(self.config.host)
def get_port(v):
def get_port(v, default_port=DEFAULT_PORT):
try:
iport = int(v)
if iport>0:
if iport>0 and iport<2**16:
return str(iport)
except:
pass
return str(DEFAULT_PORT)
self.port_entry.set_text(get_port(self.config.port))
self.ssh_port_entry.set_text(get_port(self.config.ssh_port))
return str(default_port)
dport = DEFAULT_PORT
if mode=="ssh":
#not required, so don't specify one
dport = ""
self.port_entry.set_text(get_port(self.config.port, dport))
self.ssh_port_entry.set_text(get_port(self.config.ssh_port, 22))

def close_window(self, *_args):
w = self.window
Expand Down

0 comments on commit e1a13d1

Please sign in to comment.