diff --git a/src/EditPerson.glade b/src/EditPerson.glade index 59aa0702a..11b8ddc96 100644 --- a/src/EditPerson.glade +++ b/src/EditPerson.glade @@ -3745,7 +3745,7 @@ GtkEntry event_source True - True + False True 0 @@ -3764,9 +3764,9 @@ True clicked - on_showsource_clicked - eventList - Thu, 11 Jan 2001 04:08:33 GMT + on_source_clicked + event_edit + Fri, 27 Jul 2001 01:05:33 GMT GTK_RELIEF_NORMAL diff --git a/src/EditPerson.py b/src/EditPerson.py index 496fbf38c..309381a8c 100644 --- a/src/EditPerson.py +++ b/src/EditPerson.py @@ -807,7 +807,6 @@ def on_add_address_clicked(obj): # #------------------------------------------------------------------------- def on_event_add_clicked(obj): - epo = obj.get_data(EDITPERSON) editor = EventEditor(epo,None) @@ -1444,6 +1443,7 @@ class EventEditor: self.descr_field = self.top.get_widget("eventDescription") self.note_field = self.top.get_widget("eventNote") self.event_menu = self.top.get_widget("personalEvents") + self.source_field = self.top.get_widget("event_source") name = parent.person.getPrimaryName().getName() @@ -1454,6 +1454,12 @@ class EventEditor: self.place_field.set_text(event.getPlace()) self.date_field.set_text(event.getDate()) self.descr_field.set_text(event.getDescription()) + srcref_base = self.event.getSourceRef().getBase() + if srcref_base: + self.source_field.set_text(srcref_base.getTitle()) + else: + self.source_field.set_text("") + self.note_field.set_point(0) self.note_field.insert_defaults(event.getNote()) self.note_field.set_word_wrap(1) @@ -1462,8 +1468,18 @@ class EventEditor: self.top.signal_autoconnect({ "destroy_passed_object" : utils.destroy_passed_object, "on_event_edit_ok_clicked" : on_event_edit_ok_clicked, + "on_source_clicked" : on_source_clicked, "on_event_edit_apply_clicked" : on_event_edit_apply_clicked }) + +#------------------------------------------------------------------------- +# +# +# +#------------------------------------------------------------------------- +def on_source_clicked(obj): + ee = obj.get_data("o") + Sources.SourceEditor(ee.event,ee.parent.db,ee.source_field) #------------------------------------------------------------------------- # diff --git a/src/Sources.py b/src/Sources.py index da68d423b..a361c3c80 100644 --- a/src/Sources.py +++ b/src/Sources.py @@ -66,9 +66,10 @@ class SourceEditor: # __init__ - Creates a source editor window associated with an event # #--------------------------------------------------------------------- - def __init__(self,active_entry,database): + def __init__(self,active_entry,database,update=None): self.db = database + self.update = update self.active_entry = active_entry self.showSource = libglade.GladeXML(const.gladeFile, "sourceDisplay") self.showSource.signal_autoconnect({ @@ -182,6 +183,10 @@ def on_sourceok_clicked(obj): current_source_ref.getDate().set(date) current_source_ref.setText(text) current_source_ref.setComments(comments) + + if src_edit.update: + src_edit.update.set_text(current_source_ref.getBase().getTitle()) + utils.modified() utils.destroy_passed_object(obj)