* src/EditPerson.py: rewrite of tabbed lists

* src/EventEdit.py: bold the label
* src/ListModel.py: allow column types to be specified
* src/edit_person.glade: tab improvements


svn: r4437
This commit is contained in:
Don Allingham 2005-04-28 04:48:30 +00:00
parent 32aae7d0e7
commit de0ab260d4
5 changed files with 452 additions and 729 deletions

View File

@ -1,3 +1,9 @@
2005-04-27 Don Allingham <don@gramps-project.org>
* src/EditPerson.py: rewrite of tabbed lists
* src/EventEdit.py: bold the label
* src/ListModel.py: allow column types to be specified
* src/edit_person.glade: tab improvements
2005-04-27 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/gramps_main.py (__init__): Avoid TypeError in schema error
message

File diff suppressed because it is too large Load Diff

View File

@ -244,6 +244,8 @@ class EventEditor:
self.top.get_widget('sel_obj').set_sensitive(not noedit)
self.top.get_widget('add_obj').set_sensitive(not noedit)
Utils.bold_label(self.general_label)
try:
self.window.set_transient_for(self.parent.window)
except AttributeError:

View File

@ -24,19 +24,25 @@ import const
gtk26 = gtk.pygtk_version >= (2,6,0)
TEXT = 0
TOGGLE = 1
COMBO = 2
NOSORT = -1
#-------------------------------------------------------------------------
#
# ListModel
#
#-------------------------------------------------------------------------
class ListModel:
def __init__(self,tree,dlist,select_func=None,
event_func=None,mode=gtk.SELECTION_SINGLE):
self.tree = tree
self.mylist = []
self.data_index = 0
for l in dlist:
if l[0] and l[0][0] == ':':
if len(l) == 4 and l[3] == TOGGLE:
self.mylist.append(TYPE_BOOLEAN)
else:
self.mylist.append(TYPE_STRING)
@ -66,11 +72,14 @@ class ListModel:
cnum = 0
for name in dlist:
if name[0] and name[0][0] == ':':
if len(name) == 3:
name = (name[0],name[1],name[2],TEXT)
if name[0] and name[3] == TOGGLE:
renderer = gtk.CellRendererToggle()
column = gtk.TreeViewColumn(name[0][1:],renderer)
column = gtk.TreeViewColumn(name[0],renderer)
column.add_attribute(renderer,'active',cnum)
elif gtk26 and cnum == 0:
elif gtk26 and name[3] == COMBO:
renderer = gtk.CellRendererCombo()
renderer.set_property('model',model)
renderer.set_property('text_column',0)

View File

@ -949,7 +949,7 @@ Unknown</property>
<property name="spacing">6</property>
<child>
<widget class="GtkButton" id="add_aka">
<widget class="GtkButton" id="aka_add">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Create an alternate name for this person</property>
<property name="can_focus">True</property>
@ -1005,7 +1005,7 @@ Unknown</property>
</child>
<child>
<widget class="GtkButton" id="aka_delete">
<widget class="GtkButton" id="aka_del">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="tooltip" translatable="yes">Delete the selected name</property>
@ -1187,7 +1187,7 @@ Unknown</property>
</child>
<child>
<widget class="GtkButton" id="attr_edit_btn">
<widget class="GtkButton" id="attr_edit">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="tooltip" translatable="yes">Edit the selected attribute</property>
@ -1399,7 +1399,7 @@ Unknown</property>
</child>
<child>
<widget class="GtkButton" id="addr_edit_btn">
<widget class="GtkButton" id="addr_edit">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="tooltip" translatable="yes">Edit the selected address</property>
@ -2190,7 +2190,7 @@ Unknown</property>
<property name="spacing">6</property>
<child>
<widget class="GtkButton" id="add_url">
<widget class="GtkButton" id="url_add">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Add an internet reference about this person</property>
<property name="can_focus">True</property>
@ -2218,7 +2218,7 @@ Unknown</property>
</child>
<child>
<widget class="GtkButton" id="edit_url">
<widget class="GtkButton" id="url_edit">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="tooltip" translatable="yes">Edit the selected internet address</property>
@ -2274,7 +2274,7 @@ Unknown</property>
</child>
<child>
<widget class="GtkButton" id="delete_url">
<widget class="GtkButton" id="url_del">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="tooltip" translatable="yes">Delete selected reference</property>