2006-05-12 Don Allingham <don@gramps-project.org>
* src/GrampsCfg.py: add revert option for colors * src/Config/_GrampsGconfKeys.py: added get_default * src/Config/_GrampsIniKeys.py: added get_default svn: r6641
This commit is contained in:
parent
38c02eddce
commit
9aa8094b00
@ -1,3 +1,8 @@
|
|||||||
|
2006-05-12 Don Allingham <don@gramps-project.org>
|
||||||
|
* src/GrampsCfg.py: add revert option for colors
|
||||||
|
* src/Config/_GrampsGconfKeys.py: added get_default
|
||||||
|
* src/Config/_GrampsIniKeys.py: added get_default
|
||||||
|
|
||||||
2006-05-12 Alex Roitman <shura@gramps-project.org>
|
2006-05-12 Alex Roitman <shura@gramps-project.org>
|
||||||
* data/gramps.schemas.in: Brighter colors to use with foreground.
|
* data/gramps.schemas.in: Brighter colors to use with foreground.
|
||||||
* src/GrampsCfg.py (add_color): Update text label after color change.
|
* src/GrampsCfg.py (add_color): Update text label after color change.
|
||||||
|
@ -149,3 +149,7 @@ def set_string(key,val,test_func=None):
|
|||||||
|
|
||||||
def sync():
|
def sync():
|
||||||
client.suggest_sync()
|
client.suggest_sync()
|
||||||
|
|
||||||
|
def get_default(key):
|
||||||
|
token = "/apps/gramps/%s/%s" % (key[0],key[1])
|
||||||
|
return client.get_default_from_schema(token)
|
||||||
|
@ -245,3 +245,5 @@ def set_string(key, val, test_func=None):
|
|||||||
def sync():
|
def sync():
|
||||||
client.suggest_sync()
|
client.suggest_sync()
|
||||||
|
|
||||||
|
def get_default(key):
|
||||||
|
return default_value[key]
|
||||||
|
@ -175,11 +175,32 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
|
|||||||
table.set_col_spacings(12)
|
table.set_col_spacings(12)
|
||||||
table.set_row_spacings(6)
|
table.set_row_spacings(6)
|
||||||
|
|
||||||
self.add_color(table, _("Complete"), 0, Config.COMPLETE_COLOR)
|
self.comp_color = self.add_color(table, _("Complete"), 0,
|
||||||
self.add_color(table, _("ToDo"), 1, Config.TODO_COLOR)
|
Config.COMPLETE_COLOR)
|
||||||
self.add_color(table, _("Custom"), 2, Config.CUSTOM_MARKER_COLOR)
|
self.todo_color = self.add_color(table, _("ToDo"), 1,
|
||||||
|
Config.TODO_COLOR)
|
||||||
|
self.custom_color = self.add_color(table, _("Custom"), 2,
|
||||||
|
Config.CUSTOM_MARKER_COLOR)
|
||||||
|
|
||||||
|
button = gtk.Button(stock=gtk.STOCK_REVERT_TO_SAVED)
|
||||||
|
button.connect('clicked', self.reset_colors)
|
||||||
|
table.attach(button, 1, 2, 3, 4, yoptions=0, xoptions=0)
|
||||||
return table
|
return table
|
||||||
|
|
||||||
|
def reset_colors(self, obj):
|
||||||
|
|
||||||
|
def_comp = Config.get_default(Config.COMPLETE_COLOR)
|
||||||
|
def_todo = Config.get_default(Config.TODO_COLOR)
|
||||||
|
def_cust = Config.get_default(Config.CUSTOM_MARKER_COLOR)
|
||||||
|
|
||||||
|
Config.set(Config.COMPLETE_COLOR, def_comp)
|
||||||
|
Config.set(Config.TODO_COLOR, def_todo)
|
||||||
|
Config.set(Config.CUSTOM_MARKER_COLOR, def_cust)
|
||||||
|
|
||||||
|
self.comp_color.set_color(gtk.gdk.color_parse(def_comp))
|
||||||
|
self.todo_color.set_color(gtk.gdk.color_parse(def_todo))
|
||||||
|
self.custom_color.set_color(gtk.gdk.color_parse(def_cust))
|
||||||
|
|
||||||
def add_formats_panel(self):
|
def add_formats_panel(self):
|
||||||
table = gtk.Table(3,8)
|
table = gtk.Table(3,8)
|
||||||
table.set_border_width(12)
|
table.set_border_width(12)
|
||||||
@ -278,6 +299,7 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
|
|||||||
xoptions=gtk.FILL)
|
xoptions=gtk.FILL)
|
||||||
table.attach(entry, 1, 2, index, index+1, yoptions=0, xoptions=0)
|
table.attach(entry, 1, 2, index, index+1, yoptions=0, xoptions=0)
|
||||||
table.attach(color_hex_label, 2, 3, index, index+1, yoptions=0)
|
table.attach(color_hex_label, 2, 3, index, index+1, yoptions=0)
|
||||||
|
return entry
|
||||||
|
|
||||||
def update_entry(self, obj, constant):
|
def update_entry(self, obj, constant):
|
||||||
Config.set(constant, unicode(obj.get_text()))
|
Config.set(constant, unicode(obj.get_text()))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user