From 148701473021e5203757ddd01dcc163e9f348d66 Mon Sep 17 00:00:00 2001
From: Alex Roitman <shura@gramps-project.org>
Date: Mon, 20 Sep 2004 17:56:26 +0000
Subject: [PATCH] * src/DateEdit.py (DateEdit.invoke_date_editor): Check the
 built date and display LED (closes # 1031065). * src/Sources.py (draw):
 Properly display date for sourceref; (on_sourceok_clicked): Properly parse
 date for sourceref (closes # 1031156).

svn: r3560
---
 ChangeLog       | 7 +++++++
 src/DateEdit.py | 1 +
 src/Sources.py  | 8 ++++++--
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 73948a8bc..fde180f81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-09-20 Alex Roitman  <shura@alex.neuro.umn.edu>
+	* src/DateEdit.py (DateEdit.invoke_date_editor): 
+	Check the built date and display LED (closes # 1031065).
+	* src/Sources.py (draw): Properly display date for sourceref;
+	(on_sourceok_clicked): Properly parse date for sourceref 
+	(closes # 1031156).
+
 2004-09-19 Alex Roitman  <shura@alex.neuro.umn.edu>
 	* src/Date.py (is_equal): Add method -- needed to compare dates
 	for being identical, since __cmp__ only compares the sorting value
diff --git a/src/DateEdit.py b/src/DateEdit.py
index 7d8f635f1..93b976871 100644
--- a/src/DateEdit.py
+++ b/src/DateEdit.py
@@ -160,6 +160,7 @@ class DateEdit:
         if the_date:
             self.date_obj.copy(the_date)
             self.text_obj.set_text(self.dd.display(self.date_obj))
+            self.check()
             print "The date was built as follows:", self.date_obj
         else:
             print "Cancel was pressed, date not changed."
diff --git a/src/Sources.py b/src/Sources.py
index 6c0f94327..4a961031a 100644
--- a/src/Sources.py
+++ b/src/Sources.py
@@ -38,6 +38,7 @@ import gnome
 import const
 import Utils
 import RelLib
+import DateHandler
 from gettext import gettext as _
 
 #-------------------------------------------------------------------------
@@ -339,6 +340,9 @@ class SourceEditor:
         else:
             self.active_source = None
 
+        self.dd = DateHandler.create_display()
+        self.dp = DateHandler.create_parser()
+
         self.draw(self.active_source)
         self.set_button()
         if self.parent:
@@ -409,7 +413,7 @@ class SourceEditor:
             spage.get_buffer().set_text(self.source_ref.get_page())
             date = self.source_ref.get_date()
             if date:
-                self.get_widget("sdate").set_text(date.get_date())
+                self.get_widget("sdate").set_text(self.dd.display(date))
 
             text = self.get_widget("stext")
             text.get_buffer().set_text(self.source_ref.get_text())
@@ -473,7 +477,7 @@ class SourceEditor:
                                     buf.get_end_iter(),gtk.FALSE))
 
         self.source_ref.set_page(page)
-        self.source_ref.get_date().set(date)
+        self.source_ref.get_date().copy(self.dp.parse(date))
         self.source_ref.set_text(text)
         self.source_ref.set_comments(comments)
         self.source_ref.set_confidence_level(conf)