summaryrefslogtreecommitdiffstats
path: root/actions/services/_ssh_tcp.py
diff options
context:
space:
mode:
Diffstat (limited to 'actions/services/_ssh_tcp.py')
-rw-r--r--actions/services/_ssh_tcp.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/actions/services/_ssh_tcp.py b/actions/services/_ssh_tcp.py
index 1465275..7660ea5 100644
--- a/actions/services/_ssh_tcp.py
+++ b/actions/services/_ssh_tcp.py
@@ -13,7 +13,8 @@ def SshLogin(hostname, username = None):
global win
win = gtk.Dialog("Ssh Connection", None,
gtk.DIALOG_MODAL,
- (gtk.STOCK_OK, gtk.RESPONSE_OK))
+ (gtk.STOCK_OK, gtk.RESPONSE_OK,
+ gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
vbox = gtk.VBox(False, 5)
win.vbox.pack_start(vbox, True, True, 0)
@@ -45,7 +46,12 @@ def SshLogin(hostname, username = None):
completion.set_text_column(0)
win.show_all()
- win.run()
+ if win.run() == gtk.RESPONSE_OK:
+ win.destroy()
+ return entry.get_text()
+ else:
+ win.destroy()
+ return None
return entry.get_text()
def __create_completion_model():
@@ -69,7 +75,9 @@ def _ssh_tcp(name, hostname, address, port, txts):
else:
username = SshLogin(name)
- if username != "":
+ if username == None:
+ return
+ elif username != "":
sshline = "ssh -l %s -p %i %s" % (username, port, address)
else:
sshline = "ssh -p %i %s" % (port, address)