Faster load times for places

svn: r1364
This commit is contained in:
Don Allingham 2003-03-20 02:54:28 +00:00
parent c571927351
commit 64de2e6acf
4 changed files with 37 additions and 10 deletions

View File

@ -372,7 +372,10 @@ class SingleDate:
vals = string.split(v,'-')
self.setYearVal(vals[0])
if len(vals) > 1:
try:
self.setMonthVal(int(vals[1]))
except:
self.month = UNDEF
else:
self.month = UNDEF
if len(vals) > 2:

View File

@ -110,7 +110,13 @@ class PlaceView:
on large databases, and should only be called when absolutely
necessary"""
self.model.clear()
self.model = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING,
gobject.TYPE_STRING, gobject.TYPE_STRING,
gobject.TYPE_STRING, gobject.TYPE_STRING,
gobject.TYPE_STRING, gobject.TYPE_STRING,
gobject.TYPE_STRING, gobject.TYPE_STRING,
gobject.TYPE_STRING, gobject.TYPE_STRING,
gobject.TYPE_STRING)
self.id2col = {}
for key in self.db.getPlaceKeys():
@ -124,7 +130,8 @@ class PlaceView:
8, val[8], 9, val[9], 10, val[10], 11, val[11],
12, val[12]
)
self.list.connect('button-press-event',self.button_press)
self.list.set_model(self.model)
self.list.get_column(0).clicked()
def merge(self):

View File

@ -109,6 +109,7 @@ class Gramps:
self.DataFilter = Filter.Filter("")
self.parents_index = 0
self.active_person = None
self.place_loaded = 0
self.bookmarks = None
self.c_details = 6
self.id2col = {}
@ -627,6 +628,7 @@ class Gramps:
self.pedigree_view.clear()
self.source_view.load_sources()
self.place_view.load_places()
self.place_loaded = 0
self.media_view.load_media()
def tool_callback(self,val):
@ -638,16 +640,25 @@ class Gramps:
"""Brute force display update, updating all the pages"""
self.complete_rebuild()
page = self.notebook.get_current_page()
if page == 1:
self.family_view.load_family()
self.source_view.load_sources()
self.place_view.load_places()
elif page == 2:
self.pedigree_view.load_canvas(self.active_person)
elif page == 3:
self.source_view.load_sources()
elif page == 4:
self.place_view.load_places()
self.place_loaded = 1
elif page == 5:
self.media_view.load_media()
self.toolbar.set_style(GrampsCfg.toolbar)
def update_display(self,changed):
"""Incremental display update, update only the displayed page"""
page = self.notebook.get_current_page()
if page == 0:
if changed:
self.apply_filter()
@ -661,6 +672,7 @@ class Gramps:
self.source_view.load_sources()
elif page == 4:
self.place_view.load_places()
self.place_loaded = 1
else:
self.media_view.load_media()
@ -721,6 +733,7 @@ class Gramps:
self.loadsaved_file)
else:
self.active_person = None
self.place_loaded = 0
self.read_file(filename)
def autosave_query(self):
@ -1040,6 +1053,7 @@ class Gramps:
file = self.db.getSavePath()
self.db.new()
self.active_person = None
self.place_loaded = 0
self.id2col = {}
self.read_file(file)
Utils.clearModified()
@ -1103,6 +1117,9 @@ class Gramps:
def on_places_activate(self,obj):
"""Switches to the places view"""
if self.place_loaded == 0:
self.place_view.load_places()
self.place_loaded = 1
self.notebook.set_current_page(4)
def on_media_activate(self,obj):