From 593e026cf2d2f1e5671f7ecb58330f4c5ab1ba99 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Tue, 17 Jun 2003 21:14:27 +0000 Subject: Fix wrong cast of GtkDialog to GtkWindow. 2003-06-17 Christian Persch * src/prefs-dialog.c: Fix wrong cast of GtkDialog to GtkWindow. * data/glade/epiphany.glade: * src/pdm-dialog.c: (pdm_dialog_show_help), (pdm_dialog_response_cb): Implement help button for pdm dialogue. --- ChangeLog | 11 +++++++++++ data/glade/epiphany.glade | 16 ++++++++++++++-- src/pdm-dialog.c | 45 ++++++++++++++++++++++++++++++++++++++++++--- src/prefs-dialog.c | 2 +- 4 files changed, 68 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1e3a48656..a71147146 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2003-06-17 Christian Persch + + * src/prefs-dialog.c: + + Fix wrong cast of GtkDialog to GtkWindow. + + * data/glade/epiphany.glade: + * src/pdm-dialog.c: (pdm_dialog_show_help), (pdm_dialog_response_cb): + + Implement help button for pdm dialogue. + 2003-06-17 Christian Persch * embed/find-dialog.c: (sync_page_change), (unset_old_embed), diff --git a/data/glade/epiphany.glade b/data/glade/epiphany.glade index 135c6540d..4ec1fb0f7 100644 --- a/data/glade/epiphany.glade +++ b/data/glade/epiphany.glade @@ -726,6 +726,7 @@ True False False + @@ -738,6 +739,18 @@ True GTK_BUTTONBOX_END + + + True + True + True + gtk-help + True + GTK_RELIEF_NORMAL + -11 + + + True @@ -747,7 +760,6 @@ True GTK_RELIEF_NORMAL -7 - @@ -760,7 +772,7 @@ - + 5 True True diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c index c7119b065..f6370f419 100755 --- a/src/pdm-dialog.c +++ b/src/pdm-dialog.c @@ -79,6 +79,8 @@ struct PdmDialogPrivate enum { + PROP_WINDOW, + PROP_NOTEBOOK, PROP_COOKIES_TREEVIEW, PROP_COOKIES_REMOVE, PROP_PASSWORDS_TREEVIEW, @@ -104,6 +106,9 @@ enum static const EphyDialogProperty properties [] = { + { PROP_WINDOW, "pdm_dialog", NULL, PT_NORMAL, NULL }, + { PROP_NOTEBOOK, "pdm_notebook", NULL, PT_NORMAL, NULL }, + { PROP_COOKIES_TREEVIEW, "cookies_treeview", NULL, PT_NORMAL, NULL }, { PROP_COOKIES_REMOVE, "cookies_remove_button", NULL, PT_NORMAL, NULL }, { PROP_PASSWORDS_TREEVIEW, "passwords_treeview", NULL, PT_NORMAL, NULL }, @@ -153,6 +158,32 @@ pdm_dialog_class_init (PdmDialogClass *klass) object_class->finalize = pdm_dialog_finalize; } +static void +pdm_dialog_show_help (PdmDialog *pd) +{ + GtkWidget *notebook, *window; + gint id; + + /* FIXME: Once we actually have documentation we + * should point these at the correct links. + */ + gchar *help_preferences[] = { + "pdm", + "pdm" + }; + + window = ephy_dialog_get_control (EPHY_DIALOG (pd), PROP_WINDOW); + g_return_if_fail (GTK_IS_WINDOW (window)); + + notebook = ephy_dialog_get_control (EPHY_DIALOG (pd), PROP_NOTEBOOK); + g_return_if_fail (notebook != NULL); + + id = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook)); + g_assert (id == 0 || id == 1); + + ephy_gui_help (GTK_WINDOW (window), "epiphany", help_preferences[id]); +} + static void cookies_treeview_selection_changed_cb (GtkTreeSelection *selection, PdmDialog *dialog) @@ -708,8 +739,16 @@ pdm_dialog_cookies_properties_button_clicked_cb (GtkWidget *button, } void -pdm_dialog_close_button_clicked_cb (GtkWidget *button, - PdmDialog *dialog) +pdm_dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer data) { - g_object_unref (dialog); + if (response_id == GTK_RESPONSE_CLOSE) + { + gtk_widget_destroy (GTK_WIDGET(dialog)); + } + else if (response_id == GTK_RESPONSE_HELP) + { + g_return_if_fail (IS_PDM_DIALOG (data)); + + pdm_dialog_show_help (PDM_DIALOG (data)); + } } diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c index 48a5dc5cd..7b982e96f 100644 --- a/src/prefs-dialog.c +++ b/src/prefs-dialog.c @@ -414,7 +414,7 @@ prefs_dialog_show_help (PrefsDialog *pd) id = gtk_notebook_get_current_page (GTK_NOTEBOOK (pd->priv->notebook)); - ephy_gui_help (GTK_WINDOW (pd), "epiphany", help_preferences[id]); + ephy_gui_help (GTK_WINDOW (pd->priv->window), "epiphany", help_preferences[id]); } static const gchar * -- cgit v1.2.3