Sorting on source references

svn: r1031
This commit is contained in:
Don Allingham 2002-06-16 04:39:30 +00:00
parent df578b01d3
commit af62bee66a
4 changed files with 325 additions and 129 deletions

View File

@ -2145,7 +2145,7 @@
<class>GtkTable</class> <class>GtkTable</class>
<name>table7</name> <name>table7</name>
<rows>5</rows> <rows>5</rows>
<columns>3</columns> <columns>6</columns>
<homogeneous>False</homogeneous> <homogeneous>False</homogeneous>
<row_spacing>0</row_spacing> <row_spacing>0</row_spacing>
<column_spacing>0</column_spacing> <column_spacing>0</column_spacing>
@ -2228,84 +2228,6 @@
</child> </child>
</widget> </widget>
<widget>
<class>GtkLabel</class>
<name>eventDate</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>eventPlace</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>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>eventDescription</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>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label232</name> <name>label232</name>
@ -2436,32 +2358,6 @@
</child> </child>
</widget> </widget>
<widget>
<class>GtkLabel</class>
<name>eventCause</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>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label273</name> <name>label273</name>
@ -2514,6 +2410,162 @@
</child> </child>
</widget> </widget>
<widget>
<class>GtkLabel</class>
<name>eventDate</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>eventPlace</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>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>eventCause</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>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>eventDescription</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>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label275</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>True</xshrink>
<yshrink>False</yshrink>
<xfill>False</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label276</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>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>False</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>event_srcinfo</name> <name>event_srcinfo</name>
@ -2529,9 +2581,35 @@
<right_attach>3</right_attach> <right_attach>3</right_attach>
<top_attach>4</top_attach> <top_attach>4</top_attach>
<bottom_attach>5</bottom_attach> <bottom_attach>5</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>event_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>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>0</xpad> <xpad>0</xpad>
<ypad>0</ypad> <ypad>0</ypad>
<xexpand>False</xexpand> <xexpand>True</xexpand>
<yexpand>False</yexpand> <yexpand>False</yexpand>
<xshrink>False</xshrink> <xshrink>False</xshrink>
<yshrink>False</yshrink> <yshrink>False</yshrink>

View File

@ -174,6 +174,7 @@ class EditPerson:
self.event_date_field = self.get_widget("eventDate") self.event_date_field = self.get_widget("eventDate")
self.event_descr_field = self.get_widget("eventDescription") self.event_descr_field = self.get_widget("eventDescription")
self.event_src_field = self.get_widget("event_srcinfo") 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.attr_details_field = self.get_widget("attr_details")
self.name_details_field = self.get_widget("name_details") self.name_details_field = self.get_widget("name_details")
self.addr_details_field = self.get_widget("addr_details") self.addr_details_field = self.get_widget("addr_details")
@ -978,12 +979,11 @@ class EditPerson:
self.event_descr_field.set_text(event.getDescription()) self.event_descr_field.set_text(event.getDescription())
if len(event.getSourceRefList()) > 0: if len(event.getSourceRefList()) > 0:
psrc = event.getSourceRefList()[0] psrc = event.getSourceRefList()[0]
n = _("%(source_title)s; Confidence - %(confidence)s") % { self.event_src_field.set_text(psrc.getBase().getTitle())
'source_title' : psrc.getBase().getTitle(), self.event_conf_field.set_text(const.confidence[psrc.getConfidence()])
'confidence' : const.confidence[psrc.getConfidence()]}
self.event_src_field.set_text(n)
else: else:
self.event_src_field.set_text('') self.event_src_field.set_text('')
self.event_conf_field.set_text('')
def on_event_unselect_row(self,obj,a,b,c): def on_event_unselect_row(self,obj,a,b,c):
enable = len(obj.selection) > 0 enable = len(obj.selection) > 0

View File

@ -33,6 +33,7 @@ import libglade
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import const import const
import Utils import Utils
import Sorter
from RelLib import * from RelLib import *
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -60,7 +61,10 @@ class SourceSelector:
}) })
self.sourcesel = self.top.get_widget("sourcesel") self.sourcesel = self.top.get_widget("sourcesel")
self.slist = self.top.get_widget("slist") self.slist = self.top.get_widget("slist")
self.slist.set_data("o",self) slist_map = [ (0, self.top.get_widget('arrow1')),
(1, self.top.get_widget('arrow2'))]
self.srcsort = Sorter.Sorter(self.slist, slist_map, 'source', self.top)
self.redraw() self.redraw()
self.sourcesel.show() self.sourcesel.show()

View File

@ -772,29 +772,143 @@ Very High
<shadow_type>GTK_SHADOW_IN</shadow_type> <shadow_type>GTK_SHADOW_IN</shadow_type>
<widget> <widget>
<class>GtkLabel</class> <class>GtkHBox</class>
<child_name>CList:title</child_name> <child_name>CList:title</child_name>
<name>label254</name> <name>hbox1</name>
<label>ID</label> <homogeneous>True</homogeneous>
<justify>GTK_JUSTIFY_CENTER</justify> <spacing>0</spacing>
<wrap>False</wrap>
<xalign>0.5</xalign> <widget>
<yalign>0.5</yalign> <class>GtkHBox</class>
<xpad>0</xpad> <child_name>CList:title</child_name>
<ypad>0</ypad> <name>hbox2</name>
<homogeneous>True</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkHBox</class>
<name>hbox3</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label256</name>
<label>ID</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkArrow</class>
<name>arrow1</name>
<width>10</width>
<height>10</height>
<visible>False</visible>
<arrow_type>GTK_ARROW_DOWN</arrow_type>
<shadow_type>GTK_SHADOW_OUT</shadow_type>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>5</padding>
<expand>False</expand>
<fill>True</fill>
</child>
</widget>
</widget>
</widget>
</widget> </widget>
<widget> <widget>
<class>GtkLabel</class> <class>GtkHBox</class>
<child_name>CList:title</child_name> <child_name>CList:title</child_name>
<name>label255</name> <name>hbox4</name>
<label>Title</label> <homogeneous>True</homogeneous>
<justify>GTK_JUSTIFY_CENTER</justify> <spacing>0</spacing>
<wrap>False</wrap>
<xalign>0.5</xalign> <widget>
<yalign>0.5</yalign> <class>GtkHBox</class>
<xpad>0</xpad> <child_name>CList:title</child_name>
<ypad>0</ypad> <name>hbox5</name>
<homogeneous>True</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkHBox</class>
<name>hbox6</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label257</name>
<label>Title</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkArrow</class>
<name>arrow2</name>
<width>10</width>
<height>10</height>
<visible>False</visible>
<arrow_type>GTK_ARROW_DOWN</arrow_type>
<shadow_type>GTK_SHADOW_OUT</shadow_type>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>5</padding>
<expand>False</expand>
<fill>True</fill>
</child>
</widget>
</widget>
</widget>
</widget> </widget>
</widget> </widget>
</widget> </widget>