aboutsummaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--ChangeLog11
-rw-r--r--data/glade/epiphany.glade16
-rwxr-xr-xsrc/pdm-dialog.c45
-rw-r--r--src/prefs-dialog.c2
4 files changed, 68 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 1e3a48656..a71147146 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
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.
+
+2003-06-17 Christian Persch <chpe@cvs.gnome.org>
+
* embed/find-dialog.c: (sync_page_change), (unset_old_embed),
(sync_embed), (find_dialog_init), (find_dialog_finalize):
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 @@
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="has_separator">False</property>
+ <signal name="response" handler="pdm_dialog_response_cb" last_modification_time="Tue, 17 Jun 2003 22:37:44 GMT"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox27">
@@ -739,6 +740,18 @@
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
+ <widget class="GtkButton" id="help_button">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-help</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="response_id">-11</property>
+ </widget>
+ </child>
+
+ <child>
<widget class="GtkButton" id="closebutton1">
<property name="visible">True</property>
<property name="can_default">True</property>
@@ -747,7 +760,6 @@
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">-7</property>
- <signal name="clicked" handler="pdm_dialog_close_button_clicked_cb" last_modification_time="Mon, 17 Jun 2002 11:00:39 GMT"/>
</widget>
</child>
</widget>
@@ -760,7 +772,7 @@
</child>
<child>
- <widget class="GtkNotebook" id="notebook3">
+ <widget class="GtkNotebook" id="pdm_notebook">
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
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 *