From c29619be79e342dc19f845e46e5692558a08c98c Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 11 Jul 2006 15:12:03 +0000 Subject: [PATCH] - Update patch for RH bug #190359. --- evolution-2.7.3-filter-datespec.patch | 438 +++++++++++++++++++++++++- evolution.spec | 7 +- 2 files changed, 430 insertions(+), 15 deletions(-) diff --git a/evolution-2.7.3-filter-datespec.patch b/evolution-2.7.3-filter-datespec.patch index 20084de..a5c7bdf 100644 --- a/evolution-2.7.3-filter-datespec.patch +++ b/evolution-2.7.3-filter-datespec.patch @@ -1,16 +1,428 @@ ---- evolution-2.7.3/filter/filter-datespec.c.filter-datespec 2005-08-09 19:29:27.000000000 -0400 -+++ evolution-2.7.3/filter/filter-datespec.c 2006-06-27 15:56:18.000000000 -0400 -@@ -82,6 +82,13 @@ - { 604800, ngettext("1 week ago", "%d weeks ago"), 52.0 }, - { 2419200, ngettext("1 month ago", "%d months ago"), 12.0 }, - { 31557600, ngettext("1 year ago", "%d years ago"), 1000.0 }, -+ { -1, ngettext("1 second in the future", "%d seconds in the future"), 59.0 }, -+ { -60, ngettext("1 minute in the future", "%d minutes in the future"), 59.0 }, -+ { -3600, ngettext("1 hour in the future", "%d hours in the future"), 23.0 }, -+ { -86400, ngettext("1 day in the future", "%d days in the future"), 31.0 }, -+ { -604800, ngettext("1 week in the future", "%d weeks in the future"), 52.0 }, -+ { -2419200, ngettext("1 month in the future", "%d months in the future"), 12.0 }, -+ { -31557600, ngettext("1 year in the future", "%d years in the future"), 1000.0 }, +diff -ur evolution-2.7.3/filter/filter-datespec.c my-evolution-2.7.3/filter/filter-datespec.c +--- evolution-2.7.3/filter/filter-datespec.c 2005-08-09 17:29:27.000000000 -0600 ++++ my-evolution-2.7.3/filter/filter-datespec.c 2006-06-28 20:51:01.000000000 -0600 +@@ -61,8 +61,10 @@ + + typedef struct _timespan { + guint32 seconds; +- const char *singular; +- const char *plural; ++ const char *past_singular; ++ const char *past_plural; ++ const char *future_singular; ++ const char *future_plural; + float max; + } timespan; + +@@ -75,13 +77,13 @@ + #define ngettext(a, b) a, b + + static const timespan timespans[] = { +- { 1, ngettext("1 second ago", "%d seconds ago"), 59.0 }, +- { 60, ngettext("1 minute ago", "%d minutes ago"), 59.0 }, +- { 3600, ngettext("1 hour ago", "%d hours ago"), 23.0 }, +- { 86400, ngettext("1 day ago", "%d days ago"), 31.0 }, +- { 604800, ngettext("1 week ago", "%d weeks ago"), 52.0 }, +- { 2419200, ngettext("1 month ago", "%d months ago"), 12.0 }, +- { 31557600, ngettext("1 year ago", "%d years ago"), 1000.0 }, ++ { 1, ngettext("1 second ago", "%d seconds ago"), ngettext("1 second in the future", "%d seconds in the future"), 59.0 }, ++ { 60, ngettext("1 minute ago", "%d minutes ago"), ngettext("1 minute in the future", "%d minutes in the future"), 59.0 }, ++ { 3600, ngettext("1 hour ago", "%d hours ago"), ngettext("1 hour in the future", "%d hours in the future"), 23.0 }, ++ { 86400, ngettext("1 day ago", "%d days ago"), ngettext("1 day in the future", "%d days in the future"), 31.0 }, ++ { 604800, ngettext("1 week ago", "%d weeks ago"), ngettext("1 week in the future", "%d weeks in the future"), 52.0 }, ++ { 2419200, ngettext("1 month ago", "%d months ago"), ngettext("1 month in the future", "%d months in the future"), 12.0 }, ++ { 31557600, ngettext("1 year ago", "%d years ago"), ngettext("1 year in the future", "%d years in the future"), 1000.0 }, }; /* now we let the compiler see the real function call */ +@@ -92,7 +94,7 @@ + + struct _FilterDatespecPrivate { + GtkWidget *label_button; +- GtkWidget *notebook_type, *option_type, *calendar_specify, *spin_relative, *option_relative; ++ GtkWidget *notebook_type, *option_type, *calendar_specify, *spin_relative, *option_relative, *option_past_future; + FilterDatespec_type type; + int span; + }; +@@ -264,7 +266,7 @@ + get_best_span (time_t val) + { + int i; +- ++ + for (i=N_TIMESPANS-1;i>=0;i--) { + if (val % timespans[i].seconds == 0) + return i; +@@ -302,8 +304,18 @@ + + span = get_best_span(fds->value); + count = fds->value / timespans[span].seconds; ++ sprintf(buf, ngettext(timespans[span].past_singular, timespans[span].past_plural, count), count); ++ } ++ break; ++ case FDST_X_FUTURE: ++ if (fds->value == 0) ++ label = _("now"); ++ else { ++ int span, count; + +- sprintf(buf, ngettext(timespans[span].singular, timespans[span].plural, count), count); ++ span = get_best_span(fds->value); ++ count = fds->value / timespans[span].seconds; ++ sprintf(buf, ngettext(timespans[span].future_singular, timespans[span].future_plural, count), count); + } + break; + } +@@ -329,6 +341,7 @@ + fds->value = mktime(&tm); + /* what about timezone? */ + break; } ++ case FDST_X_FUTURE: + case FDST_X_AGO: { + int val; + +@@ -349,6 +362,8 @@ + struct _FilterDatespecPrivate *p = PRIV(fds); + + p->type = fds->type==FDST_UNKNOWN ? FDST_NOW : fds->type; ++ ++ int note_type = fds->type==FDST_X_FUTURE ? FDST_X_AGO : fds->type; // FUTURE and AGO use the same notebook pages/etc. + + switch (p->type) { + case FDST_NOW: +@@ -368,11 +383,18 @@ + p->span = get_best_span(fds->value); + gtk_spin_button_set_value((GtkSpinButton*)p->spin_relative, fds->value/timespans[p->span].seconds); + gtk_option_menu_set_history((GtkOptionMenu*)p->option_relative, p->span); ++ gtk_option_menu_set_history((GtkOptionMenu*)p->option_past_future, 0); ++ break; ++ case FDST_X_FUTURE: ++ p->span = get_best_span(fds->value); ++ gtk_spin_button_set_value((GtkSpinButton*)p->spin_relative, fds->value/timespans[p->span].seconds); ++ gtk_option_menu_set_history((GtkOptionMenu*)p->option_relative, p->span); ++ gtk_option_menu_set_history((GtkOptionMenu*)p->option_past_future, 1); + break; + } + +- gtk_notebook_set_current_page ((GtkNotebook*) p->notebook_type, p->type); +- gtk_option_menu_set_history ((GtkOptionMenu*) p->option_type, p->type); ++ gtk_notebook_set_current_page ((GtkNotebook*) p->notebook_type, note_type); ++ gtk_option_menu_set_history ((GtkOptionMenu*) p->option_type, note_type); + } + + +@@ -397,6 +419,18 @@ + } + + static void ++set_option_past_future (GtkMenu *menu, FilterDatespec *fds) ++{ ++ GtkWidget *w; ++ ++ w = gtk_menu_get_active (menu); ++ if(g_list_index (GTK_MENU_SHELL (menu)->children, w) == 0) ++ fds->type = fds->priv->type = FDST_X_AGO; ++ else ++ fds->type = fds->priv->type = FDST_X_FUTURE; ++} ++ ++static void + button_clicked (GtkButton *button, FilterDatespec *fds) + { + struct _FilterDatespecPrivate *p = PRIV(fds); +@@ -424,6 +458,7 @@ + p->calendar_specify = glade_xml_get_widget (gui, "calendar_specify"); + p->spin_relative = glade_xml_get_widget (gui, "spin_relative"); + p->option_relative = glade_xml_get_widget (gui, "option_relative"); ++ p->option_past_future = glade_xml_get_widget (gui, "option_past_future"); + + set_values (fds); + +@@ -431,6 +466,8 @@ + G_CALLBACK (set_option_type), fds); + g_signal_connect (GTK_OPTION_MENU (p->option_relative)->menu, "deactivate", + G_CALLBACK (set_option_relative), fds); ++ g_signal_connect (GTK_OPTION_MENU (p->option_past_future)->menu, "deactivate", ++ G_CALLBACK (set_option_past_future), fds); + + gtk_box_pack_start ((GtkBox *) dialog->vbox, toplevel, TRUE, TRUE, 3); + +@@ -486,5 +523,8 @@ + case FDST_X_AGO: + g_string_append_printf (out, "(- (get-current-date) %d)", (int) fds->value); + break; ++ case FDST_X_FUTURE: ++ g_string_append_printf (out, "(+ (get-current-date) %d)", (int) fds->value); ++ break; + } + } +diff -ur evolution-2.7.3/filter/filter-datespec.h my-evolution-2.7.3/filter/filter-datespec.h +--- evolution-2.7.3/filter/filter-datespec.h 2002-11-01 16:22:57.000000000 -0700 ++++ my-evolution-2.7.3/filter/filter-datespec.h 2006-06-28 17:25:55.000000000 -0600 +@@ -42,6 +42,7 @@ + FDST_NOW, + FDST_SPECIFIED, + FDST_X_AGO, ++ FDST_X_FUTURE, + } FilterDatespec_type; + + struct _FilterDatespec { +@@ -52,7 +53,7 @@ + + /* either a timespan, an absolute time, or 0 + * depending on type -- the above mapping to +- * (X_AGO, SPECIFIED, NOW) ++ * (X_FUTURE, X_AGO, SPECIFIED, NOW) + */ + + time_t value; +diff -ur evolution-2.7.3/filter/filter.glade my-evolution-2.7.3/filter/filter.glade +--- evolution-2.7.3/filter/filter.glade 2005-12-20 11:21:51.000000000 -0700 ++++ my-evolution-2.7.3/filter/filter.glade 2006-06-28 17:26:00.000000000 -0600 +@@ -12,6 +12,13 @@ + False + True + False ++ True ++ False ++ False ++ GDK_WINDOW_TYPE_HINT_NORMAL ++ GDK_GRAVITY_NORTH_WEST ++ True ++ False + + + +@@ -21,7 +28,7 @@ + 6 + + +- ++ + True + Show filters for mail: + False +@@ -33,6 +40,10 @@ + 0.5 + 0 + 0 ++ PANGO_ELLIPSIZE_NONE ++ -1 ++ False ++ 0 + + + 0 +@@ -86,6 +97,10 @@ + 0.5 + 0 + 0 ++ PANGO_ELLIPSIZE_NONE ++ -1 ++ False ++ 0 + + + 0 +@@ -113,6 +128,10 @@ + 0.5 + 0 + 0 ++ PANGO_ELLIPSIZE_NONE ++ -1 ++ False ++ 0 + + + 0 +@@ -162,6 +181,7 @@ + gtk-add + True + GTK_RELIEF_NORMAL ++ True + + + +@@ -173,6 +193,7 @@ + _Edit + True + GTK_RELIEF_NORMAL ++ True + + + +@@ -184,6 +205,7 @@ + gtk-remove + True + GTK_RELIEF_NORMAL ++ True + + + +@@ -195,6 +217,7 @@ + gtk-goto-top + True + GTK_RELIEF_NORMAL ++ True + + + +@@ -206,6 +229,7 @@ + gtk-go-up + True + GTK_RELIEF_NORMAL ++ True + + + +@@ -217,6 +241,7 @@ + gtk-go-down + True + GTK_RELIEF_NORMAL ++ True + + + +@@ -228,6 +253,7 @@ + gtk-goto-bottom + True + GTK_RELIEF_NORMAL ++ True + + + +@@ -278,6 +304,13 @@ + False + True + False ++ True ++ False ++ False ++ GDK_WINDOW_TYPE_HINT_NORMAL ++ GDK_GRAVITY_NORTH_WEST ++ True ++ False + + + +@@ -305,6 +338,10 @@ + 0.5 + 0 + 0 ++ PANGO_ELLIPSIZE_NONE ++ -1 ++ False ++ 0 + + + 0 +@@ -403,6 +440,10 @@ + 0.5 + 0 + 0 ++ PANGO_ELLIPSIZE_NONE ++ -1 ++ False ++ 0 + + + 0 +@@ -430,6 +471,10 @@ + 0.5 + 0 + 0 ++ PANGO_ELLIPSIZE_NONE ++ -1 ++ False ++ 0 + + + tab +@@ -456,6 +501,10 @@ + 0.5 + 0 + 0 ++ PANGO_ELLIPSIZE_NONE ++ -1 ++ False ++ 0 + + + 0 +@@ -496,6 +545,10 @@ + 0.5 + 0 + 0 ++ PANGO_ELLIPSIZE_NONE ++ -1 ++ False ++ 0 + + + tab +@@ -522,6 +575,10 @@ + 0.5 + 0 + 0 ++ PANGO_ELLIPSIZE_NONE ++ -1 ++ False ++ 0 + + + 0 +@@ -631,18 +688,32 @@ + + + +- ++ + True +- ago +- False +- False +- GTK_JUSTIFY_CENTER +- False +- False +- 7.45058e-09 +- 0.5 +- 0 +- 0 ++ True ++ 0 ++ ++ ++ ++ True ++ ++ ++ ++ True ++ ago ++ True ++ ++ ++ ++ ++ ++ True ++ in the future ++ True ++ ++ ++ ++ + + + 0 +@@ -677,6 +748,10 @@ + 0.5 + 0 + 0 ++ PANGO_ELLIPSIZE_NONE ++ -1 ++ False ++ 0 + + + tab diff --git a/evolution.spec b/evolution.spec index 644f31b..a10f94f 100644 --- a/evolution.spec +++ b/evolution.spec @@ -47,7 +47,7 @@ Name: evolution Version: 2.7.3 -Release: 9 +Release: 10 License: GPL Group: Applications/Productivity Summary: GNOME's next-generation groupware suite @@ -125,7 +125,7 @@ Patch902: evolution-2.7.3-candidate-window-position-task.patch # RH bug #157505 / Gnome.org bug #303878 Patch903: evolution-2.7.3-candidate-window-position-calendar.patch -# Gnome.org #211058 - for Trever Adams to test +# RH bug #190359 / Gnome.org bug #211058 Patch904: evolution-2.7.3-filter-datespec.patch # RH bug #175596 / Gnome.org bug #323952 @@ -686,6 +686,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/evolution/%{evo_major}/libmenus.so %changelog +* Tue Jul 11 2006 Matthew Barnes - 2.7.3-10 +- Update patch for RH bug #190359. + * Fri Jul 7 2006 Matthew Barnes - 2.7.3-9 - Make "Submit Bug Report" menu item work again (RH #197384).