Updates to people list occur only on active display

svn: r1353
This commit is contained in:
Don Allingham 2003-03-17 02:28:43 +00:00
parent 3a3d861fc6
commit 50f66cbddd
5 changed files with 43 additions and 42 deletions

2
configure vendored
View File

@ -1621,7 +1621,7 @@ fi
LANGUAGES="sv pl de fr es it pt_BR ru da_DK cs ro"
LANGUAGES="sv pl de fr es it pt_BR ru da_DK cs ro nl"
DISTLANGS=

View File

@ -18,7 +18,7 @@ AC_SUBST(VERSIONSTRING)
AC_PATH_PROG(MSGFMT, msgfmt)
AC_SUBST(MSGFMT)
LANGUAGES="sv pl de fr es it pt_BR ru da_DK cs ro"
LANGUAGES="sv pl de fr es it pt_BR ru da_DK cs ro nl"
AC_SUBST(LANGUAGES)
DISTLANGS=

View File

@ -586,10 +586,8 @@ class GrampsPreferences:
if status_bar == 0:
self.top.get_widget("stat1").set_active(1)
elif status_bar == 1:
self.top.get_widget("stat2").set_active(1)
else:
self.top.get_widget("stat3").set_active(1)
self.top.get_widget("stat2").set_active(1)
if toolbar == 0:
self.top.get_widget("tool1").set_active(1)

View File

@ -79,7 +79,7 @@ class Marriage:
self.top = gtk.glade.XML(const.marriageFile,"marriageEditor")
top_window = self.get_widget("marriageEditor")
Utils.set_titles(top_window, self.top.get_window('title'),
Utils.set_titles(top_window, self.top.get_widget('title'),
_('Marriage/Relationship Editor'))
self.icon_list = self.get_widget('iconlist')

View File

@ -757,15 +757,12 @@ class Gramps:
"a gramps.zodb file."))
return
self.status_text(_("Loading %s ...") % filename)
if self.load_database(filename) == 1:
if filename[-1] == '/':
filename = filename[:-1]
name = os.path.basename(filename)
self.topWindow.set_title("%s - GRAMPS" % name)
else:
self.status_text("")
GrampsCfg.save_last_file("")
def on_ok_button2_clicked(self,obj):
@ -949,13 +946,26 @@ class Gramps:
self.person_model = self.pl_page[0].model
self.ptabs.set_current_page(0)
return
id = self.active_person.getId()
if self.id2col.has_key(id):
(model,iter) = self.id2col[id]
else:
val = self.db.getPersonDisplay(id)
pg = val[5]
if pg:
pg = pg[0]
else:
pg = '@'
model = self.alpha_page[pg]
iter = None
self.ptabs.set_current_page(self.model2page[model])
if not self.model_used.has_key(model) or self.model_used[model] == 0:
if not self.model_used.has_key(model) or self.model_used[model] == 0 or not iter:
self.model_used[model] = 1
self.apply_filter(model)
(model,iter) = self.id2col[id]
model.selection.unselect_all()
model.selection.select_iter(iter);
@ -1133,7 +1143,8 @@ class Gramps:
class_init = mi.get_data("function")
self.DataFilter = class_init(qualifer)
self.DataFilter.set_invert(invert_filter)
self.apply_filter()
self.model_used = {}
self.apply_filter(self.person_model)
def on_filter_name_changed(self,obj):
filter = obj.get_data("filter")
@ -1304,6 +1315,7 @@ class Gramps:
return 1
def load_database(self,name):
filename = "%s/%s" % (name,const.xmlFile)
if not os.path.isfile(filename) and zodb_ok:
filename = "%s/%s" % (name,const.zodbFile)
@ -1311,8 +1323,11 @@ class Gramps:
else:
self.clear_database(0)
self.status_text(_("Loading %s ...") % name)
if self.db.load(filename,self.load_progress) == 0:
self.status_text('')
return 0
self.status_text('')
return self.post_load(name)
def load_revision(self,f,name,revision):
@ -1334,21 +1349,7 @@ class Gramps:
def complete_rebuild(self):
self.id2col = {}
self.model_used = {}
for key in self.db.getPersonKeys():
person = self.db.getPerson(key)
val = self.db.getPersonDisplay(key)
pg = val[5]
if pg:
pg = pg[0]
else:
pg = ''
if pg != '@':
if not self.alpha_page.has_key(pg):
self.create_new_panel(pg)
self.apply_filter()
self.goto_active_person()
self.modify_statusbar()
@ -1357,6 +1358,8 @@ class Gramps:
self.status_text(_('Updating display...'))
datacomp = self.DataFilter.compare
if current_model == None:
self.id2col = {}
for key in self.db.getPersonKeys():
person = self.db.getPerson(key)
@ -1365,7 +1368,7 @@ class Gramps:
if pg:
pg = pg[0]
else:
pg = ''
pg = '@'
if datacomp(person):
if self.id2col.has_key(key):
@ -1377,15 +1380,15 @@ class Gramps:
else:
model = self.default_list
if current_model == None or current_model == model:
if current_model == model:
iter = model.add([val[0],val[1],val[2],val[3],val[4],val[5],
val[6],val[7]],key)
self.id2col[key] = (model,iter)
else:
if self.id2col.has_key(key):
(model,iter) = self.id2col[key]
if current_model == None or current_model == model:
model.remove(iter)
for i in self.pl_page:
i.sort()
self.modify_statusbar()