add Ctrl-(Shift)-Tab to change focus; scan all profiles and match on title, not path
This commit is contained in:
parent
73b2be2d70
commit
fd05040c8d
20
terminator
20
terminator
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue