summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Droege <slomo@ubuntu.com>2006-03-04 16:19:06 +0000
committerSebastian Droege <slomo@ubuntu.com>2006-03-04 16:19:06 +0000
commit8184058a60a504aff222328a7131d9a191f26f6c (patch)
tree82f9e949f8e247a5aa8e241645409d5d3d16fd8f
parent9ba4bc93654f0723297fe1b05dd09921b8296ae8 (diff)
* rename gnometerminal.py to gconfterminal.py and use the gconf key for the default terminal if present or gnome-terminal otherwise
git-svn-id: file:///home/lennart/svn/public/service-discovery-applet/trunk@95 3be567f1-68ff-0310-b24a-ad7cc433fd2f
-rw-r--r--plugins/Makefile.am2
-rw-r--r--plugins/gconfterminal.py (renamed from plugins/gnometerminal.py)21
2 files changed, 13 insertions, 10 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 37902fb..772cd8b 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -1,7 +1,7 @@
pluginsdir = $(PLUGINSDIR)
plugins_DATA = \
- gnometerminal.py \
+ gconfterminal.py \
nautilus.py
diff --git a/plugins/gnometerminal.py b/plugins/gconfterminal.py
index 306173f..54d8961 100644
--- a/plugins/gnometerminal.py
+++ b/plugins/gconfterminal.py
@@ -25,6 +25,7 @@ try:
import os
import pwd
import subprocess
+ import gconf
import gnome
except ImportError, e:
error_msg(_("A required python module is missing!\n%s") % (e))
@@ -96,9 +97,14 @@ class plugin_gnometerminal:
return store
def connect(self, use_host_names, name, stype, hostname, address, port, txts):
+ try:
+ terminal = gconf.client_get_default().get_string ("/desktop/gnome/applications/terminal/exec")
+ terminal = terminal + " " + gconf.client_get_default().get_string ("/desktop/gnome/applications/terminal/exec_arg")
+ except:
+ terminal = "gnome-terminal -x"
if use_host_names == True:
address = hostname
- print "connecting using gnometerminal"
+ print "connecting using %s" % (terminal)
if txts.has_key("u"):
username = self.SshLogin(name, txts["u"])
else:
@@ -106,21 +112,18 @@ class plugin_gnometerminal:
if stype == "_ssh._tcp":
- scheme = "ssh"
+ scheme = "ssh -X"
else:
scheme = "sftp"
if username == None:
return
elif username != "":
- sshline = "%s -X -p %i %s@%s" % (scheme, port, username, address)
+ sshline = "%s -p %i %s@%s" % (scheme, port, username, address)
else:
- sshline = "%s -X -p %i %s " % (scheme, port, address)
+ sshline = "%s -p %i %s " % (scheme, port, address)
- cmdline = []
- cmdline.append("gnome-terminal")
- cmdline.append("--tab")
- cmdline.append("-t %s" % name)
- cmdline.append("-e %s" % sshline)
+ cmdline = terminal.split(" ")
+ cmdline.extend(sshline.split(" "))
print cmdline
pid = subprocess.Popen(cmdline).pid