Source handling with new edit person dialog
svn: r262
This commit is contained in:
parent
88c516814f
commit
3baaf32e62
@ -3745,7 +3745,7 @@
|
||||
<class>GtkEntry</class>
|
||||
<name>event_source</name>
|
||||
<can_focus>True</can_focus>
|
||||
<editable>True</editable>
|
||||
<editable>False</editable>
|
||||
<text_visible>True</text_visible>
|
||||
<text_max_length>0</text_max_length>
|
||||
<text></text>
|
||||
@ -3764,9 +3764,9 @@
|
||||
<can_focus>True</can_focus>
|
||||
<signal>
|
||||
<name>clicked</name>
|
||||
<handler>on_showsource_clicked</handler>
|
||||
<object>eventList</object>
|
||||
<last_modification_time>Thu, 11 Jan 2001 04:08:33 GMT</last_modification_time>
|
||||
<handler>on_source_clicked</handler>
|
||||
<object>event_edit</object>
|
||||
<last_modification_time>Fri, 27 Jul 2001 01:05:33 GMT</last_modification_time>
|
||||
</signal>
|
||||
<label>Edit Source</label>
|
||||
<relief>GTK_RELIEF_NORMAL</relief>
|
||||
|
@ -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)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user