summaryrefslogtreecommitdiffstats
path: root/actions/services/__init__.py.in
diff options
context:
space:
mode:
Diffstat (limited to 'actions/services/__init__.py.in')
-rwxr-xr-xactions/services/__init__.py.in15
1 files changed, 11 insertions, 4 deletions
diff --git a/actions/services/__init__.py.in b/actions/services/__init__.py.in
index 5f19e26..db70c8c 100755
--- a/actions/services/__init__.py.in
+++ b/actions/services/__init__.py.in
@@ -107,7 +107,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)
@@ -139,8 +140,12 @@ def SshLogin(hostname, username = None):
completion.set_text_column(0)
win.show_all()
- win.run()
- return entry.get_text()
+ if win.run() == gtk.RESPONSE_OK:
+ win.destroy()
+ return entry.get_text()
+ else:
+ win.destroy()
+ return None
def __create_completion_model():
''' Creates a tree model containing the completions.
@@ -163,7 +168,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)