aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodney Dawes <dobey@novell.com>2005-02-04 23:49:15 +0800
committerRodney Dawes <dobey@src.gnome.org>2005-02-04 23:49:15 +0800
commitafbb1fd44d098899205335e45267979c8681ed4a (patch)
treeb34830cc8f02b4cd66961edf90dad5474368581f
parentcd399f7a4065d4a5091d63a35564d1a3807caa11 (diff)
downloadgsoc2013-evolution-afbb1fd44d098899205335e45267979c8681ed4a.tar.gz
gsoc2013-evolution-afbb1fd44d098899205335e45267979c8681ed4a.tar.zst
gsoc2013-evolution-afbb1fd44d098899205335e45267979c8681ed4a.zip
Add a string to CompEditorPrivate to store the name of the help section we
2005-02-04 Rodney Dawes <dobey@novell.com> * gui/dialogs/comp-editor.[ch]: Add a string to CompEditorPrivate to store the name of the help section we need to refer for derived dialogs (response_cb): Handle the GTK_RESPONSE_HELP response and show help (setup_widgets): Add a button to the dialog for Help (comp_editor_init): Default to the "usage-calendar" help section (comp_editor_finalize): Free the help_section variable (comp_editor_show_help): Add a new method to actually open the help (comp_editor_set_help_section): Add a method for derivatives to set the help section they want to open * gui/dialogs/event-editor.c (event_editor_init): Set the help section we want to open for the event editor to "usage-calendar-apts" * gui/dialogs/task-editor.c (task_editor_init): Set the help section we want to open for the event editor to "usage-calendar-todo" svn path=/trunk/; revision=28710
-rw-r--r--calendar/ChangeLog18
-rw-r--r--calendar/gui/dialogs/comp-editor.c39
-rw-r--r--calendar/gui/dialogs/comp-editor.h2
-rw-r--r--calendar/gui/dialogs/event-editor.c2
-rw-r--r--calendar/gui/dialogs/task-editor.c1
5 files changed, 62 insertions, 0 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 44f4e3fb08..d6a005e932 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,21 @@
+2005-02-04 Rodney Dawes <dobey@novell.com>
+
+ * gui/dialogs/comp-editor.[ch]: Add a string to CompEditorPrivate to
+ store the name of the help section we need to refer for derived dialogs
+ (response_cb): Handle the GTK_RESPONSE_HELP response and show help
+ (setup_widgets): Add a button to the dialog for Help
+ (comp_editor_init): Default to the "usage-calendar" help section
+ (comp_editor_finalize): Free the help_section variable
+ (comp_editor_show_help): Add a new method to actually open the help
+ (comp_editor_set_help_section): Add a method for derivatives to set the
+ help section they want to open
+
+ * gui/dialogs/event-editor.c (event_editor_init): Set the help section
+ we want to open for the event editor to "usage-calendar-apts"
+
+ * gui/dialogs/task-editor.c (task_editor_init): Set the help section
+ we want to open for the event editor to "usage-calendar-todo"
+
2005-02-04 Rodrigo Moya <rodrigo@novell.com>
* gui/e-tasks.c (update_view): clear the component preview when we
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 6a2be0a6c5..062b4b03e5 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -96,12 +96,15 @@ struct _CompEditorPrivate {
gboolean is_group_item;
gboolean warned;
+
+ char *help_section;
};
static gint comp_editor_key_press_event (GtkWidget *d, GdkEventKey *e);
static void comp_editor_finalize (GObject *object);
+static void comp_editor_show_help (CompEditor *editor);
static void real_set_e_cal (CompEditor *editor, ECal *client);
static void real_edit_comp (CompEditor *editor, ECalComponent *comp);
@@ -394,6 +397,10 @@ response_cb (GtkWidget *widget, int response, gpointer data)
}
break;
+ case GTK_RESPONSE_HELP:
+ comp_editor_show_help (editor);
+
+ break;
case GTK_RESPONSE_CANCEL:
commit_all_fields (editor);
@@ -518,6 +525,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);
@@ -596,6 +604,7 @@ comp_editor_init (CompEditor *editor)
priv->user_org = FALSE;
priv->warned = FALSE;
priv->is_group_item = FALSE;
+ priv->help_section = g_strdup ("usage-calendar");
gtk_window_set_type_hint (GTK_WINDOW (editor), GDK_WINDOW_TYPE_HINT_NORMAL);
gtk_dialog_set_has_separator (GTK_DIALOG (editor), FALSE);
@@ -634,6 +643,8 @@ comp_editor_finalize (GObject *object)
editor = COMP_EDITOR (object);
priv = editor->priv;
+ g_free (priv->help_section);
+
if (priv->client) {
g_object_unref (priv->client);
priv->client = NULL;
@@ -672,6 +683,23 @@ comp_editor_finalize (GObject *object)
(* G_OBJECT_CLASS (comp_editor_parent_class)->finalize) (object);
}
+static void
+comp_editor_show_help (CompEditor *editor)
+{
+ GError *error = NULL;
+ CompEditorPrivate *priv;
+
+ priv = editor->priv;
+
+ gnome_help_display_desktop (NULL,
+ "evolution-" BASE_VERSION,
+ "evolution-" BASE_VERSION ".xml",
+ priv->help_section,
+ &error);
+ if (error != NULL)
+ g_warning ("%s", error->message);
+}
+
static void
delete_comp (CompEditor *editor)
@@ -1064,6 +1092,17 @@ comp_editor_get_e_cal (CompEditor *editor)
return priv->client;
}
+void
+comp_editor_set_help_section (CompEditor *editor, const char *section)
+{
+ CompEditorPrivate *priv;
+
+ priv = editor->priv;
+
+ g_free (priv->help_section);
+ priv->help_section = g_strdup (section);
+}
+
/* Creates an appropriate title for the event editor dialog */
static char *
make_title_from_comp (ECalComponent *comp, gboolean is_group_item)
diff --git a/calendar/gui/dialogs/comp-editor.h b/calendar/gui/dialogs/comp-editor.h
index ea6811e5a3..7203b3e722 100644
--- a/calendar/gui/dialogs/comp-editor.h
+++ b/calendar/gui/dialogs/comp-editor.h
@@ -81,6 +81,8 @@ void comp_editor_show_page (CompEditor *editor,
CompEditorPage *page);
void comp_editor_set_e_cal (CompEditor *editor,
ECal *client);
+void comp_editor_set_help_section (CompEditor *editor,
+ const char *section);
ECal *comp_editor_get_e_cal (CompEditor *editor);
void comp_editor_edit_comp (CompEditor *ee,
ECalComponent *comp);
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c
index 1f266325bf..8b4c74da0f 100644
--- a/calendar/gui/dialogs/event-editor.c
+++ b/calendar/gui/dialogs/event-editor.c
@@ -121,6 +121,8 @@ event_editor_init (EventEditor *ee)
priv->meeting_shown = TRUE;
priv->updating = FALSE;
priv->is_meeting = FALSE;
+
+ comp_editor_set_help_section (COMP_EDITOR (ee), "usage-calendar-apts");
}
EventEditor *
diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c
index a513bc25cf..f7d56b3671 100644
--- a/calendar/gui/dialogs/task-editor.c
+++ b/calendar/gui/dialogs/task-editor.c
@@ -118,6 +118,7 @@ task_editor_init (TaskEditor *te)
priv->updating = FALSE;
priv->is_assigned = FALSE;
+ comp_editor_set_help_section (COMP_EDITOR (te), "usage-calendar-todo");
}
TaskEditor *