aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-06-18 04:41:21 +0800
committerChristian Persch <chpe@src.gnome.org>2003-06-18 04:41:21 +0800
commitc33c109a185dcb6b363c72189ba1201b2f593cfd (patch)
tree495ca40db3e55ba7013f062f6221c8a67d32d908
parentce7e82d0829dae563296242acdcc52c2345e8597 (diff)
downloadgsoc2013-epiphany-c33c109a185dcb6b363c72189ba1201b2f593cfd.tar
gsoc2013-epiphany-c33c109a185dcb6b363c72189ba1201b2f593cfd.tar.gz
gsoc2013-epiphany-c33c109a185dcb6b363c72189ba1201b2f593cfd.tar.bz2
gsoc2013-epiphany-c33c109a185dcb6b363c72189ba1201b2f593cfd.tar.lz
gsoc2013-epiphany-c33c109a185dcb6b363c72189ba1201b2f593cfd.tar.xz
gsoc2013-epiphany-c33c109a185dcb6b363c72189ba1201b2f593cfd.tar.zst
gsoc2013-epiphany-c33c109a185dcb6b363c72189ba1201b2f593cfd.zip
Re-enable the next/prev buttons on page change.
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): Re-enable the next/prev buttons on page change.
-rw-r--r--ChangeLog7
-rwxr-xr-xembed/find-dialog.c54
2 files changed, 59 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 40d364216..0ff73ad00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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):
+
+ Re-enable the next/prev buttons on page change.
+
2003-06-17 Xan Lopez <xan@masilla.org>
* embed/find-dialog.c: (find_get_info):
diff --git a/embed/find-dialog.c b/embed/find-dialog.c
index 6f41a70ee..5e6c844a8 100755
--- a/embed/find-dialog.c
+++ b/embed/find-dialog.c
@@ -60,6 +60,7 @@ struct FindDialogPrivate
GtkWidget *window;
gboolean constructed;
FindNavigationFlags nav_flags;
+ EphyEmbed *old_embed;
};
enum
@@ -205,9 +206,11 @@ ensure_constructed (FindDialog *dialog)
}
static void
-sync_embed (FindDialog *dialog, GParamSpec *pspec, gpointer data)
+sync_page_change (EphyEmbed *embed, FindDialog *dialog)
{
- LOG ("EphyEmbed changed")
+ g_return_if_fail (IS_EPHY_EMBED (embed));
+
+ if (dialog->priv->constructed == FALSE) return;
set_navigation_flags (dialog, FIND_CAN_GO_PREV | FIND_CAN_GO_NEXT);
@@ -215,6 +218,50 @@ sync_embed (FindDialog *dialog, GParamSpec *pspec, gpointer data)
}
static void
+unset_old_embed (FindDialog *dialog)
+{
+ if (dialog->priv->old_embed != NULL)
+ {
+ g_signal_handlers_disconnect_by_func (dialog->priv->old_embed,
+ G_CALLBACK (sync_page_change),
+ dialog);
+ g_object_remove_weak_pointer (G_OBJECT (dialog->priv->old_embed),
+ (gpointer *)&dialog->priv->old_embed);
+
+ dialog->priv->old_embed = NULL;
+ }
+}
+
+static void
+sync_embed (FindDialog *dialog, GParamSpec *pspec, gpointer data)
+{
+ EphyEmbed *embed;
+
+ unset_old_embed (dialog);
+
+ embed = ephy_embed_dialog_get_embed (EPHY_EMBED_DIALOG (dialog));
+ g_return_if_fail (IS_EPHY_EMBED (embed));
+ dialog->priv->old_embed = embed;
+
+ g_signal_connect (G_OBJECT (embed), "ge_location",
+ G_CALLBACK (sync_page_change), dialog);
+
+ g_object_add_weak_pointer (G_OBJECT (embed),
+ (gpointer *)&dialog->priv->old_embed);
+
+ if (dialog->priv->constructed)
+ {
+ set_navigation_flags (dialog, FIND_CAN_GO_PREV | FIND_CAN_GO_NEXT);
+
+ find_get_info (EPHY_DIALOG (dialog));
+ }
+ else
+ {
+ set_navigation_flags (dialog, 0);
+ }
+}
+
+static void
find_dialog_init (FindDialog *dialog)
{
dialog->priv = g_new0 (FindDialogPrivate, 1);
@@ -222,6 +269,7 @@ find_dialog_init (FindDialog *dialog)
dialog->priv->properties = NULL;
dialog->priv->nav_flags = 0;
dialog->priv->constructed = FALSE;
+ dialog->priv->old_embed = NULL;
g_signal_connect_object (dialog, "notify::embed",
G_CALLBACK (sync_embed), NULL, 0);
@@ -335,6 +383,8 @@ find_dialog_finalize (GObject *object)
g_return_if_fail (dialog->priv != NULL);
+ unset_old_embed (dialog);
+
g_free (dialog->priv);
G_OBJECT_CLASS (parent_class)->finalize (object);