* 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 47091ad736
commit dcdd9e9765
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()
@ -375,6 +395,7 @@ class EditFamily(DisplayState.ManagedWindow):
selector_window.close()
def mother_clicked(self,obj):
handle = self.family.get_mother_handle()
if 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,20 +502,21 @@ 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:

View File

@ -331,7 +331,7 @@ class ViewManager:
('GoMenu', None, '_Go'),
('BookMenu', None, '_Bookmarks'),
('AddBook', gtk.STOCK_INDEX, '_Add bookmark', '<control>d', None, self.add_bookmark),
('EditBook', None, '_Edit bookmarks', '<control>b'),
('EditBook', None, '_Edit bookmarks', '<control>b', None, self.edit_bookmarks),
('GoToBook', gtk.STOCK_JUMP_TO, '_Go to bookmark'),
('ReportsMenu', None, '_Reports'),
('ToolsMenu', None, '_Tools'),
@ -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):