From af62bee66abd0bb99cb58b4d8a381e1f07613f87 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 16 Jun 2002 04:39:30 +0000 Subject: [PATCH] Sorting on source references svn: r1031 --- gramps/src/EditPerson.glade | 290 +++++++++++++++++++++++------------- gramps/src/EditPerson.py | 8 +- gramps/src/Sources.py | 6 +- gramps/src/srcsel.glade | 150 ++++++++++++++++--- 4 files changed, 325 insertions(+), 129 deletions(-) diff --git a/gramps/src/EditPerson.glade b/gramps/src/EditPerson.glade index 7a781bbea..85c9301e9 100644 --- a/gramps/src/EditPerson.glade +++ b/gramps/src/EditPerson.glade @@ -2145,7 +2145,7 @@ GtkTable table7 5 - 3 + 6 False 0 0 @@ -2228,84 +2228,6 @@ - - GtkLabel - eventDate - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 2 - 3 - 0 - 1 - 3 - 3 - True - False - False - False - True - False - - - - - GtkLabel - eventPlace - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 2 - 3 - 1 - 2 - 3 - 3 - True - False - False - False - True - False - - - - - GtkLabel - eventDescription - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 2 - 3 - 3 - 4 - 3 - 3 - True - False - False - False - True - False - - - GtkLabel label232 @@ -2436,32 +2358,6 @@ - - GtkLabel - eventCause - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 2 - 3 - 2 - 3 - 3 - 3 - True - False - False - False - True - False - - - GtkLabel label273 @@ -2514,6 +2410,162 @@ + + GtkLabel + eventDate + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 2 + 6 + 0 + 1 + 3 + 3 + True + False + False + False + True + False + + + + + GtkLabel + eventPlace + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 2 + 6 + 1 + 2 + 3 + 3 + True + False + False + False + True + False + + + + + GtkLabel + eventCause + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 2 + 6 + 2 + 3 + 3 + 3 + True + False + False + False + True + False + + + + + GtkLabel + eventDescription + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 2 + 6 + 3 + 4 + 3 + 3 + True + False + False + False + True + False + + + + + GtkLabel + label275 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 3 + + 4 + 5 + 4 + 5 + 0 + 0 + False + False + True + False + False + False + + + + + GtkLabel + label276 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 3 + 4 + 4 + 5 + 0 + 0 + False + False + False + False + False + False + + + GtkLabel event_srcinfo @@ -2529,9 +2581,35 @@ 3 4 5 + 3 + 3 + True + False + False + False + True + False + + + + + GtkLabel + event_conf + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 5 + 6 + 4 + 5 0 0 - False + True False False False diff --git a/gramps/src/EditPerson.py b/gramps/src/EditPerson.py index 8994868df..4a401da4a 100644 --- a/gramps/src/EditPerson.py +++ b/gramps/src/EditPerson.py @@ -174,6 +174,7 @@ class EditPerson: self.event_date_field = self.get_widget("eventDate") 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") @@ -978,12 +979,11 @@ class EditPerson: self.event_descr_field.set_text(event.getDescription()) if len(event.getSourceRefList()) > 0: psrc = event.getSourceRefList()[0] - n = _("%(source_title)s; Confidence - %(confidence)s") % { - 'source_title' : psrc.getBase().getTitle(), - 'confidence' : const.confidence[psrc.getConfidence()]} - self.event_src_field.set_text(n) + self.event_src_field.set_text(psrc.getBase().getTitle()) + self.event_conf_field.set_text(const.confidence[psrc.getConfidence()]) else: self.event_src_field.set_text('') + self.event_conf_field.set_text('') def on_event_unselect_row(self,obj,a,b,c): enable = len(obj.selection) > 0 diff --git a/gramps/src/Sources.py b/gramps/src/Sources.py index ae022907c..b7272fc99 100644 --- a/gramps/src/Sources.py +++ b/gramps/src/Sources.py @@ -33,6 +33,7 @@ import libglade #------------------------------------------------------------------------- import const import Utils +import Sorter from RelLib import * #------------------------------------------------------------------------- @@ -60,7 +61,10 @@ class SourceSelector: }) self.sourcesel = self.top.get_widget("sourcesel") 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.sourcesel.show() diff --git a/gramps/src/srcsel.glade b/gramps/src/srcsel.glade index d9555134c..8e324b2fa 100644 --- a/gramps/src/srcsel.glade +++ b/gramps/src/srcsel.glade @@ -772,29 +772,143 @@ Very High GTK_SHADOW_IN - GtkLabel + GtkHBox CList:title - label254 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 + hbox1 + True + 0 + + + GtkHBox + CList:title + hbox2 + True + 0 + + 0 + False + False + + + + GtkHBox + hbox3 + False + 0 + + 0 + False + False + + + + GtkLabel + CList:title + label256 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkArrow + arrow1 + 10 + 10 + False + GTK_ARROW_DOWN + GTK_SHADOW_OUT + 0.5 + 0.5 + 0 + 0 + + 5 + False + True + + + + - GtkLabel + GtkHBox CList:title - label255 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 + hbox4 + True + 0 + + + GtkHBox + CList:title + hbox5 + True + 0 + + 0 + False + False + + + + GtkHBox + hbox6 + False + 0 + + 0 + False + False + + + + GtkLabel + CList:title + label257 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkArrow + arrow2 + 10 + 10 + False + GTK_ARROW_DOWN + GTK_SHADOW_OUT + 0.5 + 0.5 + 0 + 0 + + 5 + False + True + + + +