* 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:
parent
569e437fa4
commit
a4343f0de8
@ -1,4 +1,7 @@
|
|||||||
2006-11-05 Don Allingham <don@gramps-project.org>
|
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/DataViews/_PlaceView.py: drag-n-drop support
|
||||||
* src/GrampsWidgets.py: drag-n-drop support for place selector widget
|
* src/GrampsWidgets.py: drag-n-drop support for place selector widget
|
||||||
* src/ScratchPad.py: drag-n-drop support for places
|
* src/ScratchPad.py: drag-n-drop support for places
|
||||||
|
@ -493,7 +493,24 @@ class PersonView(PageView.PersonNavView):
|
|||||||
|
|
||||||
def add(self,obj):
|
def add(self,obj):
|
||||||
person = RelLib.Person()
|
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:
|
try:
|
||||||
|
person.get_primary_name().set_surname(name)
|
||||||
EditPerson(self.dbstate, self.uistate, [], person)
|
EditPerson(self.dbstate, self.uistate, [], person)
|
||||||
except Errors.WindowActiveError:
|
except Errors.WindowActiveError:
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user