[evolution-patches] calendar, mail and exchange: patch for bug #231968



Hi,

I am sending 3 patches for bug #231968. 

1) mailer:   Included some .h files to resolve some symbols.
2) calendar: Added support for the Target selection for 'Tasks'.
3) exchange: Added the functionality for 'File->Permissions' menu-item
for Calendar, Tasks and Contacts.

Please review the patches.

Thanks,
Shakti

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2780
diff -u -p -r1.2780 ChangeLog
--- ChangeLog	25 Jul 2005 11:50:54 -0000	1.2780
+++ ChangeLog	26 Jul 2005 13:00:10 -0000
@@ -1,3 +1,12 @@
+2005-07-26  Shakti Sen <shprasad novell com>
+
+	* gui/tasks-control.c (tasks_control_sensitize_commands): Added support
+	for the Target selection for 'Tasks'.
+	* gui/e-calendar-table.c (e_calendar_table_open_selected): Resolved
+	one undefined symbol.
+
+	Fixes bug #231968.
+
 2005-07-25  Chenthill Palanisamy  <pchenthill novell com>
 
 	* gui/e-cal-popup.c: 
Index: gui/e-calendar-table.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-table.c,v
retrieving revision 1.136
diff -u -p -r1.136 e-calendar-table.c
--- gui/e-calendar-table.c	25 Jul 2005 07:53:18 -0000	1.136
+++ gui/e-calendar-table.c	26 Jul 2005 13:00:12 -0000
@@ -589,7 +589,7 @@ e_calendar_table_open_selected (ECalenda
 	ECalModelComponent *comp_data;
 	icalproperty *prop;
 
-	comp_data = get_selected_comp (cal_table);
+	comp_data = e_calendar_table_get_selected_comp (cal_table);
 	prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_ATTENDEE_PROPERTY);
 	if (comp_data != NULL)
 		e_calendar_table_open_task (cal_table, comp_data, prop ? TRUE : FALSE);
Index: gui/tasks-control.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/tasks-control.c,v
retrieving revision 1.81
diff -u -p -r1.81 tasks-control.c
--- gui/tasks-control.c	25 Jul 2005 07:53:18 -0000	1.81
+++ gui/tasks-control.c	26 Jul 2005 13:00:12 -0000
@@ -54,6 +54,9 @@
 #include "tasks-control.h"
 #include "evolution-shell-component-utils.h"
 #include "e-util/e-menu.h"
+#include "e-cal-menu.h"
+#include "e-calendar-view.h"
+#include "e-util/e-menu.h"
 #include "itip-utils.h"
 
 #define FIXED_MARGIN                            .05
