Since gnome-terminal now seems to set a global key with the list of profiles it knows about, we don't need to walk the profile directory ourselves, which seems like a good plan

This commit is contained in:
Chris Jones 2007-12-16 17:11:22 +00:00
parent ec51a1e865
commit 71f07637ac
1 changed files with 9 additions and 5 deletions

View File

@ -38,7 +38,8 @@ class TerminatorTerm:
# Our settings
# FIXME: Add commandline and/or gconf options to change these
defaults = {
'profile_dir' : '/apps/gnome-terminal/profiles',
'gt_dir' : '/apps/gnome-terminal',
'_profile_dir' : '%s/profiles',
'allow_bold' : True,
'audible_bell' : False,
'background' : None,
@ -69,16 +70,19 @@ class TerminatorTerm:
matches = {}
def __init__ (self, term, profile):
self.defaults['profile_dir'] = self.defaults['_profile_dir']%(self.defaults['gt_dir'])
self.defaults['link_user'] = self.defaults['_link_user']%(self.defaults['link_userchars'], self.defaults['link_passchars'])
self.term = term
self.gconf_client = gconf.client_get_default ()
self.profile = None
for dir in self.gconf_client.all_dirs(self.defaults['profile_dir']):
if self.gconf_client.get_string (dir + "/visible_name") == profile:
self.profile = dir
break
profiles = self.gconf_client.get_list (self.defaults['gt_dir'] + '/global/profile_list', 'string')
for item in profiles:
if item == profile:
self.profile = '%s/%s'%(self.defaults['profile_dir'], item)
break
if self.profile == None:
print "Error, unable to find profile " + profile