[evolution-patches] patch for bug #248126



hi,

  I have added few menus in main menu bar under Actions sub menu  which 
  were accessible only right clicking on a task.

Thanx,
Viren.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2742
diff -u -p -w -r1.2742 ChangeLog
--- ChangeLog	30 May 2005 09:14:26 -0000	1.2742
+++ ChangeLog	7 Jun 2005 09:20:45 -0000
@@ -1,3 +1,19 @@
+2005-06-07  Viren <lviren novell com>
+	* gui/tasks-control.c: Adding 2 Bonobo UI verbs and definition for associated control
+	commands.
+	* evolution/ui/evolution-tasks.xml: Adding 2 sub menus under Action menu of the main menu bar
+	and defining appropriate short-cut/accelerators.
+	* gui/e-calendar-table.c: Added function to open an event editor for selected task.  	
+	Fixes #248126
+
+2005-06-07  Viren <lviren novell com>
+	
+	* gui/e-calendar-view.c:(e_calendar_view_edit_appointment):Check whether calendar is 
+	read only and display warning dialog if user attempts to add appointment.
+	Specify the sensitivity mask E_CAL_POPUP_SELECT_EDITABLE for the popup items 
+	New Appointment,New AlldayEvent and Meeting.
+	Fixes #271541
+	
 2005-05-30  Thouis R. Jones  <thouis csail mit edu>
 
 	Fixes #272301
Index: gui/tasks-control.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/tasks-control.c,v
retrieving revision 1.79
diff -u -p -w -r1.79 tasks-control.c
--- gui/tasks-control.c	21 Jan 2005 18:15:42 -0000	1.79
+++ gui/tasks-control.c	7 Jun 2005 09:20:45 -0000
@@ -53,6 +53,7 @@
 #include "print.h"
 #include "tasks-control.h"
 #include "evolution-shell-component-utils.h"
+#include "dialogs/task-editor.h"
 
 #define FIXED_MARGIN                            .05
 
@@ -91,6 +92,15 @@ static void tasks_control_print_preview_
 						 gpointer		 data,
 						 const char		*path);
 
+static void tasks_control_assign_cmd           (BonoboUIComponent      *uic,
+						 gpointer               data,
+						 const char             *path);
+
+static void tasks_control_forward_cmd          (BonoboUIComponent      *uic,
+						 gpointer		data,
+						 const char		*path);
+
+static void get_selected_row (int model_row ,gpointer *data);
 
 BonoboControl *
 tasks_control_new (void)
@@ -198,6 +208,8 @@ static BonoboUIVerb verbs [] = {
 	BONOBO_UI_VERB ("TasksPurge", tasks_control_purge_cmd),
 	BONOBO_UI_VERB ("TasksPrint", tasks_control_print_cmd),
 	BONOBO_UI_VERB ("TasksPrintPreview", tasks_control_print_preview_cmd),
+	BONOBO_UI_VERB ("TasksAssignTask", tasks_control_assign_cmd),
+	BONOBO_UI_VERB ("TasksForward", tasks_control_forward_cmd),
 
 	BONOBO_UI_VERB_END
 };
@@ -433,3 +445,62 @@ tasks_control_print_preview_cmd (BonoboU
 	print_tasks (tasks, TRUE);
 }
 
+static void
+tasks_control_assign_cmd (BonoboUIComponent *uic,
+	                  gpointer data,
+		          const char *path)
+{
+	       ETasks *tasks;
+	       ECalendarTable *cal_table;
+	       ECalModelComponent *comp_data;
+	       TaskEditor *te;
+	       
+	       tasks = E_TASKS (data);
+	       cal_table = e_tasks_get_calendar_table (tasks);
+	       comp_data = get_selected_comp (cal_table);
+	       te = task_editor_new (comp_data->client ,TRUE);
+	       task_editor_open_task_with_assignment (cal_table, comp_data, TRUE);
+}
+
+static void
+tasks_control_forward_cmd (BonoboUIComponent *uic,
+	                   gpointer data,
+	                   const char *path)
+{	        ETasks *tasks;
+	        ECalendarTable *cal_table;
+	        ECalModelComponent *comp_data;
+	        
+	        tasks = E_TASKS (data);
+		cal_table = e_tasks_get_calendar_table (tasks);
+		comp_data = get_selected_comp (cal_table);
+		if (comp_data) {
+			ECalComponent *comp;  
+			comp = e_cal_component_new ();
+			e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp));
+			itip_send_comp (E_CAL_COMPONENT_METHOD_PUBLISH, comp, comp_data->client, NULL, NULL);
+			g_object_unref (comp);
+		}       
+}
+			
+static ECalModelComponent *
+get_selected_comp (ECalendarTable *cal_table)
+{
+		ETable *etable;
+		int row;
+		etable = e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable));
+		if (e_table_selected_count (etable) != 1)
+			return NULL;     
+		row = -1;     
+		e_table_selected_row_foreach (etable ,get_selected_row ,&row);
+		g_assert (row != -1);
+		return e_cal_model_get_component_at (cal_table->model, row);
+}
+
+static void 
+get_selected_row (int model_row ,gpointer *data)
+{
+		int *row;
+		row = data;
+		*row = model_row;
+}
+
Index: gui/e-calendar-table.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-table.c,v
retrieving revision 1.132
diff -u -p -w -r1.132 e-calendar-table.c
--- gui/e-calendar-table.c	25 Jan 2005 11:18:16 -0000	1.132
+++ gui/e-calendar-table.c	7 Jun 2005 09:20:45 -0000
@@ -1369,3 +1369,8 @@ e_calendar_table_set_status_message (ECa
                 e_activity_handler_operation_progressing (cal_table->activity_handler, cal_table->activity_id, message, -1.0);
 	}
 }
+void 
+task_editor_open_task_with_assignment (ECalendarTable *cal_table, ECalModelComponent *comp_data, gboolean assign)
+{
+	open_task (cal_table, comp_data, assign);
+}


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