* src/GrampsCfg.py: add cell renderer to combobox

svn: r7001
This commit is contained in:
Don Allingham 2006-07-06 20:11:32 +00:00
parent 2b9c05714d
commit 323dd9033b
2 changed files with 17 additions and 14 deletions

View File

@ -1,4 +1,5 @@
2006-07-06 Don Allingham <don@gramps-project.org>
* src/GrampsCfg.py: add cell renderer to combobox
* help/C/gramps-manual.xml: update doc
2006-07-06 Alex Roitman <shura@gramps-project.org>

View File

@ -222,18 +222,20 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
obox = gtk.ComboBox()
obox_data = {}
obox_model = gtk.ListStore(str, int)
cell = gtk.CellRendererText()
obox.pack_start(cell, True)
obox.add_attribute(cell, 'text', 0)
index = 0
for t, v in format_list:
obox_model.append(row=[t, v])
print [t, v]
obox_data[v] = index
index += 1
obox.set_model(obox_model)
#active = int(Config.get(Config.NAME_FORMAT))
#obox.set_active(active)
# obox.connect('changed', self.name_changed)
active = int(Config.get(Config.NAME_FORMAT))
obox.set_active(active)
obox.connect('changed', self.name_changed)
lwidget = BasicLabel("%s: " % _('Preset format'))
# custom_ui = self.build_custom_name_ui()
@ -281,16 +283,16 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
## return table
## def name_changed(self,obj):
## return
## custom_text = NameDisplay.formats[Name.CUSTOM]
## if obj.get_active_text() == custom_text:
## self.name_exp.set_sensitive(True)
## self.name_exp.set_expanded(True)
## else:
## Config.set(Config.NAME_FORMAT,obj.get_active())
## self.name_exp.set_expanded(False)
## self.name_exp.set_sensitive(False)
def name_changed(self,obj):
custom_text = NameDisplay.formats[Name.CUSTOM]
if obj.get_active_text() == custom_text:
pass
#self.name_exp.set_sensitive(True)
#self.name_exp.set_expanded(True)
else:
Config.set(Config.NAME_FORMAT,obj.get_active())
#self.name_exp.set_expanded(False)
#self.name_exp.set_sensitive(False)
def add_formats_panel(self):
table = gtk.Table(3,8)