diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2008-06-19 11:23:24 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2008-06-19 11:23:24 +0200 |
commit | 48f046aec4df3b09906ca41e2c75ce7e0fb045a6 (patch) | |
tree | 5562fc5377f9592a6293735e8baf78230a1a48a6 /portato/gui/windows/preference.py | |
parent | be7f3e89a19cadad856dae717836f9ed3a66c85d (diff) | |
parent | 52f04fc6cccffa7cf31a4d7eab9c9b341f77a293 (diff) | |
download | portato-48f046aec4df3b09906ca41e2c75ce7e0fb045a6.tar.gz portato-48f046aec4df3b09906ca41e2c75ce7e0fb045a6.tar.bz2 portato-48f046aec4df3b09906ca41e2c75ce7e0fb045a6.zip |
Merged from trunk
Diffstat (limited to 'portato/gui/windows/preference.py')
-rw-r--r-- | portato/gui/windows/preference.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/portato/gui/windows/preference.py b/portato/gui/windows/preference.py index 991e7b3..d35666d 100644 --- a/portato/gui/windows/preference.py +++ b/portato/gui/windows/preference.py @@ -24,6 +24,7 @@ class PreferenceWindow (AbstractDialog): # all checkboxes in the window # widget name -> option name checkboxes = { + "collapseCatCheck" : ("collapseCats", "GUI"), "consoleUpdateCheck" : ("updateConsole", "GUI"), "debugCheck" : "debug", "deepCheck" : "deep", @@ -56,7 +57,7 @@ class PreferenceWindow (AbstractDialog): 4 : gtk.POS_RIGHT } - def __init__ (self, parent, cfg, console_fn, linkbtn_fn, tabpos_fn): + def __init__ (self, parent, cfg, console_fn, linkbtn_fn, tabpos_fn, catmodel_fn): """Constructor. @param parent: parent window @@ -68,7 +69,9 @@ class PreferenceWindow (AbstractDialog): @param linkbtn_fn: function to call to set the linkbutton behavior @type linkbtn_fn: function(string) @param tabpos_fn: function to call to set the tabposition of the notebooks - @type tabpos_fn: function(gtk.ComboBox,int)""" + @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()""" AbstractDialog.__init__(self, parent) @@ -79,6 +82,7 @@ class PreferenceWindow (AbstractDialog): self.console_fn = console_fn self.linkbtn_fn = linkbtn_fn self.tabpos_fn = tabpos_fn + self.catmodel_fn = catmodel_fn # set the bg-color of the hint hintEB = self.tree.get_widget("hintEB") @@ -106,6 +110,10 @@ class PreferenceWindow (AbstractDialog): self.consoleFontBtn = self.tree.get_widget("consoleFontBtn") self.consoleFontBtn.set_font_name(self.cfg.get("consolefont", section = "GUI")) + # the console title length spin button + self.titleLengthSpinBtn = self.tree.get_widget("titleLengthSpinBtn") + self.titleLengthSpinBtn.set_value(int(self.cfg.get("titlelength", section = "GUI"))) + # the comboboxes self.systemTabCombo = self.tree.get_widget("systemTabCombo") self.pkgTabCombo = self.tree.get_widget("packageTabCombo") @@ -140,6 +148,8 @@ class PreferenceWindow (AbstractDialog): self.cfg.set("consolefont", font, section = "GUI") self.console_fn(font) + self.cfg.set("titlelength", str(self.titleLengthSpinBtn.get_value_as_int()), section = "GUI") + pkgPos = self.pkgTabCombo.get_active()+1 sysPos = self.systemTabCombo.get_active()+1 @@ -150,6 +160,8 @@ class PreferenceWindow (AbstractDialog): self.linkbtn_fn(self.cfg.get("browserCmd", section="GUI")) + self.catmodel_fn() + def cb_ok_clicked(self, button): """Saves, writes to config-file and closes the window.""" self._save() |