* 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


svn: r5902
This commit is contained in:
Don Allingham 2006-02-09 00:35:46 +00:00
parent 6c72bc6f77
commit 3b92398870
5 changed files with 51 additions and 26 deletions

View File

@ -1,4 +1,8 @@
2006-02-08 Don Allingham <don@gramps-project.org>
* 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

View File

@ -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)

View File

@ -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):

View File

@ -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)

View File

@ -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', "<control>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', "<control>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', '<control>d', None, self.add_bookmark),
('EditBook', None, '_Edit bookmarks', '<control>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', "<control>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', "<control>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', '<control>d', None, self.add_bookmark),
('EditBook', None, '_Edit bookmarks', '<control>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','<control>z',None,self.undo)])
self.undoactions.set_sensitive(False)
self.redoactions.add_actions([
('Redo',gtk.STOCK_REDO,'_Redo','<shift><control>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):