Delay attaching ListStore to TreeView until after names have been loaded.

svn: r1191
This commit is contained in:
Don Allingham 2002-11-17 05:06:43 +00:00
parent c46962df92
commit 63a8ab5e16
6 changed files with 33 additions and 13 deletions

2
gramps2/configure vendored
View File

@ -1567,7 +1567,7 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
RELEASE=pre4
RELEASE=pre5
VERSIONSTRING=$VERSION
if test x"$RELEASE" != "x"

View File

@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
dnl May need to run automake && aclocal first
AC_INIT(src/gramps.py)
AM_INIT_AUTOMAKE(gramps, 0.9.0)
RELEASE=pre4
RELEASE=pre5
VERSIONSTRING=$VERSION
if test x"$RELEASE" != "x"

View File

@ -1,5 +1,5 @@
%define ver 0.9.0
%define rel pre4
%define rel pre5
%define prefix /usr
Summary: Genealogical Research and Analysis Management Programming System.

View File

@ -25,11 +25,12 @@ class ListModel:
def __init__(self,tree,dlist,select_func=None,event_func=None):
self.tree = tree
l = len(dlist)
mylist = [TYPE_STRING]*l + [TYPE_PYOBJECT]
self.model = gtk.ListStore(*mylist)
self.mylist = [TYPE_STRING]*l + [TYPE_PYOBJECT]
self.new_model()
self.connect_model()
self.selection = self.tree.get_selection()
self.tree.set_model(self.model)
self.data_index = l
@ -61,6 +62,12 @@ class ListModel:
self.double_click = event_func
self.tree.connect('event',self.button_press)
def new_model(self):
self.model = gtk.ListStore(*self.mylist)
def connect_model(self):
self.tree.set_model(self.model)
def get_selected(self):
return self.selection.get_selected()

View File

@ -99,7 +99,7 @@ startup = 1
#
#-------------------------------------------------------------------------
progName = "GRAMPS"
version = "0.9.0-pre4"
version = "0.9.0-pre5"
copyright = "© 2001-2002 Donald N. Allingham"
authors = ["Donald N. Allingham", "David Hampton","Donald A. Peterson"]
comments = _("GRAMPS (Genealogical Research and Analysis "

View File

@ -148,11 +148,15 @@ class Gramps:
self.report_button = self.gtop.get_widget("reports")
self.tool_button = self.gtop.get_widget("tools")
self.remove_button = self.gtop.get_widget("removebtn")
self.edit_button = self.gtop.get_widget("editbtn")
self.sidebar = self.gtop.get_widget('side_event')
self.filterbar = self.gtop.get_widget('filterbar')
self.tool_button.set_sensitive(0)
self.report_button.set_sensitive(0)
self.remove_button.set_sensitive(0)
self.edit_button.set_sensitive(0)
set_panel(self.sidebar)
set_panel(self.gtop.get_widget('side_people'))
@ -632,10 +636,7 @@ class Gramps:
def full_update(self):
"""Brute force display update, updating all the pages"""
self.id2col = {}
for model in self.pl_page:
model.clear()
self.apply_filter()
self.complete_rebuild()
self.family_view.load_family()
self.source_view.load_sources()
self.place_view.load_places()
@ -927,11 +928,15 @@ class Gramps:
self.tools_menu.set_sensitive(1)
self.report_button.set_sensitive(1)
self.tool_button.set_sensitive(1)
self.remove_button.set_sensitive(1)
self.edit_button.set_sensitive(1)
else:
self.report_menu.set_sensitive(0)
self.tools_menu.set_sensitive(0)
self.report_button.set_sensitive(0)
self.tool_button.set_sensitive(0)
self.remove_button.set_sensitive(0)
self.edit_button.set_sensitive(0)
def modify_statusbar(self):
if self.active_person == None:
@ -1343,8 +1348,17 @@ class Gramps:
ErrorDialog(msg)
self.status_text("")
def complete_rebuild(self):
self.status_text(_("Updating display..."))
keys = self.alpha_page.keys()
for key in keys:
self.alpha_page[key].new_model()
self.apply_filter()
for key in keys:
self.alpha_page[key].connect_model()
self.modify_statusbar()
def apply_filter(self):
self.status_text(_("Updating display"))
datacomp = self.DataFilter.compare
for key in self.db.getPersonKeys():
@ -1372,7 +1386,6 @@ class Gramps:
if self.id2col.has_key(key):
(model,iter,page) = self.id2col[key]
model.remove(iter)
self.modify_statusbar()
def on_home_clicked(self,obj):
temp = self.db.getDefaultPerson()