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 @@ True False 12 - 5 + 8 4 12 6 + + + + + + + + + + + + + + + True @@ -97,8 +112,8 @@ date_entry - 1 - 2 + 4 + 5 GTK_FILL @@ -133,8 +148,8 @@ 3 4 - 1 - 2 + 4 + 5 GTK_FILL @@ -151,8 +166,8 @@ 1 3 - 2 - 3 + 5 + 6 @@ -167,8 +182,8 @@ volume - 2 - 3 + 5 + 6 GTK_FILL @@ -183,8 +198,8 @@ center - 3 - 4 + 6 + 7 GTK_FILL @@ -201,8 +216,8 @@ 1 3 - 1 - 2 + 4 + 5 @@ -268,8 +283,8 @@ Very High =Direct and primary evidence used, or by dominance of the evidence

1 3 - 3 - 4 + 6 + 7 GTK_FILL @@ -365,15 +380,12 @@ Very High =Direct and primary evidence used, or by dominance of the evidence

3 4 - 2 - 3 + 5 + 6 GTK_FILL - - - True @@ -382,8 +394,8 @@ Very High =Direct and primary evidence used, or by dominance of the evidence

Tags:
- 4 - 5 + 7 + 8 GTK_FILL @@ -398,8 +410,8 @@ Very High =Direct and primary evidence used, or by dominance of the evidence

1 2 - 4 - 5 + 7 + 8 GTK_FILL @@ -420,6 +432,93 @@ Very High =Direct and primary evidence used, or by dominance of the evidence

+ + + True + False + 1 + Author: + + + 1 + 2 + GTK_FILL + + + + + + True + False + 1 + Publication Info.: + + + 2 + 3 + GTK_FILL + + + + + + True + False + 1 + Abbreviation: + + + 3 + 4 + GTK_FILL + + + + + + True + False + 0 + + + 1 + 3 + 1 + 2 + GTK_FILL + + + + + + True + False + 0 + + + 1 + 3 + 2 + 3 + GTK_FILL + + + + + + True + False + 0 + + + 1 + 3 + 3 + 4 + GTK_FILL + + + False