rpms/evolution/F-13 evolution-2.30.2-handle-startdate-uris.patch, NONE, 1.1 evolution.spec, 1.460, 1.461

Matthew Barnes mbarnes at fedoraproject.org
Thu Jun 24 17:28:59 UTC 2010


Author: mbarnes

Update of /cvs/pkgs/rpms/evolution/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv30346

Modified Files:
	evolution.spec 
Added Files:
	evolution-2.30.2-handle-startdate-uris.patch 
Log Message:

* Thu Jun 24 2010 Matthew Barnes <mbarnes at redhat.com> - 2.30.2-3.fc13
- Add patch for GNOME bug #622633 (handle startdate URIs).


evolution-2.30.2-handle-startdate-uris.patch:
 modules/calendar/e-cal-shell-backend.c |   83 ++++++++++++++++++++++++++++++++-
 modules/calendar/e-cal-shell-backend.h |    4 +
 widgets/misc/e-calendar-item.c         |   12 ++--
 widgets/misc/e-calendar-item.h         |    4 -
 4 files changed, 94 insertions(+), 9 deletions(-)

--- NEW FILE evolution-2.30.2-handle-startdate-uris.patch ---
diff -up evolution-2.30.2/modules/calendar/e-cal-shell-backend.c.handle-startdate-uris evolution-2.30.2/modules/calendar/e-cal-shell-backend.c
--- evolution-2.30.2/modules/calendar/e-cal-shell-backend.c.handle-startdate-uris	2010-06-20 08:14:46.000000000 -0400
+++ evolution-2.30.2/modules/calendar/e-cal-shell-backend.c	2010-06-24 13:26:43.866095974 -0400
@@ -48,6 +48,7 @@
 #include "e-cal-shell-content.h"
 #include "e-cal-shell-migrate.h"
 #include "e-cal-shell-settings.h"
+#include "e-cal-shell-sidebar.h"
 #include "e-cal-shell-view.h"
 
 #define E_CAL_SHELL_BACKEND_GET_PRIVATE(obj) \
