aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs/comp-editor.c
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 /calendar/gui/dialogs/comp-editor.c
parentcd399f7a4065d4a5091d63a35564d1a3807caa11 (diff)
downloadgsoc2013-evolution-afbb1fd44d098899205335e45267979c8681ed4a.tar
gsoc2013-evolution-afbb1fd44d098899205335e45267979c8681ed4a.tar.gz
gsoc2013-evolution-afbb1fd44d098899205335e45267979c8681ed4a.tar.bz2
gsoc2013-evolution-afbb1fd44d098899205335e45267979c8681ed4a.tar.lz
gsoc2013-evolution-afbb1fd44d098899205335e45267979c8681ed4a.tar.xz
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
Diffstat (limited to 'calendar/gui/dialogs/comp-editor.c')
-rw-r--r--calendar/gui/dialogs/comp-editor.c39
1 files changed, 39 insertions, 0 deletions
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)