[evolution-patches] Patch for bug #12389



This patch adds a Help button to the Event/Task editor dialogs, and
opens the appropriate help section for the editor in which it was
clicked.

-- dobey

? calendar/gui/apps_evolution_calendar-2.0.schemas
Index: calendar/gui/dialogs/comp-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor.c,v
retrieving revision 1.118
diff -u -p -r1.118 comp-editor.c
--- calendar/gui/dialogs/comp-editor.c	1 Feb 2005 17:30:49 -0000	1.118
+++ calendar/gui/dialogs/comp-editor.c	3 Feb 2005 18:50:15 -0000
@@ -106,6 +106,7 @@ static void comp_editor_finalize (GObjec
 static void real_set_e_cal (CompEditor *editor, ECal *client);
 static void real_edit_comp (CompEditor *editor, ECalComponent *comp);
 static gboolean real_send_comp (CompEditor *editor, ECalComponentItipMethod method);
+static void real_show_help (CompEditor *editor);
 static gboolean prompt_to_save_changes (CompEditor *editor, gboolean send);
 static void delete_comp (CompEditor *editor);
 static void close_dialog (CompEditor *editor);
@@ -133,6 +134,7 @@ comp_editor_class_init (CompEditorClass 
 	klass->set_e_cal = real_set_e_cal;
 	klass->edit_comp = real_edit_comp;
 	klass->send_comp = real_send_comp;
+	klass->show_help = real_show_help;
 
 	widget_class->key_press_event = comp_editor_key_press_event;
 	object_class->finalize = comp_editor_finalize;
@@ -370,9 +372,11 @@ response_cb (GtkWidget *widget, int resp
 {
 	CompEditor *editor = COMP_EDITOR (data);
 	CompEditorPrivate *priv;
+	CompEditorClass *klass;
 	ECalComponentText text;
 	
 	priv = editor->priv;
+	klass = COMP_EDITOR_CLASS (G_OBJECT_GET_CLASS (editor));
 
 	switch (response) {
 	case GTK_RESPONSE_OK:
@@ -394,6 +398,11 @@ response_cb (GtkWidget *widget, int resp
 		}
 
 		break;
+	case GTK_RESPONSE_HELP:
+		if (klass->show_help)
+			klass->show_help (editor);
+
+		break;
 	case GTK_RESPONSE_CANCEL:
 		commit_all_fields (editor);
 		
@@ -518,6 +527,7 @@ setup_widgets (CompEditor *editor)
 	/* Buttons */
 	gtk_dialog_add_button  (GTK_DIALOG (editor), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
 	gtk_dialog_add_button  (GTK_DIALOG (editor), GTK_STOCK_OK, GTK_RESPONSE_OK);
+	gtk_dialog_add_button  (GTK_DIALOG (editor), GTK_STOCK_HELP, GTK_RESPONSE_HELP);
 	gtk_dialog_set_response_sensitive (GTK_DIALOG (editor), GTK_RESPONSE_OK, FALSE);
 
 	g_signal_connect (editor, "response", G_CALLBACK (response_cb), editor);
@@ -1365,6 +1375,20 @@ real_send_comp (CompEditor *editor, ECal
 	
 	return FALSE;	
 
+}
+
+static void
+real_show_help (CompEditor *editor)
+{
+	GError *error = NULL;
+
+	gnome_help_display_desktop (NULL,
+				    "evolution-" BASE_VERSION,
+				    "evolution-" BASE_VERSION ".xml",
+				    "usage-calendar",
+				    &error);
+	if (error != NULL)
+		g_warning ("%s", error->message);
 }
 
 
Index: calendar/gui/dialogs/comp-editor.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor.h,v
retrieving revision 1.24
diff -u -p -r1.24 comp-editor.h
--- calendar/gui/dialogs/comp-editor.h	8 Jan 2005 10:53:52 -0000	1.24
+++ calendar/gui/dialogs/comp-editor.h	3 Feb 2005 18:50:15 -0000
@@ -54,6 +54,7 @@ typedef struct {
 	void (* set_e_cal) (CompEditor *page, ECal *client);
 	void (* edit_comp) (CompEditor *page, ECalComponent *comp);
 	gboolean (* send_comp) (CompEditor *page, ECalComponentItipMethod method);
+        void (* show_help) (CompEditor *page);
 } CompEditorClass;
 
 GtkType       comp_editor_get_type         (void);
Index: calendar/gui/dialogs/event-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/event-editor.c,v
retrieving revision 1.55
diff -u -p -r1.55 event-editor.c
--- calendar/gui/dialogs/event-editor.c	8 Jan 2005 10:53:52 -0000	1.55
+++ calendar/gui/dialogs/event-editor.c	3 Feb 2005 18:50:15 -0000
@@ -57,6 +57,7 @@ struct _EventEditorPrivate {
 static void event_editor_set_e_cal (CompEditor *editor, ECal *client);
 static void event_editor_edit_comp (CompEditor *editor, ECalComponent *comp);
 static gboolean event_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method);
+static void event_editor_show_help (CompEditor *editor);
 static void event_editor_finalize (GObject *object);
 
 static void schedule_meeting_cmd (GtkWidget *widget, gpointer data);
@@ -83,7 +84,8 @@ event_editor_class_init (EventEditorClas
 	editor_class->set_e_cal = event_editor_set_e_cal;
 	editor_class->edit_comp = event_editor_edit_comp;
 	editor_class->send_comp = event_editor_send_comp;
-	
+	editor_class->show_help = event_editor_show_help;
+
 	gobject_class->finalize = event_editor_finalize;
 }
 
@@ -315,6 +317,20 @@ event_editor_send_comp (CompEditor *edit
 		return COMP_EDITOR_CLASS (event_editor_parent_class)->send_comp (editor, method);
 
 	return FALSE;
+}
+
+static void
+event_editor_show_help (CompEditor *editor)
+{
+	GError *error = NULL;
+
+	gnome_help_display_desktop (NULL,
+				    "evolution-" BASE_VERSION,
+				    "evolution-" BASE_VERSION ".xml",
+				    "usage-calendar-apts",
+				    &error);
+	if (error != NULL)
+		g_warning ("%s", error->message);
 }
 
 /* Destroy handler for the event editor */
Index: calendar/gui/dialogs/task-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/task-editor.c,v
retrieving revision 1.78
diff -u -p -r1.78 task-editor.c
--- calendar/gui/dialogs/task-editor.c	8 Jan 2005 10:53:52 -0000	1.78
+++ calendar/gui/dialogs/task-editor.c	3 Feb 2005 18:50:15 -0000
@@ -54,6 +54,7 @@ struct _TaskEditorPrivate {
 static void task_editor_set_e_cal (CompEditor *editor, ECal *client);
 static void task_editor_edit_comp (CompEditor *editor, ECalComponent *comp);
 static gboolean task_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method);
+static void task_editor_show_help (CompEditor *editor);
 static void task_editor_finalize (GObject *object);
 
 static void assign_task_cmd (GtkWidget *widget, gpointer data);
@@ -79,6 +80,7 @@ task_editor_class_init (TaskEditorClass 
 	editor_class->set_e_cal = task_editor_set_e_cal;
 	editor_class->edit_comp = task_editor_edit_comp;
 	editor_class->send_comp = task_editor_send_comp;
+	editor_class->show_help = task_editor_show_help;
 
 	object_class->finalize = task_editor_finalize;
 }
@@ -299,6 +301,20 @@ task_editor_send_comp (CompEditor *edito
 		return COMP_EDITOR_CLASS (task_editor_parent_class)->send_comp (editor, method);
 
 	return FALSE;
+}
+
+static void
+task_editor_show_help (CompEditor *editor)
+{
+	GError *error = NULL;
+
+	gnome_help_display_desktop (NULL,
+				    "evolution-" BASE_VERSION,
+				    "evolution-" BASE_VERSION ".xml",
+				    "usage-calendar-todo",
+				    &error);
+	if (error != NULL)
+		g_warning ("%s", error->message);
 }
 
 /* Destroy handler for the event editor */


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