diff --git a/gramps/gui/editors/editcitation.py b/gramps/gui/editors/editcitation.py
index df3464715..e535e4931 100644
--- a/gramps/gui/editors/editcitation.py
+++ b/gramps/gui/editors/editcitation.py
@@ -174,7 +174,8 @@ class EditCitation(EditPrimary):
self.glade.get_object("source"),
self.obj.set_reference_handle,
self.obj.get_reference_handle,
- self.add_del_btn, self.share_btn)
+ self.add_del_btn, self.share_btn,
+ callback=self.source_changed)
self.date = MonitoredDate(
self.glade.get_object("date_entry"),
@@ -249,6 +250,21 @@ class EditCitation(EditPrimary):
notebook.show_all()
self.glade.get_object('vbox').pack_start(notebook, True, True, 0)
+ def source_changed(self):
+ handle = self.obj.get_reference_handle()
+ if handle:
+ source = self.db.get_source_from_handle(handle)
+ author = source.get_author()
+ pub_info = source.get_publication_info()
+ abbrev = source.get_abbreviation()
+ else:
+ author = ''
+ pub_info = ''
+ abbrev = ''
+ self.glade.get_object("author").set_text(author)
+ self.glade.get_object("pub_info").set_text(pub_info)
+ self.glade.get_object("abbrev").set_text(abbrev)
+
def build_menu_names(self, source):
"""
Provide the information needed by the base class to define the
diff --git a/gramps/gui/editors/objectentries.py b/gramps/gui/editors/objectentries.py
index a6faf8b8d..b7c4355a7 100644
--- a/gramps/gui/editors/objectentries.py
+++ b/gramps/gui/editors/objectentries.py
@@ -78,7 +78,7 @@ class ObjEntry(object):
DEL_STR = ""
def __init__(self, dbstate, uistate, track, label, set_val,
- get_val, add_edt, share):
+ get_val, add_edt, share, callback=None):
"""Pass the dbstate and uistate and present track.
label is a Gtk.Label that shows the persent value
set_val is function that is called when handle changes, use it
@@ -98,6 +98,7 @@ class ObjEntry(object):
self.set_val = set_val
self.uistate = uistate
self.track = track
+ self.callback = callback
#connect drag and drop
self._init_dnd()
@@ -141,6 +142,8 @@ class ObjEntry(object):
else:
self.label.set_text(name)
self.label.set_ellipsize(Pango.EllipsizeMode.END)
+ if self.callback:
+ self.callback()
def _init_dnd(self):
"""inheriting objects must set this
@@ -167,6 +170,8 @@ class ObjEntry(object):
def after_edit(self, obj):
name = self.get_label(obj)
self.label.set_text(name)
+ if self.callback:
+ self.callback()
def add_edt_clicked(self, obj):
""" if value, edit, if no value, call editor on new object
@@ -198,6 +203,8 @@ class ObjEntry(object):
self.set_val(data.handle)
self.label.set_text(self.get_label(data))
self.set_button(True)
+ if self.callback:
+ self.callback()
def share_clicked(self, obj):
""" if value, delete connect, in no value, select existing object
@@ -207,6 +214,8 @@ class ObjEntry(object):
self.label.set_text(self.EMPTY_TEXT)
self.label.set_use_markup(True)
self.set_button(False)
+ if self.callback:
+ self.callback()
else:
select = self.call_selector()
obj = select.run()
@@ -315,9 +324,9 @@ class SourceEntry(ObjEntry):
DEL_STR = _('Remove source')
def __init__(self, dbstate, uistate, track, label, set_val,
- get_val, add_edt, share):
+ get_val, add_edt, share, callback):
ObjEntry.__init__(self, dbstate, uistate, track, label, set_val,
- get_val, add_edt, share)
+ get_val, add_edt, share, callback)
def _init_dnd(self):
"""connect drag and drop of sources
diff --git a/gramps/gui/glade/editcitation.glade b/gramps/gui/glade/editcitation.glade
index 23b5fbf4a..a30dcfbf7 100644
--- a/gramps/gui/glade/editcitation.glade
+++ b/gramps/gui/glade/editcitation.glade
@@ -79,13 +79,28 @@