Track gconf cursor blinking in such a way that it handles the newer GNOME Terminal setting and the older one. Closes LP #283107

This commit is contained in:
Chris Jones 2009-01-15 00:02:01 +00:00
parent 2d57b7888d
commit 8c62f84357
1 changed files with 23 additions and 3 deletions

View File

@ -35,6 +35,11 @@ import os, platform, sys, re
import pwd import pwd
import gtk, pango import gtk, pango
try:
import gconf
except:
pass
# set this to true to enable debugging output # set this to true to enable debugging output
# These should be moved somewhere better. # These should be moved somewhere better.
debug = False debug = False
@ -332,6 +337,7 @@ class TerminatorConfValuestoreGConf (TerminatorConfValuestore):
profile = "" profile = ""
client = None client = None
cache = {} cache = {}
notifies = {}
def __init__ (self, profileName = None): def __init__ (self, profileName = None):
self.type = "GConf" self.type = "GConf"
@ -439,12 +445,26 @@ class TerminatorConfValuestoreGConf (TerminatorConfValuestore):
value = 'http://%s:%s/'%( value = 'http://%s:%s/'%(
self.client.get_string ('/system/http_proxy/host'), self.client.get_string ('/system/http_proxy/host'),
self.client.get_int ('/system/http_proxy/port')) self.client.get_int ('/system/http_proxy/port'))
elif key == 'cursor_blink':
tmp = self.client.get_string('%s/cursor_blink_mode' % self.profile)
if tmp in ['on', 'off'] and self.notifies.has_key ('cursor_blink'):
self.client.notify_remove (self.notifies['cursor_blink'])
del (self.notifies['cursor_blink'])
if tmp == 'on':
value = True
elif tmp == 'off':
value = False
elif tmp == 'system':
value = self.client.get_bool ('/desktop/gnome/interface/cursor_blink')
self.notifies['cursor_blink'] = self.client.notify_add ('/desktop/gnome/interface/cursor_blink', self.on_gconf_notify)
else:
value = self.client.get ('%s/%s'%(self.profile, key))
else: else:
value = self.client.get ('%s/%s'%(self.profile, key)) value = self.client.get ('%s/%s'%(self.profile, key))
if value: if value != None:
from types import StringType from types import StringType,BooleanType
if type(value) is StringType: if type(value) in [StringType, BooleanType]:
ret = value ret = value
else: else:
funcname = "get_" + Defaults[key].__class__.__name__ funcname = "get_" + Defaults[key].__class__.__name__