Tabs for sources and notes in the editors

svn: r1034
This commit is contained in:
Don Allingham 2002-06-17 04:01:44 +00:00
parent ecad93749f
commit 2aff74f369
8 changed files with 2865 additions and 1701 deletions

View File

@ -38,6 +38,7 @@ import const
import Utils
import Date
import RelLib
import Sources
from DateEdit import DateEdit
from intl import gettext
@ -70,6 +71,7 @@ class AddressEditor:
self.postal = self.top.get_widget("postal")
self.note_field = self.top.get_widget("addr_note")
self.priv = self.top.get_widget("priv")
self.slist = self.top.get_widget("slist")
self.parent = parent
self.addr = addr
@ -102,20 +104,17 @@ class AddressEditor:
else:
self.srcreflist = []
self.sourcetab = Sources.SourceTab(self.srcreflist,self.parent,self.top,
self.slist,src_changed)
date_stat = self.top.get_widget("date_stat")
self.date_check = DateEdit(self.addr_start,date_stat)
self.top.signal_autoconnect({
"destroy_passed_object" : Utils.destroy_passed_object,
"on_addr_edit_ok_clicked" : self.ok_clicked,
"on_source_clicked" : self.source_clicked
})
def source_clicked(self,obj):
"""Displays the SourceSelector, allowing sources to be edited"""
import Sources
Sources.SourceSelector(self.srcreflist,self.parent,src_changed)
def ok_clicked(self,obj):
"""
Called when the OK button is pressed. Gets data from the
@ -132,8 +131,8 @@ class AddressEditor:
if self.addr == None:
self.addr = RelLib.Address()
self.addr.setSourceRefList(self.srcreflist)
self.parent.plist.append(self.addr)
self.addr.setSourceRefList(self.srcreflist)
self.update(date,street,city,state,country,postal,note,priv)
self.parent.redraw_addr_list()

View File

@ -47,7 +47,7 @@ _ = gettext
# AttributeEditor class
#
#-------------------------------------------------------------------------
class AttributeEditor:
class AttributeEditor(Sources.SourceTab):
"""
Displays a dialog that allows the user to edit an attribute.
"""
@ -65,6 +65,7 @@ class AttributeEditor:
self.top = libglade.GladeXML(const.dialogFile, "attr_edit")
self.window = self.top.get_widget("attr_edit")
self.type_field = self.top.get_widget("attr_type")
self.slist = self.top.get_widget("slist")
self.value_field = self.top.get_widget("attr_value")
self.note_field = self.top.get_widget("attr_note")
self.attrib_menu = self.top.get_widget("attr_menu")
@ -76,6 +77,9 @@ class AttributeEditor:
else:
self.srcreflist = []
self.sourcetab = Sources.SourceTab(self.srcreflist,self.parent,self.top,
self.slist,src_changed)
# Typing CR selects OK button
self.window.editable_enters(self.type_field);
self.window.editable_enters(self.value_field);
@ -95,18 +99,12 @@ class AttributeEditor:
self.note_field.insert_defaults(attrib.getNote())
self.note_field.set_word_wrap(1)
self.window.set_data("o",self)
self.top.signal_autoconnect({
"destroy_passed_object" : Utils.destroy_passed_object,
"on_attr_edit_ok_clicked" : self.on_ok_clicked,
"on_combo_insert_text" : Utils.combo_insert_text,
"on_source_clicked" : self.on_source_clicked
})
def on_source_clicked(self,obj):
"""Displays the SourceSelector, allowing sources to be edited"""
Sources.SourceSelector(self.srcreflist,self.parent,src_changed)
def on_ok_clicked(self,obj):
"""
Called when the OK button is pressed. Gets data from the
@ -119,9 +117,9 @@ class AttributeEditor:
if self.attrib == None:
self.attrib = Attribute()
self.attrib.setSourceRefList(self.srcreflist)
self.parent.alist.append(self.attrib)
self.attrib.setSourceRefList(self.srcreflist)
self.update(type,value,note,priv)
self.parent.redraw_attr_list()

View File

