[evolution-patches] Re: A patch for calender



Hi Rodrigo

Hi Kidd

We just realized a couple of things about your commit. First, the patch
wasn't sent to the e-patches list, but to JP and myself personally.
Please send *all* patches to the list, so that they can get broader
review.

Ok. Thanks for your kind reminding to a newcomer:-)
The original patch is enclosed this time.

Also, it seems the ChangeLog entry does not reflect all changes you did.
For instance, calendar-commands.c has been modified, and there is no
entry in the ChangeLog for it.
In your last letter you argue that the 'read_only' flag has nothing to do with whether the task can be opened or not. The similarity between the calenders and the tasks remind me that the condition of when to allow to open events in the calender should
alse follow your arguement. Therefore I removed the read_only flag from
calender-commands.c. Do you agree? Sorry for missing the corresponding entry in
the ChangeLog.

Also, e-cal-view.h seems to have some
changes committed not related to the patch.

Sure. It seems that another unralated patch has not been unpatched cleanly and I've removed it.
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2032
diff -u -r1.2032 ChangeLog
--- calendar/ChangeLog	29 Dec 2003 09:58:31 -0000	1.2032
+++ calendar/ChangeLog	6 Jan 2004 05:22:06 -0000
@@ -1,3 +1,13 @@
+2003-12-31  Kidd Wang  <kidd wang sun com>
+
+	* gui/e-calendar-table.[ch] (e_calendar_table_open_selected):
+	open a dialog for the selected task.
+
+	* gui/e-tasks.[ch] (e_tasks_open_task): ditto.
+
+	* gui/tasks-control.c (tasks_control_sensitize_commands),
+	(tasks_control_open_task_cmd): add a menu item for "Open Task".
+
 2003-12-29  Kidd Wang  <kidd wang sun com>
 
 	* gui/calendar-commands.c (file_open_event_cb): add a menu item
Index: calendar/gui/calendar-commands.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/calendar-commands.c,v
retrieving revision 1.139
diff -u -r1.139 calendar-commands.c
--- calendar/gui/calendar-commands.c	29 Dec 2003 09:58:32 -0000	1.139
+++ calendar/gui/calendar-commands.c	6 Jan 2004 05:22:08 -0000
@@ -544,7 +544,7 @@
 	}
 
 	bonobo_ui_component_set_prop (uic, "/commands/EventOpen", "sensitive",
-				      n_selected == 0 || read_only ? "0" : "1",
+				      n_selected != 1 ? "0" : "1",
 				      NULL);
 	bonobo_ui_component_set_prop (uic, "/commands/Cut", "sensitive",
 				      n_selected == 0 || read_only ? "0" : "1",
Index: calendar/gui/e-calendar-table.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-table.c,v
retrieving revision 1.104
diff -u -r1.104 e-calendar-table.c
--- calendar/gui/e-calendar-table.c	29 Dec 2003 09:58:32 -0000	1.104
+++ calendar/gui/e-calendar-table.c	6 Jan 2004 05:22:10 -0000
@@ -589,6 +589,16 @@
 	return e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable));
 }
 
