* src/ListModel.py: keep track of data index

* src/EventEdit.py: use new label scheme for tabs that uses an
icon to indicate used tabs


svn: r4410
This commit is contained in:
Don Allingham 2005-04-24 03:39:07 +00:00
parent f057b30363
commit c9f9d2163c
5 changed files with 268 additions and 89 deletions

View File

@ -1,4 +1,7 @@
2005-04-23 Don Allingham <don@gramps-project.org>
* src/ListModel.py: keep track of data index
* src/EventEdit.py: use new label scheme for tabs that uses an
icon to indicate used tabs
* src/AddrEdit.py: use new label scheme for tabs that uses an
icon to indicate used tabs
* src/AttrEdit.py: use new label scheme for tabs that uses an

View File

@ -307,21 +307,39 @@ class EditPerson:
self.on_event_update_clicked)
# attribute display
atitles = [(_('Attribute'),-1,150),(_('Value'),-1,150)]
atitles = [
(_('Attribute'),-1,200),
(_('Value'),-1,350),
(_(':Source'),-1,50),
(_(':Note'),-1,50),
]
self.atree = ListModel.ListModel(self.attr_list,atitles,
self.on_attr_select_row,
self.on_update_attr_clicked)
# address display
ptitles = [(_('Date'),-1,150),(_('Address'),-1,150)]
ptitles = [
(_('Date'),-1,175),
(_('Address'),-1,150),
(_('City'),-1,100),
(_('State/Province'),-1,75),
(_('Country'),-1,100),
(_(':Source'),-1,50),
(_(':Note'),-1,50),
]
self.ptree = ListModel.ListModel(self.addr_list, ptitles,
self.on_addr_select_row,
self.on_update_addr_clicked)
# name display
ntitles = [(_('Family Name'),-1,250),(_('Prefix'),-1,50),
(_('Given Name'),-1,200),(_('Suffix'),-1,50),
(_('Type'),-1,100)]
ntitles = [
(_('Family Name'),-1,225),
(_('Prefix'),-1,50),
(_('Given Name'),-1,200),
(_('Suffix'),-1,50),
(_('Type'),-1,100),
(_(':Source'),-1,50), (_(':Note'),-1,50),
]
self.ntree = ListModel.ListModel(self.name_list,ntitles,
self.on_name_select_row)
self.ntree.tree.connect('event',self.aka_double_click)
@ -969,10 +987,12 @@ class EditPerson:
self.ntree.clear()
self.nmap = {}
for name in self.nlist:
has_note = name.get_note()
has_source = len(name.get_source_references())> 0
node = self.ntree.add([
name.get_surname(),name.get_surname_prefix(),
name.get_first_name(), name.get_suffix(),
_(name.get_type())],name)
_(name.get_type()),has_source,has_note],name)
self.nmap[str(name)] = node
if self.nlist:
self.ntree.select_row(0)
@ -1002,9 +1022,14 @@ class EditPerson:
self.ptree.clear()
self.pmap = {}
for addr in self.plist:
has_note = addr.get_note()
has_source = len(addr.get_source_references())> 0
location = "%s %s %s %s" % (addr.get_street(),addr.get_city(),
addr.get_state(),addr.get_country())
node = self.ptree.add([addr.get_date(),location],addr)
node = self.ptree.add([addr.get_date(),addr.get_street(),
addr.get_city(),addr_get_state(),
addr_get_country(),has_source,has_note],
addr)
self.pmap[str(addr)] = node
if self.plist:
self.ptree.select_row(0)
@ -1017,7 +1042,12 @@ class EditPerson:
self.atree.clear()
self.amap = {}
for attr in self.alist:
node = self.atree.add([const.display_pattr(attr.get_type()),attr.get_value()],attr)
has_note = attr.get_note()
has_source = len(attr.get_source_references())> 0
node = self.atree.add([
const.display_pattr(attr.get_type()), attr.get_value(),
has_source, has_note,
],attr)
self.amap[str(attr)] = node
if self.alist:
self.atree.select_row(0)

View File

@ -144,14 +144,15 @@ class EventEditor:
self.event_menu = self.top.get_widget("personal_events")
self.priv = self.top.get_widget("priv")
self.priv.set_sensitive(not noedit)
self.sources_label = self.top.get_widget("sourcesEvent")
self.notes_label = self.top.get_widget("notesEvent")
self.sources_label = self.top.get_widget("sources_tab")
self.notes_label = self.top.get_widget("note_tab")
self.general_label = self.top.get_widget("general_tab")
self.gallery_label = self.top.get_widget("gallery_tab")
self.witnesses_label = self.top.get_widget("witness_tab")
self.flowed = self.top.get_widget("eventflowed")
self.flowed.set_sensitive(not noedit)
self.preform = self.top.get_widget("eventpreform")
self.preform.set_sensitive(not noedit)
self.gallery_label = self.top.get_widget("galleryEvent")
self.witnesses_label = self.top.get_widget("witnessesEvent")
self.ok = self.top.get_widget('ok')
self.ok.set_sensitive(not noedit)
@ -219,7 +220,6 @@ class EventEditor:
self.date_field,
self.top.get_widget("date_stat"),
self.window)
if not event:
event = RelLib.Event()
self.icon_list = self.top.get_widget("iconlist")

View File

@ -34,11 +34,13 @@ class ListModel:
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] == ':':
self.mylist.append(TYPE_BOOLEAN)
else:
self.mylist.append(TYPE_STRING)
self.data_index += 1
self.mylist.append(TYPE_PYOBJECT)
self.tree.set_rules_hint(True)
@ -46,7 +48,6 @@ class ListModel:
self.selection = None
self.mode = mode
self.new_model()
self.data_index = l
self.count = 0
self.cid = None
self.cids = []

View File

@ -27415,10 +27415,32 @@ Very High</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="general_tab">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkImage" id="image2583">
<property name="icon_size">4</property>
<property name="icon_name">gtk-file</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label271">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;General&lt;/b&gt;</property>
<property name="label" translatable="yes">General</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
@ -27433,6 +27455,13 @@ Very High</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="type">tab</property>
</packing>
@ -27600,6 +27629,28 @@ Very High</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="sources_tab">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkImage" id="image2584">
<property name="icon_size">4</property>
<property name="icon_name">gtk-file</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="sourcesEvent">
<property name="visible">True</property>
@ -27618,6 +27669,13 @@ Very High</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="type">tab</property>
</packing>
@ -27765,6 +27823,28 @@ Very High</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="note_tab">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkImage" id="image2585">
<property name="icon_size">4</property>
<property name="icon_name">gtk-file</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="notesEvent">
<property name="visible">True</property>
@ -27783,6 +27863,13 @@ Very High</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="type">tab</property>
</packing>
@ -27951,6 +28038,28 @@ Very High</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="witness_tab">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkImage" id="image2586">
<property name="icon_size">4</property>
<property name="icon_name">gtk-file</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="witnessesEvent">
<property name="visible">True</property>
@ -27969,6 +28078,13 @@ Very High</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="type">tab</property>
</packing>
@ -28166,6 +28282,28 @@ Very High</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="gallery_tab">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkImage" id="image2587">
<property name="icon_size">4</property>
<property name="icon_name">gtk-file</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="galleryEvent">
<property name="visible">True</property>
@ -28184,6 +28322,13 @@ Very High</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="type">tab</property>
</packing>