@ -1399,7 +1399,7 @@
<class>GtkTable</class>
<name>table10</name>
<rows>6</rows>
<columns>3</columns>
<columns>6</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
@ -1482,136 +1482,6 @@
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>alt_given</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>3</xpad>
<ypad>3</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>alt_last</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>alt_suffix</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label168</name>
<label>Details</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>3</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>5</top_attach>
<bottom_attach>6</bottom_attach>
<xpad>0</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>GtkLabel</class>
<name>name_details</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>5</top_attach>
<bottom_attach>6</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label236</name>
@ -1768,32 +1638,6 @@
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>alt_title</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label271</name>
@ -1846,6 +1690,136 @@
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label277</name>
<label>Primary Source</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>3</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>5</top_attach>
<bottom_attach>6</bottom_attach>
<xpad>0</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>GtkLabel</class>
<name>alt_given</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>6</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>3</xpad>
<ypad>3</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>alt_last</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>6</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>alt_suffix</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>6</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>alt_title</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>6</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>name_type</name>
@ -1858,7 +1832,7 @@
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<right_attach>6</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>3</xpad>
@ -1871,6 +1845,110 @@
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label279</name>
<label>Confidence</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>3</ypad>
<child>
<left_attach>3</left_attach>
<right_attach>4</right_attach>
<top_attach>5</top_attach>
<bottom_attach>6</bottom_attach>
<xpad>0</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>GtkLabel</class>
<name>label278</name>
<label>:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>3</ypad>
<child>
<left_attach>4</left_attach>
<right_attach>5</right_attach>
<top_attach>5</top_attach>
<bottom_attach>6</bottom_attach>
<xpad>0</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>GtkLabel</class>
<name>name_srcinfo</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>5</top_attach>
<bottom_attach>6</bottom_attach>
<xpad>3</xpad>
<ypad>3</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>name_conf</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>5</left_attach>
<right_attach>6</right_attach>
<top_attach>5</top_attach>
<bottom_attach>6</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
</widget>
@ -2920,7 +2998,7 @@
<class>GtkTable</class>
<name>table24</name>
<rows>2</rows>
<columns>3</columns>
<columns>6</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
@ -2951,84 +3029,6 @@
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>attr_value</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>3</xpad>
<ypad>3</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>label201</name>
<label>Details</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>3</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</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>GtkLabel</class>
<name>attr_details</name>
<label></label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>3</xpad>
<ypad>3</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label230</name>
@ -3080,6 +3080,162 @@
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label281</name>
<label>Primary Source</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>3</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</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>GtkLabel</class>
<name>attr_value</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>6</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>3</xpad>
<ypad>3</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>label283</name>
<label>Confidence</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>3</left_attach>
<right_attach>4</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</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>GtkLabel</class>
<name>label282</name>
<label>:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>3</ypad>
<child>
<left_attach>4</left_attach>
<right_attach>5</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</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>GtkLabel</class>
<name>attr_srcinfo</name>
<label></label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>3</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>3</xpad>
<ypad>3</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>attr_conf</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>5</left_attach>
<right_attach>6</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
</widget>
@ -3583,32 +3739,6 @@
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label193</name>
<label>Details</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>3</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>0</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>GtkLabel</class>
<name>country</name>
@ -3871,7 +4001,33 @@
<widget>
<class>GtkLabel</class>
<name>addr_details</name>
<name>label285</name>
<label>Primary Source</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>3</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>0</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>GtkLabel</class>
<name>addr_srcinfo</name>
<label></label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
@ -3881,7 +4037,7 @@
<ypad>0</ypad>
<child>
<left_attach>2</left_attach>
<right_attach>6</right_attach>
<right_attach>3</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>3</xpad>
@ -3894,6 +4050,84 @@
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label286</name>
<label>:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>3</ypad>
<child>
<left_attach>4</left_attach>
<right_attach>5</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>0</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>GtkLabel</class>
<name>label287</name>
<label>Confidence</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>3</ypad>
<child>
<left_attach>3</left_attach>
<right_attach>4</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>0</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>GtkLabel</class>
<name>addr_conf</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>3</xpad>
<ypad>3</ypad>
<child>
<left_attach>5</left_attach>
<right_attach>6</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>0</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

