diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 413ba691d..6c45af196 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,12 @@ +2004-08-28 Don Allingham + * src/DbPrompter.py: cleanup dialogs + * src/EditPerson.py: update screen properly + * src/PeopleModel.py: handle stored maps correctly + * src/PeopleView.py: handle stored maps correctly + * src/gramps_main.py: eliminate unnecessary rebuilds, display + loading dialog + * src/gramp.glade: loading dialog + 2004-08-25 Jim Smart * src/RelLib.py: guess_gender fix diff --git a/gramps2/src/DbPrompter.py b/gramps2/src/DbPrompter.py index 5be365de4..485c546f7 100644 --- a/gramps2/src/DbPrompter.py +++ b/gramps2/src/DbPrompter.py @@ -76,12 +76,15 @@ class DbPrompter: new.set_active(want_new) while 1: + top.show() response = top.run() + top.hide() if response == gtk.RESPONSE_OK: if new.get_active(): prompter = NewNativeDbPrompter(self.parent,self.parent_window) else: prompter = ExistingDbPrompter(self.parent,self.parent_window) + if prompter.chooser(): break elif response == gtk.RESPONSE_CANCEL: @@ -179,7 +182,10 @@ class ExistingDbPrompter: if filetype == const.app_gramps: choose.destroy() self.parent.db = GrampsBSDDB.GrampsBSDDB() + msgxml = gtk.glade.XML(const.gladeFile, "load_message","gramps") + msg_top = msgxml.get_widget('load_message') self.parent.read_file(filename) + msg_top.destroy() return 1 elif filetype == const.app_gramps_xml: choose.destroy() diff --git a/gramps2/src/EditPerson.py b/gramps2/src/EditPerson.py index 6c9b00f2a..0df7a4a80 100644 --- a/gramps2/src/EditPerson.py +++ b/gramps2/src/EditPerson.py @@ -1622,7 +1622,7 @@ class EditPerson: self.db.transaction_commit(trans,_("Edit Person (%s)") % n) self.update_lists() if self.callback: - self.callback(self,0) + self.callback(self,1) self.close() def get_place(self,field,makenew=0): diff --git a/gramps2/src/PeopleModel.py b/gramps2/src/PeopleModel.py index 74cd7b135..c54d475c8 100644 --- a/gramps2/src/PeopleModel.py +++ b/gramps2/src/PeopleModel.py @@ -75,7 +75,7 @@ class PeopleModel(gtk.GenericTreeModel): self.top_visible = {} maps = self.db.get_people_view_maps() - if maps[0] != None and len(maps[0]) != 0: + if maps[1] != None and len(maps[1]) != 0: self.top_path2iter = maps[1] self.iter2path = maps[2] self.path2iter = maps[3] @@ -87,6 +87,11 @@ class PeopleModel(gtk.GenericTreeModel): # self.connect('row-inserted',self.on_row_inserted) def rebuild_data(self): + + import traceback + + print traceback.print_stack() + self.top_path2iter = [] self.iter2path = {} self.path2iter = {} @@ -230,7 +235,7 @@ class PeopleModel(gtk.GenericTreeModel): def on_iter_nth_child(self,node,n): if node == None: - return self.top_path2iter.get(n) + return self.top_path2iter[n] try: path = self.top_path2iter.index(node) return self.path2iter[(node,n)] diff --git a/gramps2/src/PeopleView.py b/gramps2/src/PeopleView.py index 126b948d9..3b784fd09 100644 --- a/gramps2/src/PeopleView.py +++ b/gramps2/src/PeopleView.py @@ -115,8 +115,12 @@ class PeopleView: index += 1 def build_tree(self): + import time + t = time.time() self.person_model = PeopleModel.PeopleModel(self.parent.db) - self.sort_model = self.person_model.filter_new() + print "new",time.time() - t + #self.sort_model = self.person_model.filter_new() + self.sort_model = self.person_model self.person_tree.set_model(self.sort_model) def blist(self, store, path, iter, id_list): @@ -145,9 +149,8 @@ class PeopleView: self.build_columns() maps = db.get_people_view_maps() self.person_model = PeopleModel.PeopleModel(db) - if not maps[0]: - self.build_tree() - self.sort_model = self.person_model.filter_new() + #self.sort_model = self.person_model.filter_new() + self.sort_model = self.person_model self.person_tree.set_model(self.sort_model) def remove_from_person_list(self,person): @@ -174,6 +177,7 @@ class PeopleView: self.parent.mhistory.remove(del_id) def apply_filter_clicked(self): + print "Applying Filter" mi = self.parent.filter_list.get_menu().get_active() self.DataFilter = mi.get_data("filter") if self.DataFilter.need_param: @@ -181,6 +185,7 @@ class PeopleView: self.DataFilter.set_parameter(qual) self.apply_filter() self.goto_active_person() + print "Done" def add_to_person_list(self,person,change=0): self.apply_filter_clicked() @@ -207,7 +212,7 @@ class PeopleView: for person_handle in keys: self.person_model.set_visible(person_handle,1) - self.sort_model.refilter() + #self.sort_model.refilter() self.parent.modify_statusbar() def on_plist_button_press(self,obj,event): @@ -255,7 +260,5 @@ class PeopleView: menu.popup(None,None,None,event.button,event.time) def redisplay_person_list(self,person): - self.person_model = PeopleModel.PeopleModel(self.parent.db) - self.sort_model = self.person_model.filter_new() - self.person_tree.set_model(self.sort_model) + self.build_tree() diff --git a/gramps2/src/gramps.glade b/gramps2/src/gramps.glade index 19cfa1626..f2c9e8912 100644 --- a/gramps2/src/gramps.glade +++ b/gramps2/src/gramps.glade @@ -30814,4 +30814,99 @@ Other + + True + GRAMPS - Loading Database + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ALWAYS + False + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + + + + 12 + True + 2 + 2 + False + 0 + 0 + + + + True + gtk-dialog-info + 6 + 0.5 + 0 + 0 + 0 + + + 0 + 1 + 0 + 2 + fill + fill + + + + + + True + <span size="larger" weight="bold">Loading Database</span> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + GRAMPS is loading the database you selected. Please wait. + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 1 + 2 + 1 + 2 + fill + + + + + + + diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index 51d8a36fd..5e0978345 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -173,12 +173,12 @@ class Gramps: GrampsCfg.client.notify_add("/apps/gramps/preferences/date-entry", self.date_entry_key_update) self.topWindow.show() - + if GrampsCfg.get_usetips(): TipOfDay.TipOfDay() self.db.set_researcher(GrampsCfg.get_researcher()) - self.update_display(0) + #self.update_display(0) def date_format_key_update(self,client,cnxn_id,entry,data): GrampsCfg.set_calendar_date_format() @@ -1090,7 +1090,7 @@ class Gramps: return 0 self.topWindow.set_resizable(gtk.TRUE) - self.people_view.apply_filter() + #self.people_view.apply_filter() self.goto_active_person() return 1 @@ -1532,7 +1532,6 @@ class Gramps: self.place_view.change_db(self.db) self.source_view.change_db(self.db) self.media_view.change_db(self.db) - #self.full_update() self.change_active_person(self.find_initial_person()) self.statusbar.set_progress_percentage(0.0)