2008-01-17 Benny Malengier <benny.malengier@gramps-project.org>
* src/Editors/_EditChildRef.py: set focus on OK button for quick work * src/Editors/_EditFamily.py: double click on child, adding child choosing existing child, brings up child ref editor, #1462 svn: r9872
This commit is contained in:
parent
2fe1963bc3
commit
65141d25ac
@ -1,3 +1,9 @@
|
||||
|
||||
2008-01-17 Benny Malengier <benny.malengier@gramps-project.org>
|
||||
* src/Editors/_EditChildRef.py: set focus on OK button for quick work
|
||||
* src/Editors/_EditFamily.py: double click on child, adding child
|
||||
choosing existing child, brings up child ref editor, #1462
|
||||
|
||||
2008-01-17 Raphael Ackermann <raphael.ackermann@gmail.com>
|
||||
* src/ScratchPad.py: remove tooltip for events as it crashes.
|
||||
* src/Utils.py: cleanup
|
||||
|
@ -77,6 +77,7 @@ class EditChildRef(EditSecondary):
|
||||
self.top.get_widget("title"),
|
||||
self.name,
|
||||
_('Child Reference Editor'))
|
||||
self.ok_button = self.top.get_widget('ok')
|
||||
|
||||
def _setup_fields(self):
|
||||
|
||||
@ -102,9 +103,9 @@ class EditChildRef(EditSecondary):
|
||||
self.db.readonly)
|
||||
|
||||
def _connect_signals(self):
|
||||
self.define_help_button(self.top.get_widget('help'),'adv-ad')
|
||||
self.define_help_button(self.top.get_widget('help'), 'adv-ad')
|
||||
self.define_cancel_button(self.top.get_widget('cancel'))
|
||||
self.define_ok_button(self.top.get_widget('ok'),self.save)
|
||||
self.define_ok_button(self.ok_button, self.save)
|
||||
|
||||
def _create_tabbed_pages(self):
|
||||
"""
|
||||
@ -128,6 +129,9 @@ class EditChildRef(EditSecondary):
|
||||
notebook.show_all()
|
||||
self.top.get_widget('vbox').pack_start(notebook,True)
|
||||
|
||||
def _post_init(self):
|
||||
self.ok_button.grab_focus()
|
||||
|
||||
def build_menu_names(self,obj):
|
||||
return (_('Child Reference'),_('Child Reference Editor'))
|
||||
|
||||
|
@ -111,8 +111,8 @@ class ChildEmbedList(EmbeddedList):
|
||||
return [
|
||||
(True, True, gtk.STOCK_ADD, self.add_button_clicked),
|
||||
(True, False, _('Add an existing child'), self.share_button_clicked),
|
||||
(False,True, _('Edit relationship'), self.edit_relation_button_clicked),
|
||||
(False,True, _('Edit child'), self.edit_button_clicked),
|
||||
(False,True, _('Edit relationship'), self.edit_button_clicked),
|
||||
(False,True, _('Edit child'), self.edit_child_button_clicked),
|
||||
(True, True, gtk.STOCK_REMOVE, self.del_button_clicked),
|
||||
]
|
||||
|
||||
@ -214,6 +214,7 @@ class ChildEmbedList(EmbeddedList):
|
||||
ref.ref = person.get_handle()
|
||||
self.family.add_child_ref(ref)
|
||||
self.rebuild()
|
||||
self.call_edit_childref(ref.ref)
|
||||
|
||||
def child_ref_edited(self, person):
|
||||
self.rebuild()
|
||||
@ -234,6 +235,7 @@ class ChildEmbedList(EmbeddedList):
|
||||
ref.ref = person.get_handle()
|
||||
self.family.add_child_ref(ref)
|
||||
self.rebuild()
|
||||
self.call_edit_childref(ref.ref)
|
||||
|
||||
def run(self,skip):
|
||||
skip_list = [ x for x in skip if x]
|
||||
@ -248,23 +250,26 @@ class ChildEmbedList(EmbeddedList):
|
||||
self.family.remove_child_ref(ref)
|
||||
self.rebuild()
|
||||
|
||||
def edit_relation_button_clicked(self,obj):
|
||||
def edit_button_clicked(self,obj):
|
||||
handle = self.get_selected()
|
||||
if handle:
|
||||
from Editors import EditChildRef
|
||||
self.call_edit_childref(handle)
|
||||
|
||||
for ref in self.family.get_child_ref_list():
|
||||
if ref.ref == handle:
|
||||
p = self.dbstate.db.get_person_from_handle(handle)
|
||||
n = name_displayer.display(p)
|
||||
try:
|
||||
EditChildRef(n, self.dbstate, self.uistate, self.track,
|
||||
ref, self.child_ref_edited)
|
||||
except Errors.WindowActiveError:
|
||||
pass
|
||||
break
|
||||
def call_edit_childref(self, handle):
|
||||
from Editors import EditChildRef
|
||||
|
||||
def edit_button_clicked(self, obj):
|
||||
for ref in self.family.get_child_ref_list():
|
||||
if ref.ref == handle:
|
||||
p = self.dbstate.db.get_person_from_handle(handle)
|
||||
n = name_displayer.display(p)
|
||||
try:
|
||||
EditChildRef(n, self.dbstate, self.uistate, self.track,
|
||||
ref, self.child_ref_edited)
|
||||
except Errors.WindowActiveError:
|
||||
pass
|
||||
break
|
||||
|
||||
def edit_child_button_clicked(self, obj):
|
||||
handle = self.get_selected()
|
||||
if handle:
|
||||
from Editors import EditPerson
|
||||
|
Loading…
Reference in New Issue
Block a user