@ -175,9 +175,12 @@ class EditPerson:
self.event_descr_field = self.get_widget("eventDescription")
self.event_src_field = self.get_widget("event_srcinfo")
self.event_conf_field = self.get_widget("event_conf")
self.attr_details_field = self.get_widget("attr_details")
self.name_details_field = self.get_widget("name_details")
self.addr_details_field = self.get_widget("addr_details")
self.attr_conf_field = self.get_widget("attr_conf")
self.addr_conf_field = self.get_widget("attr_conf")
self.name_conf_field = self.get_widget("name_conf")
self.attr_src_field = self.get_widget("attr_srcinfo")
self.name_src_field = self.get_widget("name_srcinfo")
self.addr_src_field = self.get_widget("addr_srcinfo")
self.attr_list = self.get_widget("attr_list")
self.attr_type = self.get_widget("attr_type")
self.attr_value = self.get_widget("attr_value")
@ -996,19 +999,25 @@ class EditPerson:
self.addr_delete_btn.set_sensitive(enable)
def on_addr_select_row(self,obj,row,b,c):
a = obj.get_row_data(row)
addr = obj.get_row_data(row)
self.addr_edit_btn.set_sensitive(1)
self.addr_delete_btn.set_sensitive(1)
label = "%s %s %s" % (a.getCity(),a.getState(),a.getCountry())
label = "%s %s %s" % (addr.getCity(),addr.getState(),addr.getCountry())
self.addr_label.set_label(label)
self.addr_start.set_text(a.getDate())
self.addr_street.set_text(a.getStreet())
self.addr_city.set_text(a.getCity())
self.addr_state.set_text(a.getState())
self.addr_country.set_text(a.getCountry())
self.addr_postal.set_text(a.getPostal())
self.addr_details_field.set_text(Utils.get_detail_text(a))
self.addr_start.set_text(addr.getDate())
self.addr_street.set_text(addr.getStreet())
self.addr_city.set_text(addr.getCity())
self.addr_state.set_text(addr.getState())
self.addr_country.set_text(addr.getCountry())
self.addr_postal.set_text(addr.getPostal())
if len(addr.getSourceRefList()) > 0:
psrc = addr.getSourceRefList()[0]
self.addr_conf_field.set_text(const.confidence[psrc.getConfidence()])
self.addr_src_field.set_text(psrc.getBase().getTitle())
else:
self.addr_src_field.set_text('')
self.addr_conf_field.set_text('')
def on_name_select_row(self,obj,row,b,c):
self.name_update_btn.set_sensitive(1)
@ -1020,7 +1029,13 @@ class EditPerson:
self.alt_last_field.set_text(name.getSurname())
self.alt_suffix_field.set_text(name.getSuffix())
self.name_type_field.set_text(name.getType())
self.name_details_field.set_text(Utils.get_detail_text(name))
if len(name.getSourceRefList()) > 0:
psrc = name.getSourceRefList()[0]
self.name_src_field.set_text(psrc.getBase().getTitle())
self.name_conf_field.set_text(const.confidence[psrc.getConfidence()])
else:
self.name_src_field.set_text('')
self.name_conf_field.set_text('')
def on_name_unselect_row(self,obj,a,b,c):
enable = len(obj.selection) > 0
@ -1052,7 +1067,13 @@ class EditPerson:
attr = obj.get_row_data(row)
self.attr_type.set_label(const.display_pattr(attr.getType()))
self.attr_value.set_text(attr.getValue())
self.attr_details_field.set_text(Utils.get_detail_text(attr))
if len(attr.getSourceRefList()) > 0:
psrc = attr.getSourceRefList()[0]
self.attr_src_field.set_text(psrc.getBase().getTitle())
self.attr_conf_field.set_text(const.confidence[psrc.getConfidence()])
else:
self.attr_src_field.set_text('')
self.attr_conf_field.set_text('')
def on_attr_unselect_row(self,obj,row,b,c):
enable = len(obj.selection) > 0

View File

@ -50,7 +50,7 @@ _ = gettext
# EventEditor class
#
#-------------------------------------------------------------------------
class EventEditor:
class EventEditor(Sources.SourceTab):
def __init__(self,parent,name,list,trans,event,def_placename,read_only,cb):
self.parent = parent
@ -70,11 +70,13 @@ class EventEditor:
else:
self.srcreflist = []
self.date = Date(None)
self.top = libglade.GladeXML(const.dialogFile, "event_edit")
self.window = self.top.get_widget("event_edit")
self.name_field = self.top.get_widget("eventName")
self.place_field = self.top.get_widget("eventPlace")
self.cause_field = self.top.get_widget("eventCause")
self.slist = self.top.get_widget("slist")
self.place_combo = self.top.get_widget("eventPlace_combo")
self.date_field = self.top.get_widget("eventDate")
self.cause_field = self.top.get_widget("eventCause")
@ -94,6 +96,9 @@ class EventEditor:
self.event_menu.set_sensitive(0)
self.date_field.grab_focus()
self.sourcetab = Sources.SourceTab(self.srcreflist,self.parent,self.top,
self.slist,src_changed)
# Typing CR selects OK button
self.window.editable_enters(self.name_field);
self.window.editable_enters(self.place_field);
@ -131,7 +136,6 @@ class EventEditor:
self.top.signal_autoconnect({
"destroy_passed_object" : Utils.destroy_passed_object,
"on_event_edit_ok_clicked" : self.on_event_edit_ok_clicked,
"on_source_clicked" : self.on_edit_source_clicked
})
menu = gtk.GtkMenu()
@ -149,9 +153,6 @@ class EventEditor:
self.date.set_calendar(obj.get_data("d"))
self.date_field.set_text(self.date.getDate())
def on_edit_source_clicked(self,obj):
Sources.SourceSelector(self.srcreflist,self.parent,src_changed)
def get_place(self,field,makenew=0):
text = strip(field.get_text())
if text != "":

