diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 0901308d9..ac1aeefb9 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,8 @@ 2006-02-08 Don Allingham + * src/EditFamily.py: set focus on surname + * src/EditPerson.py: hook up add child + * src/PersonView.py: fix delete person dispay + * src/ViewManager.py: re-enable bookmark functions * src/DisplayTabs.py: pychecker fixes * src/EditMedia.py: Handle Note types properly * src/EditPerson.py: minor cleanup diff --git a/gramps2/src/EditFamily.py b/gramps2/src/EditFamily.py index 8c5678fa2..39bac4727 100644 --- a/gramps2/src/EditFamily.py +++ b/gramps2/src/EditFamily.py @@ -173,6 +173,26 @@ class ChildEmbedList(EmbeddedList): # Connect this to the method used to add a new child. #selector.connect('add-object',self.on_add_child) + selector.connect('add-object',self.on_change_child) + + def on_change_child(self, selector_window, obj): + if obj.__class__ == RelLib.Person: + try: + person = obj + self.family.add_child_handle(person.get_handle()) + self.rebuild() + except: + log.warn( + "Failed to update child: \n" + "obj returned from selector was: %s\n" + % (repr(obj),)) + raise + else: + log.warn( + "Object selector returned obj.__class__ = %s, it should " + "have been of type %s." % (obj.__class__.__name__, + RelLib.Person.__name__)) + selector_window.close() def del_button_clicked(self,obj): handle = self.get_selected() @@ -374,6 +394,7 @@ class EditFamily(DisplayState.ManagedWindow): RelLib.Person.__name__)) selector_window.close() + def mother_clicked(self,obj): handle = self.family.get_mother_handle() @@ -400,7 +421,6 @@ class EditFamily(DisplayState.ManagedWindow): selector = PersonSelector(self.dbstate,self.uistate, self.track,filter_spec=filter_spec) - selector.set_transient_for(self.window) selector.connect('add-object',self.on_change_mother) @@ -448,7 +468,6 @@ class EditFamily(DisplayState.ManagedWindow): selector = PersonSelector(self.dbstate,self.uistate, self.track,filter_spec=filter_spec) - selector.set_transient_for(self.window) selector.connect('add-object',self.on_change_father) diff --git a/gramps2/src/EditPerson.py b/gramps2/src/EditPerson.py index a1df6a218..3cf00de93 100644 --- a/gramps2/src/EditPerson.py +++ b/gramps2/src/EditPerson.py @@ -227,7 +227,7 @@ class EditPerson(DisplayState.ManagedWindow): self._create_tabbed_pages() - self.given.grab_focus() + self.surname.grab_focus() self.show() def _add_page(self,page): diff --git a/gramps2/src/PersonView.py b/gramps2/src/PersonView.py index 88cd13583..fa7b92f32 100644 --- a/gramps2/src/PersonView.py +++ b/gramps2/src/PersonView.py @@ -502,21 +502,22 @@ class PersonView(PageView.PersonNavView): def person_removed(self,handle_list): for node in handle_list: person = self.dbstate.db.get_person_from_handle(node) - if not self.model.is_visable(node): - continue top = person.get_primary_name().get_group_name() mylist = self.model.sname_sub.get(top,[]) + self.model.calculate_data() if mylist: try: path = self.model.on_get_path(node) self.model.row_deleted(path) + print "delete",path if len(mylist) == 1: path = self.model.on_get_path(top) + print "delete",path self.model.row_deleted(path) except KeyError: pass - self.model.rebuild_data() - + self.model.assign_data() + def person_updated(self,handle_list): for node in handle_list: person = self.dbstate.db.get_person_from_handle(node) diff --git a/gramps2/src/ViewManager.py b/gramps2/src/ViewManager.py index 46036cf59..035d1df2e 100644 --- a/gramps2/src/ViewManager.py +++ b/gramps2/src/ViewManager.py @@ -318,24 +318,24 @@ class ViewManager: self.actiongroup.add_actions([ # Name Stock Icon Label - ('SaveAs', gtk.STOCK_SAVE_AS, '_Save As'), - ('Export', gtk.STOCK_SAVE_AS, '_Export', "e", None, self.export_data), - ('Abandon', gtk.STOCK_REVERT_TO_SAVED, '_Abandon changes and quit'), - ('CmpMerge', None, '_Compare and merge'), - ('FastMerge', None, '_Fast merge'), - ('ScratchPad', gtk.STOCK_PASTE, '_ScratchPad', None, None, self.scratchpad), - ('Import', gtk.STOCK_CONVERT, '_Import', "i", None, self.import_data), - ('Reports', gtk.STOCK_DND_MULTIPLE, '_Reports', None, None, self.reports_clicked), - ('Tools', gtk.STOCK_EXECUTE, '_Tools', None, None, self.tools_clicked), - ('EditMenu', None, '_Edit'), - ('GoMenu', None, '_Go'), - ('BookMenu', None, '_Bookmarks'), - ('AddBook', gtk.STOCK_INDEX, '_Add bookmark', 'd', None, self.add_bookmark), - ('EditBook', None, '_Edit bookmarks', 'b'), - ('GoToBook', gtk.STOCK_JUMP_TO, '_Go to bookmark'), - ('ReportsMenu',None, '_Reports'), - ('ToolsMenu', None, '_Tools'), - ('WindowsMenu',None, '_Windows'), + ('SaveAs', gtk.STOCK_SAVE_AS, '_Save As'), + ('Export', gtk.STOCK_SAVE_AS, '_Export', "e", None, self.export_data), + ('Abandon', gtk.STOCK_REVERT_TO_SAVED, '_Abandon changes and quit'), + ('CmpMerge', None, '_Compare and merge'), + ('FastMerge', None, '_Fast merge'), + ('ScratchPad', gtk.STOCK_PASTE, '_ScratchPad', None, None, self.scratchpad), + ('Import', gtk.STOCK_CONVERT, '_Import', "i", None, self.import_data), + ('Reports', gtk.STOCK_DND_MULTIPLE, '_Reports', None, None, self.reports_clicked), + ('Tools', gtk.STOCK_EXECUTE, '_Tools', None, None, self.tools_clicked), + ('EditMenu', None, '_Edit'), + ('GoMenu', None, '_Go'), + ('BookMenu', None, '_Bookmarks'), + ('AddBook', gtk.STOCK_INDEX, '_Add bookmark', 'd', None, self.add_bookmark), + ('EditBook', None, '_Edit bookmarks', 'b', None, self.edit_bookmarks), + ('GoToBook', gtk.STOCK_JUMP_TO, '_Go to bookmark'), + ('ReportsMenu', None, '_Reports'), + ('ToolsMenu', None, '_Tools'), + ('WindowsMenu', None, '_Windows'), ]) self.fileactions.add_toggle_actions([ @@ -350,6 +350,7 @@ class ViewManager: self.undoactions.add_actions([ ('Undo',gtk.STOCK_UNDO,'_Undo','z',None,self.undo)]) self.undoactions.set_sensitive(False) + self.redoactions.add_actions([ ('Redo',gtk.STOCK_REDO,'_Redo','z',None,self.redo) ]) @@ -838,7 +839,7 @@ class ViewManager: _("A bookmark could not be set because " "no one was selected.")) - def on_edit_bookmarks_activate(self,obj): + def edit_bookmarks(self,obj): self.bookmarks.edit() def reports_clicked(self,obj):