summaryrefslogtreecommitdiff
path: root/portato/gui/windows/preference.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-02-20 00:29:36 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-02-20 00:29:36 +0100
commitd3f2196d3c638222a8e96c3d61626a9ff8efb2e1 (patch)
tree74a5dc61fdc49be449497e0cedf9759a15a50ed5 /portato/gui/windows/preference.py
parent796f983e0eb5889ee18169bfedfdef99e5b9e2ef (diff)
downloadportato-d3f2196d3c638222a8e96c3d61626a9ff8efb2e1.tar.gz
portato-d3f2196d3c638222a8e96c3d61626a9ff8efb2e1.tar.bz2
portato-d3f2196d3c638222a8e96c3d61626a9ff8efb2e1.zip
Add color btns to the preferences, so they are configurable here too
Diffstat (limited to 'portato/gui/windows/preference.py')
-rw-r--r--portato/gui/windows/preference.py34
1 files changed, 24 insertions, 10 deletions
diff --git a/portato/gui/windows/preference.py b/portato/gui/windows/preference.py
index a7661c5..4d3493f 100644
--- a/portato/gui/windows/preference.py
+++ b/portato/gui/windows/preference.py
@@ -61,7 +61,7 @@ class PreferenceWindow (AbstractDialog):
4 : gtk.POS_RIGHT
}
- def __init__ (self, parent, cfg, console_fn, linkbtn_fn, tabpos_fn, catmodel_fn):
+ def __init__ (self, parent, cfg, console_fn, linkbtn_fn, tabpos_fn, catmodel_fn, labelcolor_fn):
"""Constructor.
@param parent: parent window
@@ -75,7 +75,9 @@ class PreferenceWindow (AbstractDialog):
@param tabpos_fn: function to call to set the tabposition of the notebooks
@type tabpos_fn: function(gtk.ComboBox,int)
@param catmodel_fn: function to call to set the model of the cat list (collapsed/not collapsed)
- @type catmodel_fn: function()"""
+ @type catmodel_fn: function()
+ @param labelcolor_fn: function to call to set the color of the label
+ @type labelcolor_fn: function(gtk.gdk.Color)"""
AbstractDialog.__init__(self, parent)
@@ -102,6 +104,7 @@ class PreferenceWindow (AbstractDialog):
self.linkbtn_fn = linkbtn_fn
self.tabpos_fn = tabpos_fn
self.catmodel_fn = catmodel_fn
+ self.labelcolor_fn = labelcolor_fn
# set the bg-color of the hint
hintEB = self.tree.get_widget("hintEB")
@@ -110,20 +113,16 @@ class PreferenceWindow (AbstractDialog):
# the checkboxes
for box, val in self.checkboxes.iteritems():
if isinstance(val, tuple):
- self.tree.get_widget(box).\
- set_active(self.cfg.get_boolean(val[0], section = val[1]))
+ self.tree.get_widget(box).set_active(self.cfg.get_boolean(val[0], section = val[1]))
else:
- self.tree.get_widget(box).\
- set_active(self.cfg.get_boolean(val))
+ self.tree.get_widget(box).set_active(self.cfg.get_boolean(val))
# the edits
for edit, val in self.edits.iteritems():
if isinstance(val,tuple):
- self.tree.get_widget(edit).\
- set_text(self.cfg.get(val[0], section = val[1]))
+ self.tree.get_widget(edit).set_text(self.cfg.get(val[0], section = val[1]))
else:
- self.tree.get_widget(edit).\
- set_text(self.cfg.get(val))
+ self.tree.get_widget(edit).set_text(self.cfg.get(val))
# the set list
self.setList = self.tree.get_widget("setList")
@@ -139,6 +138,13 @@ class PreferenceWindow (AbstractDialog):
self.titleLengthSpinBtn = self.tree.get_widget("titleLengthSpinBtn")
self.titleLengthSpinBtn.set_value(int(self.cfg.get("titlelength", section = "GUI")))
+ # the color buttons
+ self.pkgTableColorBtn = self.tree.get_widget("pkgTableColorBtn")
+ self.pkgTableColorBtn.set_color(get_color(self.cfg, "packagetable"))
+
+ self.prefColorBtn = self.tree.get_widget("prefColorBtn")
+ self.prefColorBtn.set_color(get_color(self.cfg, "prefhint"))
+
# the comboboxes
self.systemTabCombo = self.tree.get_widget("systemTabCombo")
self.pkgTabCombo = self.tree.get_widget("packageTabCombo")
@@ -209,6 +215,14 @@ class PreferenceWindow (AbstractDialog):
self.catmodel_fn()
+ # colors
+ c = self.pkgTableColorBtn.get_color()
+ self.cfg.set("packagetable", str(c)[1:], section = "COLORS")
+ self.labelcolor_fn(c)
+
+ c = self.prefColorBtn.get_color()
+ self.cfg.set("prefhint", str(c)[1:], section = "COLORS")
+
def fill_setlist (self):
store = gtk.ListStore(bool, str, str, str)