* src/DataViews/_PersonView.py: provide a default surname for and Add

Person button press based of selected item in the Person View tree.
	* help/C/various: remove unused files from manual


svn: r7557
This commit is contained in:
Don Allingham 2006-11-06 00:41:13 +00:00
parent 569e437fa4
commit a4343f0de8
2 changed files with 20 additions and 0 deletions

View File

@ -1,4 +1,7 @@
2006-11-05 Don Allingham <don@gramps-project.org>
* src/DataViews/_PersonView.py: provide a default surname for and Add
Person button press based of selected item in the Person View tree.
* help/C/various: remove unused files from manual
* src/DataViews/_PlaceView.py: drag-n-drop support
* src/GrampsWidgets.py: drag-n-drop support for place selector widget
* src/ScratchPad.py: drag-n-drop support for places

View File

@ -493,7 +493,24 @@ class PersonView(PageView.PersonNavView):
def add(self,obj):
person = RelLib.Person()
# attempt to get the current surname
(mode,paths) = self.selection.get_selected_rows()
name = u""
if len(paths) == 1:
path = paths[0]
if len(path) == 1:
name = self.model.on_get_iter(path)
else:
node = self.model.on_get_iter(path)
handle = self.model.on_get_value(node, PeopleModel.COLUMN_INT_ID)
p = self.dbstate.db.get_person_from_handle(handle)
name = p.get_primary_name().get_surname()
try:
person.get_primary_name().set_surname(name)
EditPerson(self.dbstate, self.uistate, [], person)
except Errors.WindowActiveError:
pass