Support for notes and sources for names

svn: r142
This commit is contained in:
Don Allingham 2001-06-16 03:23:18 +00:00
parent 3a4f4f6dc7
commit f1cd0be4e9
3 changed files with 241 additions and 88 deletions

View File

@ -560,7 +560,7 @@
<class>GtkTable</class>
<name>table15</name>
<rows>5</rows>
<columns>2</columns>
<columns>3</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
@ -669,30 +669,6 @@
</child>
</widget>
<widget>
<class>GtkEntry</class>
<name>givenName</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkEntry</class>
<name>suffix</name>
@ -717,42 +693,6 @@
</child>
</widget>
<widget>
<class>GtkCombo</class>
<name>lastNameList</name>
<value_in_list>False</value_in_list>
<ok_if_empty>True</ok_if_empty>
<case_sensitive>False</case_sensitive>
<use_arrows>True</use_arrows>
<use_arrows_always>False</use_arrows_always>
<items></items>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
<name>surname</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
</widget>
</widget>
<widget>
<class>GtkEntry</class>
<name>title</name>
@ -777,30 +717,6 @@
</child>
</widget>
<widget>
<class>GtkEntry</class>
<name>nickname</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label22</name>
@ -826,6 +742,146 @@
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkEntry</class>
<name>givenName</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<left_attach>1</left_attach>
<right_attach>3</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCombo</class>
<name>lastNameList</name>
<value_in_list>False</value_in_list>
<ok_if_empty>True</ok_if_empty>
<case_sensitive>False</case_sensitive>
<use_arrows>True</use_arrows>
<use_arrows_always>False</use_arrows_always>
<items></items>
<child>
<left_attach>1</left_attach>
<right_attach>3</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
<name>surname</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
</widget>
</widget>
<widget>
<class>GtkEntry</class>
<name>nickname</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<left_attach>1</left_attach>
<right_attach>3</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>5</xpad>
<ypad>5</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>button105</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_name_source_clicked</handler>
<object>editPerson</object>
<last_modification_time>Sat, 16 Jun 2001 03:00:44 GMT</last_modification_time>
</signal>
<label>Source</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>5</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>False</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>button106</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_name_note_clicked</handler>
<object>editPerson</object>
<last_modification_time>Sat, 16 Jun 2001 03:01:00 GMT</last_modification_time>
</signal>
<label>Note</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>5</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
</widget>
@ -1017,7 +1073,7 @@
<class>GtkTable</class>
<name>table10</name>
<rows>3</rows>
<columns>2</columns>
<columns>3</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
@ -1176,6 +1232,62 @@
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>button103</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_showsource_clicked</handler>
<object>nameList</object>
<last_modification_time>Sat, 16 Jun 2001 02:32:54 GMT</last_modification_time>
</signal>
<label>Source</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>5</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>button104</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_event_note_clicked</handler>
<object>nameList</object>
<last_modification_time>Sat, 16 Jun 2001 02:34:02 GMT</last_modification_time>
</signal>
<label>Note</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>5</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
<widget>

View File

@ -129,6 +129,8 @@ class EditPerson:
self.top_window.signal_autoconnect({
"on_death_note_clicked" : on_death_note_clicked,
"on_death_source_clicked" : on_death_source_clicked,
"on_name_note_clicked" : on_name_note_clicked,
"on_name_source_clicked" : on_name_source_clicked,
"on_birth_note_clicked" : on_birth_note_clicked,
"on_birth_source_clicked" : on_birth_source_clicked,
"on_eventAddBtn_clicked" : on_event_add_clicked,
@ -1184,6 +1186,29 @@ def on_birth_note_clicked(obj):
"destroy_passed_object" : utils.destroy_passed_object
})
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_name_note_clicked(obj):
edit_person_obj = obj.get_data(EDITPERSON)
editnote = libglade.GladeXML(const.editnoteFile,"editnote")
data = edit_person_obj.person.getPrimaryName()
textobj = editnote.get_widget("notetext")
en_obj = editnote.get_widget("editnote")
en_obj.set_data("n",data)
en_obj.set_data("w",textobj)
textobj.set_point(0)
textobj.insert_defaults(data.getNote())
textobj.set_word_wrap(1)
editnote.signal_autoconnect({
"on_save_note_clicked" : on_save_note_clicked,
"destroy_passed_object" : utils.destroy_passed_object
})
#-------------------------------------------------------------------------
#
#
@ -1216,6 +1241,15 @@ def on_death_source_clicked(obj):
edit_person_obj = obj.get_data(EDITPERSON)
Sources.SourceEditor(edit_person_obj.person.getDeath(),edit_person_obj.db)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def on_name_source_clicked(obj):
edit_person_obj = obj.get_data(EDITPERSON)
Sources.SourceEditor(edit_person_obj.person.getPrimaryName(),edit_person_obj.db)
#-------------------------------------------------------------------------
#
#

View File

@ -80,6 +80,7 @@ class GrampsParser(handler.ContentHandler):
self.in_stext = 0
self.in_scomments = 0
self.in_people = 0
self.in_name = 0
self.db = database
self.base = base
self.in_family = 0
@ -326,7 +327,8 @@ class GrampsParser(handler.ContentHandler):
#---------------------------------------------------------------------
def start_name(self,attrs):
self.name = Name()
self.in_name = 1
#---------------------------------------------------------------------
#
#
@ -370,6 +372,8 @@ class GrampsParser(handler.ContentHandler):
self.source_ref.setBase(self.source)
if self.in_address:
self.address.setSourceRef(self.source_ref)
elif self.in_name:
self.name.setSourceRef(self.source_ref)
elif self.in_event:
self.event.setSourceRef(self.source_ref)
elif self.in_attribute:
@ -484,6 +488,7 @@ class GrampsParser(handler.ContentHandler):
#---------------------------------------------------------------------
def stop_name(self,tag):
self.person.setPrimaryName(self.name)
self.in_name = 0
#---------------------------------------------------------------------
#
@ -685,8 +690,10 @@ class GrampsParser(handler.ContentHandler):
note = tag
if self.in_address == 1:
self.address.setNote(note)
if self.in_attribute == 1:
elif self.in_attribute == 1:
self.attribute.setNote(note)
elif self.in_name == 1:
self.name.setNote(note)
elif self.in_source == 1:
self.source.setNote(note)
elif self.in_event == 1: