Hello community, here is the log from the commit of package beagle checked in at Mon Apr 24 22:10:30 CEST 2006. -------- --- GNOME/beagle/beagle.changes 2006-04-24 21:21:50.000000000 +0200 +++ STABLE/beagle/beagle.changes 2006-04-24 22:05:20.000000000 +0200 @@ -1,0 +2,6 @@ +Mon Apr 24 22:05:04 CEST 2006 - joeshaw@suse.de + +- Update the calendar patch to correctly display dates in the + future. + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ beagle.spec ++++++ --- /var/tmp/diff_new_pack.cQOygU/_old 2006-04-24 22:10:06.000000000 +0200 +++ /var/tmp/diff_new_pack.cQOygU/_new 2006-04-24 22:10:06.000000000 +0200 @@ -18,7 +18,7 @@ Group: Productivity/Other Autoreqprov: on Version: 0.2.3 -Release: 26 +Release: 28 Summary: Desktop Search Application URL: http://www.gnome.org/projects/beagle/ Source: %{name}-%{version}.tar.gz @@ -460,6 +460,9 @@ %changelog -n beagle * Mon Apr 24 2006 - joeshaw@suse.de +- Update the calendar patch to correctly display dates in the + future. +* Mon Apr 24 2006 - joeshaw@suse.de - Add patch to include calendar items in the beagle-search GUI, and make double-clicking on a contact open it in evolution. - Add patch to fix launching of shell scripts with the new ++++++ beagle-calendar-contact-tiles.patch ++++++ --- /var/tmp/diff_new_pack.cQOygU/_old 2006-04-24 22:10:07.000000000 +0200 +++ /var/tmp/diff_new_pack.cQOygU/_new 2006-04-24 22:10:07.000000000 +0200 @@ -136,22 +136,6 @@ Contact, Folder, Image, -Index: search/Tiles/Utils.cs -=================================================================== -RCS file: /cvs/gnome/beagle/search/Tiles/Utils.cs,v -retrieving revision 1.4 -diff -u -p -u -r1.4 Utils.cs ---- search/Tiles/Utils.cs 31 Mar 2006 16:50:21 -0000 1.4 -+++ search/Tiles/Utils.cs 24 Apr 2006 18:13:13 -0000 -@@ -24,6 +24,8 @@ namespace Search.Tiles { - Catalog.GetString ("Application"), 1), - new TileGroupInfo (TileGroup.Contact, - Catalog.GetString ("Contact"), 2), -+ new TileGroupInfo (TileGroup.Calendar, -+ Catalog.GetString ("Calendar Events"), 2), - new TileGroupInfo (TileGroup.Folder, - Catalog.GetString ("Folder"), 2), - new TileGroupInfo (TileGroup.Image, --- /dev/null 2006-04-07 15:25:18.000000000 -0400 +++ search/Tiles/Calendar.cs 2006-04-24 14:01:57.000000000 -0400 @@ -0,0 +1,65 @@ @@ -220,3 +204,159 @@ + } + } +} +Index: search/Tiles/Utils.cs +=================================================================== +RCS file: /cvs/gnome/beagle/search/Tiles/Utils.cs,v +retrieving revision 1.3 +diff -u -p -r1.3 Utils.cs +--- search/Tiles/Utils.cs 15 Feb 2006 20:47:30 -0000 1.3 ++++ search/Tiles/Utils.cs 24 Apr 2006 19:58:07 -0000 +@@ -1,4 +1,5 @@ + using System; ++using System.Globalization; + using Mono.Unix; + + namespace Search.Tiles { +@@ -23,6 +24,8 @@ namespace Search.Tiles { + Catalog.GetString ("Application"), 1), + new TileGroupInfo (TileGroup.Contact, + Catalog.GetString ("Contact"), 2), ++ new TileGroupInfo (TileGroup.Calendar, ++ Catalog.GetString ("Calendar Events"), 2), + new TileGroupInfo (TileGroup.Folder, + Catalog.GetString ("Folder"), 2), + new TileGroupInfo (TileGroup.Image, +@@ -55,6 +58,12 @@ namespace Search.Tiles { + return dt; + } + ++ private static DateTimeFormatInfo DateTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat; ++ private static string ShortMonthDayPattern = DateTimeFormat.MonthDayPattern.Replace ("MMMM", "MMM"); ++ private static string ShortYearMonthPattern = DateTimeFormat.YearMonthPattern.Replace ("MMMM", "MMM"); ++ private static string MonthDayPattern = DateTimeFormat.MonthDayPattern; ++ private static string LongDatePattern = DateTimeFormat.LongDatePattern.Replace ("dddd, ", "").Replace ("dddd ", "").Replace (" dddd", ""); ++ + public static string NiceShortDate (string timestamp) + { + DateTime dt; +@@ -75,18 +84,30 @@ namespace Search.Tiles { + + dt = dt.ToLocalTime (); + DateTime today = DateTime.Today; +- TimeSpan span = today - dt; ++ ++ TimeSpan span; ++ bool future; ++ ++ if (today > dt) { ++ span = today - dt; ++ future = false; ++ } else { ++ span = dt - today; ++ future = true; ++ } + + if (span.TotalDays < 1) +- return "Today"; +- else if (span.TotalDays < 2) +- return "Yesterday"; ++ return Catalog.GetString ("Today"); ++ else if (span.TotalDays < 2 && ! future) ++ return Catalog.GetString ("Yesterday"); ++ else if (span.TotalDays < 2 && future) ++ return Catalog.GetString ("Tomorrow"); + else if (span.TotalDays < 7) + return dt.ToString ("dddd"); // "Tuesday" + else if (dt.Year == today.Year || span.TotalDays < 180) +- return dt.ToString ("MMM d"); // "Jul 4" ++ return dt.ToString (ShortMonthDayPattern); // "Jul 4" + else +- return dt.ToString ("MMM yyyy"); // Jan 2001 ++ return dt.ToString (ShortYearMonthPattern); // "Jan 2001" + } + + public static string NiceLongDate (string timestamp) +@@ -109,18 +130,30 @@ namespace Search.Tiles { + + dt = dt.ToLocalTime (); + DateTime today = DateTime.Today; +- TimeSpan span = today - dt; ++ ++ TimeSpan span; ++ bool future; ++ ++ if (today > dt) { ++ span = today - dt; ++ future = false; ++ } else { ++ span = dt - today; ++ future = true; ++ } + + if (span.TotalDays < 1) +- return "Today"; +- else if (span.TotalDays < 2) +- return "Yesterday"; ++ return Catalog.GetString ("Today"); ++ else if (span.TotalDays < 2 && ! future) ++ return Catalog.GetString ("Yesterday"); ++ else if (span.TotalDays < 2 && future) ++ return Catalog.GetString ("Tomorrow"); + else if (span.TotalDays < 7) + return dt.ToString ("dddd"); // "Tuesday" + else if (dt.Year == today.Year || span.TotalDays < 180) +- return dt.ToString ("MMMM d"); // "July 4" ++ return dt.ToString (MonthDayPattern); // "July 4" + else +- return dt.ToString ("MMMM d, yyyy"); // January 7, 2001 ++ return dt.ToString (LongDatePattern); // January 7, 2001 + } + + public static string NiceVeryLongDate (string timestamp) +@@ -143,20 +176,38 @@ namespace Search.Tiles { + + dt = dt.ToLocalTime (); + DateTime today = DateTime.Today; +- TimeSpan span = today - dt; ++ ++ TimeSpan span; ++ bool future; ++ ++ if (today > dt) { ++ span = today - dt; ++ future = false; ++ } else { ++ span = dt - today; ++ future = true; ++ } + + if (span.TotalDays < 1) +- return String.Format ("Today ({0:MMMM d, yyyy})", dt); +- else if (span.TotalDays < 2) +- return String.Format ("Yesterday ({0:MMMM d, yyyy})", dt); ++ return Catalog.GetString ("Today"); ++ else if (span.TotalDays < 2 && ! future) ++ return Catalog.GetString ("Yesterday"); ++ else if (span.TotalDays < 2 && future) ++ return Catalog.GetString ("Tomorrow"); + else if (span.TotalDays < 7) +- return String.Format ("{0:dddd} ({0:MMMM d, yyyy})", dt); +- else if (span.TotalDays < 30) ++ return dt.ToString ("dddd"); // "Tuesday" ++ else if (span.TotalDays < 30 && ! future) + return String.Format (Catalog.GetPluralString ("{0} week ago", "{0} weeks ago", span.Days / 7) + " ({1:MMMM d, yyyy})", span.Days / 7, dt); +- else if (span.TotalDays < 365 + 180) // Lets say a year and a half to stop saying months ++ else if (span.TotalDays < 30 && future) ++ return String.Format (Catalog.GetPluralString ("In {0} week", "In {0} weeks", span.Days / 7) + " {1:MMMM d, yyyy})", span.Days / 7, dt); ++ else if (span.TotalDays < 365 + 180 && ! future) // Let's say a year and a half to stop saying months + return String.Format (Catalog.GetPluralString ("{0} month ago", "{0} months ago", span.Days / 30) + " ({1:MMMM d, yyyy})", span.Days / 30, dt); +- else ++ else if (span.TotalDays < 365 + 180 && future) ++ return String.Format (Catalog.GetPluralString ("In {0} month", "In {0} months", span.Days / 30) + " ({1:MMMM d, yyyy})", span.Days / 30, dt); ++ else if (! future) + return String.Format (Catalog.GetPluralString ("{0} year ago", "{0} years ago", span.Days / 365) + " ({1:MMMM d, yyyy})", span.Days / 365, dt); ++ else ++ return String.Format (Catalog.GetPluralString ("In {0} year", "In {0} years", span.Days / 365) + " ({1:MMMM d, yyyy})", span.Days / 365, dt); + } + } + } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...
participants (1)
-
root@suse.de