@@ -539,6 +540,8 @@ cal_shell_backend_handle_uri_cb (EShellB
 	gchar *source_uid = NULL;
 	gchar *comp_uid = NULL;
 	gchar *comp_rid = NULL;
+	GDate start_date;
+	GDate end_date;
 	gboolean handled = FALSE;
 	GError *error = NULL;
 
@@ -553,6 +556,9 @@ cal_shell_backend_handle_uri_cb (EShellB
 	if (cp == NULL)
 		goto exit;
 
+	g_date_clear (&start_date, 1);
+	g_date_clear (&end_date, 1);
+
 	while (*cp != '\0') {
 		gchar *header;
 		gchar *content;
@@ -572,7 +578,13 @@ cal_shell_backend_handle_uri_cb (EShellB
 		content_len = strcspn (cp, "&");
 
 		content = g_strndup (cp, content_len);
-		if (g_ascii_strcasecmp (header, "source-uid") == 0)
+		if (g_ascii_strcasecmp (header, "startdate") == 0)
+			g_date_set_time_t (
+				&start_date, time_from_isodate (content));
+		else if (g_ascii_strcasecmp (header, "enddate") == 0)
+			g_date_set_time_t (
+				&end_date, time_from_isodate (content));
+		else if (g_ascii_strcasecmp (header, "source-uid") == 0)
 			source_uid = g_strdup (content);
 		else if (g_ascii_strcasecmp (header, "comp-uid") == 0)
 			comp_uid = g_strdup (content);
@@ -588,6 +600,21 @@ cal_shell_backend_handle_uri_cb (EShellB
 		}
 	}
 
+	/* This is primarily for launching Evolution
+	 * from the calendar in the clock applet. */
+	if (g_date_valid (&start_date)) {
+		if (g_date_valid (&end_date))
+			e_cal_shell_backend_open_date_range (
+				E_CAL_SHELL_BACKEND (shell_backend),
+				&start_date, &end_date);
+		else
+			e_cal_shell_backend_open_date_range (
+				E_CAL_SHELL_BACKEND (shell_backend),
+				&start_date, NULL);
+		handled = TRUE;
+		goto exit;
+	}
+
 	if (source_uid == NULL || comp_uid == NULL)
 		goto exit;
 
@@ -831,3 +858,57 @@ e_cal_shell_backend_get_source_list (ECa
 
 	return cal_shell_backend->priv->source_list;
 }
+
+void
+e_cal_shell_backend_open_date_range (ECalShellBackend *cal_shell_backend,
+                                     const GDate *start_date,
+                                     const GDate *end_date)
+{
+	EShell *shell;
+	EShellView *shell_view;
+	EShellBackend *shell_backend;
+	EShellSidebar *shell_sidebar;
+	GtkWidget *shell_window = NULL;
+	ECalendar *navigator;
+	GList *watched_windows;
+
+	g_return_if_fail (E_IS_CAL_SHELL_BACKEND (cal_shell_backend));
+
+	shell_backend = E_SHELL_BACKEND (cal_shell_backend);
+	shell = e_shell_backend_get_shell (shell_backend);
+	watched_windows = e_shell_get_watched_windows (shell);
+
+	/* Try to find an EShellWindow already in calendar view. */
+	while (watched_windows != NULL) {
+		GtkWidget *window = GTK_WIDGET (watched_windows->data);
+
+		if (E_IS_SHELL_WINDOW (window)) {
+			const gchar *active_view;
+
+			active_view = e_shell_window_get_active_view (
+				E_SHELL_WINDOW (window));
+			if (g_strcmp0 (active_view, "calendar") == 0) {
+				gtk_window_present (GTK_WINDOW (window));
+				shell_window = window;
+				break;
+			}
+		}
+
+		watched_windows = g_list_next (watched_windows);
+	}
+
+	/* Otherwise create a new EShellWindow in calendar view. */
+	if (shell_window == NULL)
+		shell_window = e_shell_create_shell_window (shell, "calendar");
+
+	/* Now dig up the date navigator and select the date range. */
+
+	shell_view = e_shell_window_get_shell_view (
+		E_SHELL_WINDOW (shell_window), "calendar");
+	shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
+	navigator = e_cal_shell_sidebar_get_date_navigator (
+		E_CAL_SHELL_SIDEBAR (shell_sidebar));
+
+	e_calendar_item_set_selection (
+		navigator->calitem, start_date, end_date);
+}
diff -up evolution-2.30.2/modules/calendar/e-cal-shell-backend.h.handle-startdate-uris evolution-2.30.2/modules/calendar/e-cal-shell-backend.h
--- evolution-2.30.2/modules/calendar/e-cal-shell-backend.h.handle-startdate-uris	2010-06-20 08:14:47.000000000 -0400
+++ evolution-2.30.2/modules/calendar/e-cal-shell-backend.h	2010-06-24 13:26:43.867095475 -0400
@@ -64,6 +64,10 @@ void		e_cal_shell_backend_register_type
 					(GTypeModule *type_module);
 ESourceList *	e_cal_shell_backend_get_source_list
 					(ECalShellBackend *cal_shell_backend);
+void		e_cal_shell_backend_open_date_range
+					(ECalShellBackend *cal_shell_backend,
+					 const GDate *start_date,
+					 const GDate *end_date);
 
 G_END_DECLS
 
diff -up evolution-2.30.2/widgets/misc/e-calendar-item.c.handle-startdate-uris evolution-2.30.2/widgets/misc/e-calendar-item.c
--- evolution-2.30.2/widgets/misc/e-calendar-item.c.handle-startdate-uris	2010-06-20 08:14:29.000000000 -0400
+++ evolution-2.30.2/widgets/misc/e-calendar-item.c	2010-06-24 13:26:43.871094945 -0400
@@ -188,8 +188,8 @@ static void e_calendar_item_date_range_c
 static void e_calendar_item_queue_signal_emission	(ECalendarItem	*calitem);
 static gboolean e_calendar_item_signal_emission_idle_cb	(gpointer data);
 static void e_calendar_item_set_selection_if_emission (ECalendarItem	*calitem,
-						       GDate		*start_date,
-						       GDate		*end_date,
+						       const GDate	*start_date,
+						       const GDate	*end_date,
 						       gboolean emission);
 
 /* Our arguments. */
@@ -3094,8 +3094,8 @@ e_calendar_item_get_selection		(ECalenda
 
 static void
 e_calendar_item_set_selection_if_emission (ECalendarItem	*calitem,
-					   GDate		*start_date,
-					   GDate		*end_date,
+					   const GDate		*start_date,
+					   const GDate		*end_date,
 					   gboolean emission)
 {
 	gint start_year, start_month, start_day;
@@ -3197,8 +3197,8 @@ e_calendar_item_style_set (GtkWidget *wi
 
 void
 e_calendar_item_set_selection (ECalendarItem	*calitem,
-			       GDate		*start_date,
-			       GDate		*end_date)
+			       const GDate	*start_date,
+			       const GDate	*end_date)
 {
 	/* If the user is in the middle of a selection, we must abort it. */
 	if (calitem->selecting) {
diff -up evolution-2.30.2/widgets/misc/e-calendar-item.h.handle-startdate-uris evolution-2.30.2/widgets/misc/e-calendar-item.h
--- evolution-2.30.2/widgets/misc/e-calendar-item.h.handle-startdate-uris	2010-06-20 08:14:33.000000000 -0400
+++ evolution-2.30.2/widgets/misc/e-calendar-item.h	2010-06-24 13:26:43.871094945 -0400
@@ -319,8 +319,8 @@ gboolean
    the start of the selection is shown. If start_date is NULL it clears the
    selection. */
 void	e_calendar_item_set_selection		(ECalendarItem *calitem,
-						 GDate *start_date,
-						 GDate *end_date);
+						 const GDate *start_date,
+						 const GDate *end_date);
 
 /* Marks a particular day. Passing E_CALENDAR_ITEM_MARK_BOLD as the day style
    will result in the day being shown as bold by default. The style callback


Index: evolution.spec
===================================================================
RCS file: /cvs/pkgs/rpms/evolution/F-13/evolution.spec,v
retrieving revision 1.460
retrieving revision 1.461
diff -u -p -r1.460 -r1.461
--- evolution.spec	24 Jun 2010 15:21:32 -0000	1.460
+++ evolution.spec	24 Jun 2010 17:28:59 -0000	1.461
@@ -39,7 +39,7 @@
 
 Name: evolution
 Version: 2.30.2
-Release: 2%{?dist}
+Release: 3%{?dist}
 Group: Applications/Productivity
 Summary: Mail and calendar client for GNOME
 License: GPLv2+ and GFDL
@@ -68,6 +68,9 @@ Patch14: evolution-2.30.1-help-contents.
 # GNOME bug #622547
 Patch15: evolution-2.30.2-async-event-idle-cb.patch
 
+# GNOME bug #622633
+Patch16: evolution-2.30.2-handle-startdate-uris.patch
+
 ## Dependencies ###
 
 Requires(pre): GConf2
@@ -235,6 +238,7 @@ This package contains the plugin to impo
 %patch12 -p1 -b .im-context-reset
 %patch14 -p1 -b .help-contents
 %patch15 -p1 -b .async-event-idle-cb
+%patch16 -p1 -b .handle-startdate-uris
 
 mkdir -p krb5-fakeprefix/include
 mkdir -p krb5-fakeprefix/lib
@@ -683,6 +687,9 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 
 %changelog
+* Thu Jun 24 2010 Matthew Barnes <mbarnes at redhat.com> - 2.30.2-3.fc13
+- Add patch for GNOME bug #622633 (handle startdate URIs).
+
 * Thu Jun 24 2010 Matthew Barnes <mbarnes at redhat.com> - 2.30.2-2.fc13
 - Add patch for GNOME bug #622547 (uncancelled idle cb in destroy).
 



More information about the scm-commits mailing list