View File

@ -33,6 +33,7 @@ import libglade
import const
import Utils
import AutoComp
import Sources
from RelLib import *
from intl import gettext
@ -56,6 +57,7 @@ class NameEditor:
self.suffix_field = self.top.get_widget("alt_suffix")
self.type_field = self.top.get_widget("name_type")
self.note_field = self.top.get_widget("alt_note")
self.slist = self.top.get_widget('slist')
slist = self.top.get_widget("alt_surname_list")
self.combo = AutoComp.AutoCombo(slist,self.parent.db.getSurnames())
self.priv = self.top.get_widget("priv")
@ -81,6 +83,9 @@ class NameEditor:
self.window.editable_enters(self.suffix_field)
self.window.editable_enters(self.title_field)
self.window.editable_enters(self.type_field.entry)
self.sourcetab = Sources.SourceTab(self.srcreflist,self.parent,self.top,
self.slist,src_changed)
if name != None:
self.given_field.set_text(name.getFirstName())
@ -97,13 +102,8 @@ class NameEditor:
"destroy_passed_object" : Utils.destroy_passed_object,
"on_combo_insert_text" : Utils.combo_insert_text,
"on_name_edit_ok_clicked" : self.on_name_edit_ok_clicked,
"on_source_clicked" : self.on_name_source_clicked
})
def on_name_source_clicked(self,obj):
import Sources
Sources.SourceSelector(self.srcreflist,self.parent,src_changed)
def on_name_edit_ok_clicked(self,obj):
first = self.given_field.get_text()
last = self.surname_field.get_text()
@ -121,9 +121,10 @@ class NameEditor:
if self.name == None:
self.name = Name()
self.name.setSourceRefList(self.srcreflist)
self.parent.nlist.append(self.name)
self.name.setSourceRefList(self.srcreflist)
self.update_name(first,last,suffix,title,type,note,priv)
self.parent.lists_changed = 1

View File

@ -104,6 +104,60 @@ class SourceSelector:
del self.list[row]
self.redraw()
#-------------------------------------------------------------------------
#
# SourceTab
#
#-------------------------------------------------------------------------
class SourceTab:
def __init__(self,srclist,parent,top,clist,update=None):
self.db = parent.db
self.parent = parent
self.list = srclist
self.update=update
self.top = top
self.slist = clist
self.top.signal_autoconnect({
"destroy_passed_object" : Utils.destroy_passed_object,
"on_add_src_clicked" : self.on_add_src_clicked,
"on_del_src_clicked" : self.on_del_src_clicked,
"on_edit_src_clicked" : self.on_edit_src_clicked,
})
slist_map = [ (0, self.top.get_widget('arrow1')),
(1, self.top.get_widget('arrow2'))]
self.srcsort = Sorter.Sorter(self.slist, slist_map, 'source')
self.redraw()
def redraw(self):
index = 0
self.slist.freeze()
self.slist.clear()
for s in self.list:
base = s.getBase()
self.slist.append([base.getId(),base.getTitle()])
self.slist.set_row_data(index,s)
index = index + 1
self.slist.thaw()
def on_edit_src_clicked(self,obj):
sel = obj.selection
if len(sel) > 0:
row = sel[0]
src = obj.get_row_data(row)
SourceEditor(src,self.db,update_clist,self)
def on_add_src_clicked(self,obj):
src = SourceRef()
SourceEditor(src,self.db,add_ref,self)
def on_del_src_clicked(self,obj):
sel = obj.selection
if len(sel) > 0:
row = sel[0]
del self.list[row]
self.redraw()
#-------------------------------------------------------------------------
#
# SourceEditor

File diff suppressed because it is too large Load Diff