@@ -150,6 +153,12 @@ tasks_control_sensitize_commands (Bonobo
 	gboolean read_only = TRUE;
 	ECal *ecal;
 	ECalModel *model;
+	ECalMenu *menu;
+	ECalMenuTargetSelect *t;
+	GPtrArray *events;
+	GList *selected, *l;
+	GtkWidget *view;
+
 	ECalendarTable *cal_table;
 	ECalModelComponent *comp_data;
 	icalproperty *prop;
@@ -161,6 +170,17 @@ tasks_control_sensitize_commands (Bonobo
 	if (bonobo_ui_component_get_container (uic) == CORBA_OBJECT_NIL)
 		return;
 
+	menu = gnome_tasks_get_tasks_menu (tasks);
+	model = e_calendar_table_get_model (e_tasks_get_calendar_table (tasks));
+	events = g_ptr_array_new ();
+	selected = e_calendar_table_get_selected (e_tasks_get_calendar_table (tasks));
+	for (l = selected;l;l = g_list_next (l)) {
+		g_ptr_array_add (events, e_cal_model_copy_component_data ((ECalModelComponent *)l->data));
+	}
+	g_list_free (selected);
+
+	t = e_cal_menu_target_new_select (menu, model, events);
+
 	cal_table = e_tasks_get_calendar_table (tasks);
 	model = e_calendar_table_get_model (cal_table);
 
@@ -203,6 +223,7 @@ tasks_control_sensitize_commands (Bonobo
 	bonobo_ui_component_set_prop (uic, "/commands/TasksForward", "sensitive",
 				      n_selected != 1 ? "0" : "1", 
 				      NULL);
+	e_menu_update_target ((EMenu *)menu, (EMenuTarget *)t);
 }
 
 /* Callback used when the selection in the table changes */
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3661
diff -u -p -r1.3661 ChangeLog
--- ChangeLog	26 Jul 2005 16:35:43 -0000	1.3661
+++ ChangeLog	27 Jul 2005 07:57:56 -0000
@@ -1,3 +1,12 @@
+2005-07-27  Shakti Sen <shprasad novell com>
+
+	* em-composer-prefs.c: Included 'gtkentry.h' to resolve the
+	symbol 'GTK_ENTRY'.
+	* mail-ops.c: Included 'camel-multipart.h' to resolve the 
+	symbol 'CAMEL_IS_MULTIPART'
+
+	Partly fixes bug #231968.
+
 2005-07-26  Harish Krishnaswamy  <kharish novell com>
 
 	* Makefile.am: fix make distcheck issues.
Index: em-composer-prefs.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-composer-prefs.c,v
retrieving revision 1.28
diff -u -p -r1.28 em-composer-prefs.c
--- em-composer-prefs.c	23 Jun 2005 09:11:06 -0000	1.28
+++ em-composer-prefs.c	27 Jul 2005 07:57:57 -0000
@@ -41,6 +41,7 @@
 #include <libedataserver/e-iconv.h>
 #include <misc/e-gui-utils.h>
 
+#include <gtk/gtkentry.h>
 #include <gtk/gtktreemodel.h>
 #include <gtk/gtkliststore.h>
 #include <gtk/gtktreeselection.h>
Index: mail-ops.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-ops.c,v
retrieving revision 1.448
diff -u -p -r1.448 mail-ops.c
--- mail-ops.c	21 Jul 2005 04:15:21 -0000	1.448
+++ mail-ops.c	27 Jul 2005 07:57:59 -0000
@@ -50,6 +50,7 @@
 #include <camel/camel-vtrash-folder.h>
 #include <camel/camel-vee-store.h>
 #include <camel/camel-transport.h>
+#include <camel/camel-multipart.h>
 
 #include "mail-component.h"
 #include "mail-config.h"
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/ChangeLog,v
retrieving revision 1.34
diff -u -p -r1.34 ChangeLog
--- ChangeLog	25 Jul 2005 12:11:25 -0000	1.34
+++ ChangeLog	26 Jul 2005 12:08:07 -0000
@@ -1,3 +1,12 @@
+2005-07-26  Shakti Sen <shprasad novell com>
+
+	* Makefile.am: Included 'calendar' in INCLUDES and some .la in 
+	'liborg_gnome_exchange_operations_la_LIBADD'
+	* exchange-folder-permission.c: Added the functionality for 
+	'File->Permissions' menu-item for Calendar, Tasks and Contacts.
+
+	Fixes bug #231968.
+
 2005-07-25  Shakti Sen <shprasad novell com>
 
 	* org-gnome-exchange-operations.eplug.in: Fixed a small typo.
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/Makefile.am,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile.am
--- Makefile.am	25 Jul 2005 07:37:03 -0000	1.12
+++ Makefile.am	26 Jul 2005 12:08:07 -0000
@@ -1,6 +1,7 @@
 INCLUDES = -I .						\
 	-I$(top_srcdir)	                                \
 	-I$(top_srcdir)/widgets				\
+	-I$(top_srcdir)/calendar			\
 	$(EVOLUTION_MAIL_CFLAGS) 			\
 	$(CAMEL_EXCHANGE_CFLAGS)                        \
 	$(CAMEL_CFLAGS)					\
@@ -49,7 +50,11 @@ liborg_gnome_exchange_operations_la_SOUR
 liborg_gnome_exchange_operations_la_LIBADD = 		\
 	$(top_builddir)/e-util/libeutil.la 			\
 	$(top_builddir)/widgets/misc/libemiscwidgets.la		\
+	$(top_builddir)/calendar/gui/libevolution-calendar.la \
+	$(top_builddir)/mail/libevolution-mail.la \
+	$(top_builddir)/addressbook/gui/component/libevolution-addressbook.la \
 	$(CAMEL_LIBS)						\
+	$(EVOLUTION_MAIL_LIBS)				\
 	$(CAMEL_EXCHANGE_LIBS)
 
 liborg_gnome_exchange_operations_la_LDFLAGS = -module -avoid-version
Index: exchange-folder-permission.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-folder-permission.c,v
retrieving revision 1.5
diff -u -p -r1.5 exchange-folder-permission.c
--- exchange-folder-permission.c	25 Jul 2005 07:37:03 -0000	1.5
+++ exchange-folder-permission.c	26 Jul 2005 12:08:08 -0000
@@ -34,6 +34,7 @@
 #include <libedataserverui/e-source-selector.h>
 #include <mail/em-popup.h>
 #include <mail/em-menu.h>
+#include <libebook/e-book.h>
 #include "exchange-config-listener.h"
 #include "exchange-operations.h"
 #include "exchange-permissions-dialog.h"
@@ -227,37 +228,95 @@ org_gnome_exchange_menu_folder_permissio
 void
 org_gnome_exchange_menu_cal_permissions (EPlugin *ep, ECalMenuTargetSelect *target)
 {
-#if 0
 	ExchangeAccount *account = NULL;
 	EFolder *folder = NULL;
-	ECalModel *model = target->model;
-	ECal *ecal;
-	ecal = e_cal_model_get_default_client (model);
-	gchar *uri = e_cal_get_uri (ecal);
-	
-
-	if (target == NULL)
-		return;
+	ECalModel *model = NULL;
+	ECal *ecal = NULL;
+	gchar *uri = NULL;
 
 	account = exchange_operations_get_exchange_account ();
 
 	if (!account)
 		return;
 
-	//folder = exchange_account_get_folder (account, target->target->uri);
-	//if (folder)
-	//	exchange_permissions_dialog_new (account, folder, NULL);
-#endif
+	if (!target)
+		return;
+
+	if (target->model)
+		model = E_CAL_MODEL (target->model);
+
+	if (model)
+		ecal = e_cal_model_get_default_client (model);
+
+	if (ecal)
+		uri = (gchar *) e_cal_get_uri (ecal);
+
+	if (uri)
+		folder = exchange_account_get_folder (account, uri);
+
+	if (folder)
+		exchange_permissions_dialog_new (account, folder, NULL);
 }
 
 void
 org_gnome_exchange_menu_tasks_permissions (EPlugin *ep, ECalMenuTargetSelect *target)
 {
+	ExchangeAccount *account = NULL;
+	EFolder *folder = NULL;
+	ECalModel *model = NULL;
+	ECal *ecal = NULL;
+	gchar *uri = NULL;
+
+	account = exchange_operations_get_exchange_account ();
+
+	if (!account)
+		return;
+
+	if (!target)
+		return;
+
+	if (target->model)
+		model = E_CAL_MODEL (target->model);
+
+	if (model)
+		ecal = e_cal_model_get_default_client (model);
+
+	if (ecal)
+		uri = (gchar *) e_cal_get_uri (ecal);
+
+	if (uri)
+		folder = exchange_account_get_folder (account, uri);
+
+	if (folder)
+		exchange_permissions_dialog_new (account, folder, NULL);
 
 }
 
 void
 org_gnome_exchange_menu_ab_permissions (EPlugin *ep, EABMenuTargetSelect *target)
 {
+	ExchangeAccount *account = NULL;
+	EFolder *folder = NULL;
+	EBook *ebook = NULL;
+	gchar *uri = NULL;
+
+	if (!target)
+		return;
+
+	account = exchange_operations_get_exchange_account ();
+
+	if (!account)
+		return;
 
+	if (target->book)
+		ebook = E_BOOK (target->book);
+
+	if (ebook)
+		uri = (gchar *) e_book_get_uri (ebook);
+
+	if (uri)
+		folder = exchange_account_get_folder (account, uri);
+
+	if (folder)
+		exchange_permissions_dialog_new (account, folder, NULL);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]