+void
+e_calendar_table_open_selected (ECalendarTable *cal_table)
+{
+	ECalModelComponent *comp_data;
+
+	comp_data = get_selected_comp (cal_table);
+	if (comp_data != NULL)
+		open_task (cal_table, comp_data, FALSE);
+}
+
 /**
  * e_calendar_table_complete_selected:
  * @cal_table: A calendar table
Index: calendar/gui/e-calendar-table.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-table.h,v
retrieving revision 1.20
diff -u -r1.20 e-calendar-table.h
--- calendar/gui/e-calendar-table.h	16 Dec 2003 23:29:07 -0000	1.20
+++ calendar/gui/e-calendar-table.h	6 Jan 2004 05:22:11 -0000
@@ -76,6 +76,7 @@
 
 ETable    *e_calendar_table_get_table (ECalendarTable *cal_table);
 
+void       e_calendar_table_open_selected (ECalendarTable *cal_table);
 void       e_calendar_table_complete_selected (ECalendarTable *cal_table);
 void       e_calendar_table_delete_selected (ECalendarTable *cal_table);
 
Index: calendar/gui/e-tasks.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-tasks.c,v
retrieving revision 1.67
diff -u -r1.67 e-tasks.c
--- calendar/gui/e-tasks.c	22 Dec 2003 15:57:23 -0000	1.67
+++ calendar/gui/e-tasks.c	6 Jan 2004 05:22:16 -0000
@@ -804,6 +804,15 @@
 }
 
 void
+e_tasks_open_task			(ETasks		*tasks)
+{
+	ECalendarTable *cal_table;
+                                                                                
+	cal_table = e_tasks_get_calendar_table (tasks);
+	e_calendar_table_open_selected (cal_table);
+}
+
+void
 e_tasks_new_task			(ETasks		*tasks)
 {
 	ETasksPrivate *priv;
Index: calendar/gui/e-tasks.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-tasks.h,v
retrieving revision 1.21
diff -u -r1.21 e-tasks.h
--- calendar/gui/e-tasks.h	17 Nov 2003 01:20:38 -0000	1.21
+++ calendar/gui/e-tasks.h	6 Jan 2004 05:22:16 -0000
@@ -69,6 +69,7 @@
 gboolean e_tasks_set_default_uri (ETasks *tasks, const char *str_uri);
 ECal *e_tasks_get_default_client    (ETasks *tasks);
 
+void       e_tasks_open_task         (ETasks		*tasks);
 void       e_tasks_new_task          (ETasks            *tasks);
 void       e_tasks_complete_selected (ETasks            *tasks);
 void       e_tasks_delete_selected   (ETasks            *tasks);
Index: calendar/gui/tasks-control.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/tasks-control.c,v
retrieving revision 1.71
diff -u -r1.71 tasks-control.c
--- calendar/gui/tasks-control.c	19 Dec 2003 19:50:50 -0000	1.71
+++ calendar/gui/tasks-control.c	6 Jan 2004 05:22:18 -0000
@@ -71,6 +71,9 @@
 static void tasks_control_activate_cb		(BonoboControl		*control,
 						 gboolean		 activate,
 						 gpointer		 user_data);
+static void tasks_control_open_task_cmd		(BonoboUIComponent	*uic,
+						 gpointer		 data,
+						 const char		*path);
 static void tasks_control_new_task_cmd		(BonoboUIComponent	*uic,
 						 gpointer		 data,
 						 const char		*path);
@@ -246,6 +249,9 @@
 	model = e_calendar_table_get_model (e_tasks_get_calendar_table (tasks));
 	e_cal_is_read_only (e_cal_model_get_default_client (model), &read_only, NULL);
 
+	bonobo_ui_component_set_prop (uic, "/commands/TasksOpenTask", "sensitive",
+				      n_selected != 1 ? "0" : "1",
+				      NULL);
 	bonobo_ui_component_set_prop (uic, "/commands/TasksCut", "sensitive",
 				      n_selected == 0 || read_only ? "0" : "1",
 				      NULL);
@@ -278,6 +284,7 @@
 }
 
 static BonoboUIVerb verbs [] = {
+	BONOBO_UI_VERB ("TasksOpenTask", tasks_control_open_task_cmd),
 	BONOBO_UI_VERB ("TasksNewTask", tasks_control_new_task_cmd),
 	BONOBO_UI_VERB ("TasksCut", tasks_control_cut_cmd),
 	BONOBO_UI_VERB ("TasksCopy", tasks_control_copy_cmd),
@@ -359,6 +366,15 @@
  	bonobo_ui_component_unset_container (uic, NULL);
 }
 
+static void tasks_control_open_task_cmd		(BonoboUIComponent	*uic,
+						 gpointer		 data,
+						 const char		*path)
+{
+	ETasks *tasks;
+
+	tasks = E_TASKS (data);
+	e_tasks_open_task (tasks);
+}
 
 static void
 tasks_control_new_task_cmd		(BonoboUIComponent	*uic,
Index: ui/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/ui/ChangeLog,v
retrieving revision 1.369
diff -u -r1.369 ChangeLog
--- ui/ChangeLog	29 Dec 2003 09:59:08 -0000	1.369
+++ ui/ChangeLog	6 Jan 2004 05:22:35 -0000
@@ -1,3 +1,8 @@
+2003-12-31  Kidd Wang  <kidd wang sun com>
+
+	* evolution-tasks.xml: Add a menu item [Open Task] to [File] for
+	the tasks component.
+
 2003-12-23  Kidd Wang  <kidd wang sun com>
 
 	* evolution-calendar.xml: Add a menu item [Open Appointment] to [File].
Index: ui/evolution-tasks.xml
===================================================================
RCS file: /cvs/gnome/evolution/ui/evolution-tasks.xml,v
retrieving revision 1.32
diff -u -r1.32 evolution-tasks.xml
--- ui/evolution-tasks.xml	17 Jul 2003 10:43:21 -0000	1.32
+++ ui/evolution-tasks.xml	6 Jan 2004 05:22:35 -0000
@@ -1,5 +1,6 @@
 <Root>
   <commands>
+    <cmd name="TasksOpenTask" _tip="View the selected task" accel="*Control*o"/>
     <cmd name="TasksPrint" _tip="Print the list of tasks" pixtype="stock" pixname="gtk-print"
 	 accel="*Control*p"/>
     <cmd name="TasksPrintPreview" _tip="Previews the list of tasks to be printed" pixtype="stock" pixname="gtk-print-preview"/>
@@ -16,6 +17,9 @@
   
   <menu>
     <submenu name="File">
+      <placeholder name="FileOps">
+        <menuitem name="OpenTask" verb="TasksOpenTask" _label="_Open Task"/>
+      </placeholder>
       <placeholder name="Print">
 	<menuitem name="PrintPreview" verb="TasksPrintPreview" _label="Print Pre_view"/>
 


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