gconf fix from Kees Cook and a patch from him to add ctrl-tab and ctrl-shift-tab for switching terminals

This commit is contained in:
Chris Jones 2007-11-22 23:26:12 +00:00
commit 397bac42af
1 changed files with 16 additions and 4 deletions

View File

@ -38,7 +38,7 @@ class TerminatorTerm:
# Our settings # Our settings
# FIXME: Add commandline and/or gconf options to change these # FIXME: Add commandline and/or gconf options to change these
defaults = { defaults = {
'profile_dir' : '/apps/gnome-terminal/profiles/', 'profile_dir' : '/apps/gnome-terminal/profiles',
'allow_bold' : True, 'allow_bold' : True,
'audible_bell' : False, 'audible_bell' : False,
'background' : None, 'background' : None,
@ -74,11 +74,15 @@ class TerminatorTerm:
defaults[key] = settings[key] defaults[key] = settings[key]
self.term = term self.term = term
self.profile = self.defaults['profile_dir'] + profile
self.gconf_client = gconf.client_get_default () self.gconf_client = gconf.client_get_default ()
if not self.gconf_client.dir_exists (self.profile): self.profile = None
for dir in self.gconf_client.all_dirs(self.defaults['profile_dir']):
if self.gconf_client.get_string (dir + "/title") == profile:
self.profile = dir
break
if self.profile == None:
print "Error, unable to find profile " + profile print "Error, unable to find profile " + profile
# FIXME: This absolutely should not be an exit, the terminal should fail to spawn. If they all fail, it should exit from the mainloop or something. # FIXME: This absolutely should not be an exit, the terminal should fail to spawn. If they all fail, it should exit from the mainloop or something.
sys.exit (2) sys.exit (2)
@ -264,6 +268,14 @@ class TerminatorTerm:
self.term.closeterm (self) self.term.closeterm (self)
return (True) return (True)
if keyname == 'Tab' or keyname.endswith('_Tab'):
if event.state == gtk.gdk.CONTROL_MASK:
self.term.go_next (self)
return (True)
if (event.state & mask) == mask:
self.term.go_prev (self)
return (True)
return (False) return (False)
def on_vte_popup_menu (self, term): def on_vte_popup_menu (self, term):