aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-06-18 05:14:27 +0800
committerChristian Persch <chpe@src.gnome.org>2003-06-18 05:14:27 +0800
commit593e026cf2d2f1e5671f7ecb58330f4c5ab1ba99 (patch)
tree2bfa522159419049dd941747b87f4d8f64663f51 /src
parent38d792d73126d14cb461560f9efc2d957a089ec9 (diff)
downloadgsoc2013-epiphany-593e026cf2d2f1e5671f7ecb58330f4c5ab1ba99.tar
gsoc2013-epiphany-593e026cf2d2f1e5671f7ecb58330f4c5ab1ba99.tar.gz
gsoc2013-epiphany-593e026cf2d2f1e5671f7ecb58330f4c5ab1ba99.tar.bz2
gsoc2013-epiphany-593e026cf2d2f1e5671f7ecb58330f4c5ab1ba99.tar.lz
gsoc2013-epiphany-593e026cf2d2f1e5671f7ecb58330f4c5ab1ba99.tar.xz
gsoc2013-epiphany-593e026cf2d2f1e5671f7ecb58330f4c5ab1ba99.tar.zst
gsoc2013-epiphany-593e026cf2d2f1e5671f7ecb58330f4c5ab1ba99.zip
Fix wrong cast of GtkDialog to GtkWindow.
2003-06-17 Christian Persch <chpe@cvs.gnome.org> * 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.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/pdm-dialog.c45
-rw-r--r--src/prefs-dialog.c2
2 files changed, 43 insertions, 4 deletions
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 },
@@ -154,6 +159,32 @@ pdm_dialog_class_init (PdmDialogClass *klass)
}
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 *