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:
Benny Malengier 2008-01-17 21:52:13 +00:00
parent 2fe1963bc3
commit 65141d25ac
3 changed files with 32 additions and 17 deletions

View File

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

View File

@ -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):
@ -104,7 +105,7 @@ class EditChildRef(EditSecondary):
def _connect_signals(self):
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'))

View File

@ -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,9 +250,12 @@ 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:
self.call_edit_childref(handle)
def call_edit_childref(self, handle):
from Editors import EditChildRef
for ref in self.family.get_child_ref_list():
@ -264,7 +269,7 @@ class ChildEmbedList(EmbeddedList):
pass
break
def edit_button_clicked(self, obj):
def edit_child_button_clicked(self, obj):
handle = self.get_selected()
if handle:
from Editors import EditPerson