[evolution-patches] UI-HACKFEST:Assign task and Forward as iCalendar not available in the menu bar.



Hi,

	Attached patch adds sub menus Assign Task and Forward as iCalendar to
the Actions menu.






Thanks,
Viren.
Index: gui/tasks-control.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/tasks-control.c,v
retrieving revision 1.79
diff -u -p -r1.79 tasks-control.c
--- gui/tasks-control.c	21 Jan 2005 18:15:42 -0000	1.79
+++ gui/tasks-control.c	21 Jul 2005 07:40:15 -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
 
@@ -90,7 +91,17 @@ static void tasks_control_print_cmd		(Bo
 static void tasks_control_print_preview_cmd	(BonoboUIComponent	*uic,
 						 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);
+	  
+static ECalModelComponent * get_selected_comp (ECalendarTable *cal_table);
 
 BonoboControl *
 tasks_control_new (void)
@@ -174,6 +185,12 @@ tasks_control_sensitize_commands (Bonobo
 	bonobo_ui_component_set_prop (uic, "/commands/TasksPurge", "sensitive",
 				      read_only ? "0" : "1",
 				      NULL);
+	bonobo_ui_component_set_prop (uic, "/commands/TasksAssign", "sensitive",
+				      read_only ? "0" : "1" ,
+			              NULL); 	      
+	bonobo_ui_component_set_prop (uic, "/commands/TasksForward", "sensitive",
+				      read_only ? "0" : "1" , 
+				      NULL);
 }
 
 /* Callback used when the selection in the table changes */
@@ -198,7 +215,9 @@ 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 +452,65 @@ 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);
+	       if (comp_data) {
+              te = task_editor_new (comp_data->client ,TRUE);
+              e_calendar_table_open_task (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.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-table.h,v
retrieving revision 1.27
diff -u -p -r1.27 e-calendar-table.h
--- gui/e-calendar-table.h	2 Jul 2005 14:54:44 -0000	1.27
+++ gui/e-calendar-table.h	21 Jul 2005 07:40:16 -0000
@@ -104,6 +104,9 @@ void       e_calendar_table_set_activity
 void       e_calendar_table_set_status_message (ECalendarTable *cal_table,
 						const gchar *message,
 						int percent);
+void 	   e_calendar_table_open_task (ECalendarTable *cal_table, 
+				       ECalModelComponent *comp_data, 
+				       gboolean assign);
 
 G_END_DECLS
 
Index: gui/e-calendar-table.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-table.c,v
retrieving revision 1.135
diff -u -p -r1.135 e-calendar-table.c
--- gui/e-calendar-table.c	2 Jul 2005 14:54:44 -0000	1.135
+++ gui/e-calendar-table.c	21 Jul 2005 07:40:27 -0000
@@ -1378,3 +1378,10 @@ e_calendar_table_set_status_message (ECa
                 e_activity_handler_operation_progressing (cal_table->activity_handler, cal_table->activity_id, message, progress);
 	}
 }
+
+void
+e_calendar_table_open_task (ECalendarTable *cal_table, ECalModelComponent *comp_data, gboolean assign)
+{
+       open_task (cal_table, comp_data, assign);
+}
+			    
Index: ../ui/evolution-tasks.xml
===================================================================
RCS file: /cvs/gnome/evolution/ui/evolution-tasks.xml,v
retrieving revision 1.37
diff -u -p -r1.37 evolution-tasks.xml
--- ../ui/evolution-tasks.xml	13 May 2005 21:29:27 -0000	1.37
+++ ../ui/evolution-tasks.xml	21 Jul 2005 07:40:27 -0000
@@ -13,6 +13,8 @@
     <cmd name="TasksMarkComplete" _tip="Mark selected tasks as complete" accel="*Control*k" sensitive="0"/>
 
     <cmd name="TasksPurge" _label="Purg_e" _tip="Delete completed tasks" accel="*Control*e"/>
+    <cmd name="TasksAssignTask" _label="_Assign Task" accel="*Control*a"/>
+    <cmd name="TasksForward" _label="_Forward as iCalendar" accel="*Control*f"/>
   </commands>
   
   <menu>
@@ -47,6 +49,8 @@
     <placeholder name="ActionsPlaceholder">
     <submenu name="Actions" _label="_Actions">
 	<menuitem name="TasksPurge" verb=""/>
+	<menuitem name="TasksAssignTask" verb=""/>
+	<menuitem name="TasksForward" verb=""/>
     </submenu>
     </placeholder>
 
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2770
diff -u -p -r1.2770 ChangeLog
--- ChangeLog	13 Jul 2005 10:36:14 -0000	1.2770
+++ ChangeLog	21 Jul 2005 07:40:54 -0000
@@ -1,3 +1,15 @@
+2005-07-21  Viren.l  <lviren novel com>
+	
+	* gui/tasks-control.c (tasks_control_assign_cmd)
+	  (tasks_control_froward_cmd): Added 2 Bonobo UI verbs for Assign Task and Forward as iCalendar
+	  and the definitions to commands.
+	  (get_selected_comp) (get_selected_row):To get the selected task. 
+	* ../../ui/evolution-tasks.xml : Added two submenus under the Action menu.
+	* gui/e-calendar-table.[h, c] (e_calendar_table_open_task): Added to open task with 
+	  assignment tab shown.
+
+	  Fixes:248126
+	
 2005-07-08  Kjartan Maraas  <kmaraas gnome org>
 
 	* gui/alarm-notify/alarm-notify.c: (alarm_notify_add_calendar):


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