aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-06-15 17:35:48 +0800
committerChristian Persch <chpe@src.gnome.org>2003-06-15 17:35:48 +0800
commit94a825c3865eacb771b64dd93ea7b0dff3c9db49 (patch)
tree87b012c17af788ad3aac39769ecc95f665e74095
parent53471bc2f89c2844c7bb81b41575ee253c1f6516 (diff)
downloadgsoc2013-epiphany-94a825c3865eacb771b64dd93ea7b0dff3c9db49.tar
gsoc2013-epiphany-94a825c3865eacb771b64dd93ea7b0dff3c9db49.tar.gz
gsoc2013-epiphany-94a825c3865eacb771b64dd93ea7b0dff3c9db49.tar.bz2
gsoc2013-epiphany-94a825c3865eacb771b64dd93ea7b0dff3c9db49.tar.lz
gsoc2013-epiphany-94a825c3865eacb771b64dd93ea7b0dff3c9db49.tar.xz
gsoc2013-epiphany-94a825c3865eacb771b64dd93ea7b0dff3c9db49.tar.zst
gsoc2013-epiphany-94a825c3865eacb771b64dd93ea7b0dff3c9db49.zip
Make prev/next navigation capability an object property, and sync on embed
2003-06-15 Christian Persch <chpe@cvs.gnome.org> * embed/find-dialog.h: * embed/find-dialog.c: (set_navigation_flags), (ephy_find_dialog_get_property), (find_dialog_class_init), (sync_embed), (find_get_info), (impl_show), (find_dialog_finalize), (find_dialog_go_next), (find_dialog_go_prev), (find_entry_changed_cb), (find_check_toggled_cb), (find_dialog_get_navigation_flags): Make prev/next navigation capability an object property, and sync on embed changes. * embed/find-dialog.c: (find_dialog_new_with_parent): * embed/ephy-embed-dialog.c: (ephy_embed_dialog_class_init), (ephy_embed_dialog_new), (ephy_embed_dialog_new_with_parent), (ephy_embed_dialog_set_embed): * embed/print-dialog.c: (print_dialog_new), (print_dialog_new_with_parent): s/EphyEmbed/embed/ for the object property name. * src/ephy-window.h: * src/ephy-window.c: (sync_find_dialog), (update_find_control), (ephy_window_switch_page_cb), (find_dialog_search_cb), (ephy_window_get_find_dialog): * src/window-commands.c: (window_cmd_edit_find_next), (window_cmd_edit_find_prev): Sync on the find dialog on nav capability and embed changes instead of explicit updating.
-rw-r--r--ChangeLog31
-rw-r--r--embed/ephy-embed-dialog.c11
-rwxr-xr-xembed/find-dialog.c195
-rw-r--r--embed/find-dialog.h27
-rwxr-xr-xembed/print-dialog.c4
-rw-r--r--src/ephy-window.c79
-rw-r--r--src/ephy-window.h1
-rw-r--r--src/window-commands.c4
8 files changed, 199 insertions, 153 deletions
diff --git a/ChangeLog b/ChangeLog
index 7758832b1..5441de90b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,36 @@
2003-06-15 Christian Persch <chpe@cvs.gnome.org>
+ * embed/find-dialog.h:
+ * embed/find-dialog.c: (set_navigation_flags),
+ (ephy_find_dialog_get_property), (find_dialog_class_init),
+ (sync_embed), (find_get_info), (impl_show), (find_dialog_finalize),
+ (find_dialog_go_next), (find_dialog_go_prev), (find_entry_changed_cb),
+ (find_check_toggled_cb), (find_dialog_get_navigation_flags):
+
+ Make prev/next navigation capability an object property, and sync
+ on embed changes.
+
+ * embed/find-dialog.c: (find_dialog_new_with_parent):
+ * embed/ephy-embed-dialog.c: (ephy_embed_dialog_class_init),
+ (ephy_embed_dialog_new), (ephy_embed_dialog_new_with_parent),
+ (ephy_embed_dialog_set_embed):
+ * embed/print-dialog.c: (print_dialog_new),
+ (print_dialog_new_with_parent):
+
+ s/EphyEmbed/embed/ for the object property name.
+
+ * src/ephy-window.h:
+ * src/ephy-window.c: (sync_find_dialog), (update_find_control),
+ (ephy_window_switch_page_cb), (find_dialog_search_cb),
+ (ephy_window_get_find_dialog):
+ * src/window-commands.c: (window_cmd_edit_find_next),
+ (window_cmd_edit_find_prev):
+
+ Sync on the find dialog on nav capability and embed changes instead of
+ explicit updating.
+
+2003-06-15 Christian Persch <chpe@cvs.gnome.org>
+
* src/window-commands.c: (window_cmd_tabs_next),
(window_cmd_tabs_previous):
diff --git a/embed/ephy-embed-dialog.c b/embed/ephy-embed-dialog.c
index 7dbdcb215..186310b13 100644
--- a/embed/ephy-embed-dialog.c
+++ b/embed/ephy-embed-dialog.c
@@ -90,9 +90,9 @@ ephy_embed_dialog_class_init (EphyEmbedDialogClass *klass)
g_object_class_install_property (object_class,
PROP_EPHY_EMBED,
- g_param_spec_object ("EphyEmbed",
- "EphyEmbed",
- "Ephy Embed",
+ g_param_spec_object ("embed",
+ "Embed",
+ "The dialog's embed",
G_TYPE_OBJECT,
G_PARAM_READWRITE));
}
@@ -170,7 +170,7 @@ EphyEmbedDialog *
ephy_embed_dialog_new (EphyEmbed *embed)
{
return EPHY_EMBED_DIALOG (g_object_new (EPHY_EMBED_DIALOG_TYPE,
- "EphyEmbed", embed,
+ "embed", embed,
NULL));
}
@@ -181,7 +181,7 @@ ephy_embed_dialog_new_with_parent (GtkWidget *parent_window,
return EPHY_EMBED_DIALOG (g_object_new
(EPHY_EMBED_DIALOG_TYPE,
"ParentWindow", parent_window,
- "EphyEmbed", embed,
+ "embed", embed,
NULL));
}
@@ -193,6 +193,7 @@ ephy_embed_dialog_set_embed (EphyEmbedDialog *dialog,
dialog->priv->embed = embed;
g_object_add_weak_pointer (G_OBJECT (dialog->priv->embed),
(gpointer *)&dialog->priv->embed);
+ g_object_notify (G_OBJECT (dialog), "embed");
}
EphyEmbed *
diff --git a/embed/find-dialog.c b/embed/find-dialog.c
index 9cb2f8138..18ef22fcc 100755
--- a/embed/find-dialog.c
+++ b/embed/find-dialog.c
@@ -21,6 +21,8 @@
#include "find-dialog.h"
#include "ephy-prefs.h"
#include "ephy-embed.h"
+#include "ephy-debug.h"
+
#include <gtk/gtk.h>
#define CONF_FIND_MATCH_CASE "/apps/epiphany/dialogs/find_match_case"
@@ -55,15 +57,8 @@ struct FindDialogPrivate
{
EmbedFindInfo *properties;
GtkWidget *window;
- gboolean can_go_prev;
- gboolean can_go_next;
gboolean constructed;
-};
-
-enum
-{
- SEARCH,
- LAST_SIGNAL
+ FindNavigationFlags nav_flags;
};
enum
@@ -88,7 +83,11 @@ EphyDialogProperty properties [] =
{ -1, NULL, NULL }
};
-static guint find_dialog_signals[LAST_SIGNAL] = { 0 };
+enum
+{
+ PROP_0,
+ PROP_NAVIGATION
+};
GType
find_dialog_get_type (void)
@@ -120,6 +119,51 @@ find_dialog_get_type (void)
}
static void
+set_navigation_flags (FindDialog *dialog, FindNavigationFlags flags)
+{
+ GtkWidget *forward_button;
+ GtkWidget *back_button;
+ gboolean can_go_prev = FALSE, can_go_next = FALSE;
+
+ if (!dialog->priv->constructed) return;
+
+ dialog->priv->nav_flags = flags;
+
+ if (flags & FIND_CAN_GO_PREV)
+ {
+ can_go_prev = TRUE;
+ }
+ if (flags & FIND_CAN_GO_NEXT)
+ {
+ can_go_next = TRUE;
+ }
+
+ back_button = ephy_dialog_get_control (EPHY_DIALOG (dialog), BACK_BUTTON);
+ gtk_widget_set_sensitive (back_button, can_go_prev);
+
+ forward_button = ephy_dialog_get_control (EPHY_DIALOG (dialog), FORWARD_BUTTON);
+ gtk_widget_set_sensitive (forward_button, can_go_next);
+
+ g_object_notify (G_OBJECT (dialog), "navigation");
+}
+
+static void
+ephy_find_dialog_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ FindDialog *dialog = FIND_DIALOG (object);
+
+ switch (prop_id)
+ {
+ case PROP_NAVIGATION:
+ g_value_set_int (value, dialog->priv->nav_flags);
+ break;
+ }
+}
+
+static void
find_dialog_class_init (FindDialogClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -129,39 +173,22 @@ find_dialog_class_init (FindDialogClass *klass)
ephy_dialog_class = EPHY_DIALOG_CLASS (klass);
object_class->finalize = find_dialog_finalize;
+ object_class->get_property = ephy_find_dialog_get_property;
ephy_dialog_class->construct = impl_construct;
ephy_dialog_class->destruct = impl_destruct;
ephy_dialog_class->show = impl_show;
- find_dialog_signals[SEARCH] =
- g_signal_new ("search",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (FindDialogClass, search),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-}
-
-static void
-find_update_nav (EphyDialog *dialog)
-{
- GtkWidget *forward_button;
- GtkWidget *back_button;
-
- g_signal_emit (G_OBJECT (dialog), find_dialog_signals[SEARCH], 0);
-
- if (!FIND_DIALOG(dialog)->priv->constructed) return;
-
- forward_button = ephy_dialog_get_control (dialog, FORWARD_BUTTON);
- gtk_widget_set_sensitive (forward_button,
- FIND_DIALOG(dialog)->priv->can_go_next);
-
- back_button = ephy_dialog_get_control (dialog, BACK_BUTTON);
- gtk_widget_set_sensitive (back_button,
- FIND_DIALOG(dialog)->priv->can_go_prev);
+ g_object_class_install_property (object_class,
+ PROP_NAVIGATION,
+ g_param_spec_int ("navigation",
+ "Navigation flags",
+ "The find dialog's navigation flags",
+ 0,
+ FIND_CAN_GO_PREV |
+ FIND_CAN_GO_NEXT,
+ 0,
+ G_PARAM_READABLE));
}
static void
@@ -177,15 +204,25 @@ ensure_constructed (FindDialog *dialog)
}
static void
+sync_embed (FindDialog *dialog, GParamSpec *pspec, gpointer data)
+{
+ LOG ("EphyEmbed changed")
+
+ set_navigation_flags (dialog, FIND_CAN_GO_PREV | FIND_CAN_GO_NEXT);
+}
+
+static void
find_dialog_init (FindDialog *dialog)
{
dialog->priv = g_new0 (FindDialogPrivate, 1);
dialog->priv->properties = NULL;
- dialog->priv->can_go_prev = TRUE;
- dialog->priv->can_go_next = TRUE;
+ dialog->priv->nav_flags = FIND_CAN_GO_PREV | FIND_CAN_GO_NEXT;
dialog->priv->constructed = FALSE;
+ g_signal_connect_object (dialog, "notify::embed",
+ G_CALLBACK (sync_embed), NULL, 0);
+
ensure_constructed (dialog);
}
@@ -224,10 +261,9 @@ find_get_info (EphyDialog *dialog)
g_value_unset (&word);
/* don't do null searches */
- if (search_string[0] == '\0')
+ if (search_string && search_string[0] == '\0')
{
- find_dialog->priv->can_go_prev = FALSE;
- find_dialog->priv->can_go_next = FALSE;
+ set_navigation_flags (find_dialog, 0);
return;
}
@@ -260,11 +296,9 @@ impl_show (EphyDialog *dialog)
FindDialog *find_dialog = FIND_DIALOG(dialog);
ensure_constructed (find_dialog);
- find_dialog->priv->can_go_prev = TRUE;
- find_dialog->priv->can_go_next = TRUE;
+ set_navigation_flags (find_dialog, FIND_CAN_GO_PREV | FIND_CAN_GO_NEXT);
find_dialog->priv->window = ephy_dialog_get_control (dialog, WINDOW_PROP);
find_get_info (dialog);
- find_update_nav (dialog);
/* Focus the text entry. This will correctly select or leave
* unselected the existing text in the entry depending on the
@@ -272,14 +306,13 @@ impl_show (EphyDialog *dialog)
*/
gtk_widget_grab_focus (ephy_dialog_get_control (dialog, WORD_PROP));
-
icon = gtk_widget_render_icon (find_dialog->priv->window,
GTK_STOCK_FIND,
GTK_ICON_SIZE_MENU,
"find_dialog");
gtk_window_set_icon (GTK_WINDOW(find_dialog->priv->window), icon);
g_object_unref (icon);
-
+
EPHY_DIALOG_CLASS (parent_class)->show (dialog);
}
@@ -293,6 +326,8 @@ find_dialog_finalize (GObject *object)
dialog = FIND_DIALOG (object);
+ g_signal_handlers_disconnect_by_func (dialog, G_CALLBACK (sync_embed), NULL);
+
g_return_if_fail (dialog->priv != NULL);
g_free (dialog->priv);
@@ -306,7 +341,7 @@ find_dialog_new (EphyEmbed *embed)
FindDialog *dialog;
dialog = FIND_DIALOG (g_object_new (FIND_DIALOG_TYPE,
- "EphyEmbed", embed,
+ "embed", embed,
NULL));
return EPHY_DIALOG(dialog);
@@ -319,25 +354,13 @@ find_dialog_new_with_parent (GtkWidget *window,
FindDialog *dialog;
dialog = FIND_DIALOG (g_object_new (FIND_DIALOG_TYPE,
- "EphyEmbed", embed,
+ "embed", embed,
"ParentWindow", window,
NULL));
return EPHY_DIALOG(dialog);
}
-gboolean
-find_dialog_can_go_next (FindDialog *dialog)
-{
- return dialog->priv->can_go_next;
-}
-
-gboolean
-find_dialog_can_go_prev (FindDialog *dialog)
-{
- return dialog->priv->can_go_prev;
-}
-
void
find_dialog_go_next (FindDialog *dialog,
gboolean interactive)
@@ -345,7 +368,8 @@ find_dialog_go_next (FindDialog *dialog,
gresult result;
EphyEmbed *embed;
- if (!find_dialog_can_go_next (dialog)) return;
+ g_return_if_fail (IS_FIND_DIALOG (dialog));
+ if ((dialog->priv->nav_flags & FIND_CAN_GO_NEXT) == 0) return;
dialog->priv->properties->backwards = FALSE;
dialog->priv->properties->interactive = interactive;
@@ -353,16 +377,16 @@ find_dialog_go_next (FindDialog *dialog,
embed = ephy_embed_dialog_get_embed (EPHY_EMBED_DIALOG(dialog));
g_return_if_fail (embed != NULL);
- result = ephy_embed_find (embed,
- dialog->priv->properties);
+ result = ephy_embed_find (embed, dialog->priv->properties);
- dialog->priv->can_go_prev = TRUE;
- if (result != G_OK)
+ if (result == G_OK)
{
- dialog->priv->can_go_next = FALSE;
+ set_navigation_flags (dialog, FIND_CAN_GO_PREV | FIND_CAN_GO_NEXT);
+ }
+ else
+ {
+ set_navigation_flags (dialog, FIND_CAN_GO_PREV);
}
-
- find_update_nav (EPHY_DIALOG(dialog));
}
void
@@ -372,7 +396,8 @@ find_dialog_go_prev (FindDialog *dialog,
gresult result;
EphyEmbed *embed;
- if (!find_dialog_can_go_prev (dialog)) return;
+ g_return_if_fail (IS_FIND_DIALOG (dialog));
+ if ((dialog->priv->nav_flags & FIND_CAN_GO_PREV) == 0) return;
dialog->priv->properties->backwards = TRUE;
dialog->priv->properties->interactive = interactive;
@@ -380,16 +405,16 @@ find_dialog_go_prev (FindDialog *dialog,
embed = ephy_embed_dialog_get_embed (EPHY_EMBED_DIALOG(dialog));
g_return_if_fail (embed != NULL);
- result = ephy_embed_find (embed,
- dialog->priv->properties);
+ result = ephy_embed_find (embed, dialog->priv->properties);
- dialog->priv->can_go_next = TRUE;
- if (result != G_OK)
+ if (result == G_OK)
{
- dialog->priv->can_go_prev = FALSE;
+ set_navigation_flags (dialog, FIND_CAN_GO_PREV | FIND_CAN_GO_NEXT);
+ }
+ else
+ {
+ set_navigation_flags (dialog, FIND_CAN_GO_NEXT);
}
-
- find_update_nav (EPHY_DIALOG(dialog));
}
void
@@ -419,12 +444,9 @@ find_entry_changed_cb (GtkWidget *editable,
{
FindDialog *find_dialog = FIND_DIALOG(dialog);
- find_dialog->priv->can_go_prev = TRUE;
- find_dialog->priv->can_go_next = TRUE;
+ set_navigation_flags (find_dialog, FIND_CAN_GO_PREV | FIND_CAN_GO_NEXT);
find_get_info (dialog);
-
- find_update_nav (dialog);
}
void
@@ -433,10 +455,15 @@ find_check_toggled_cb (GtkWidget *toggle,
{
FindDialog *find_dialog = FIND_DIALOG(dialog);
- find_dialog->priv->can_go_prev = TRUE;
- find_dialog->priv->can_go_next = TRUE;
+ set_navigation_flags (find_dialog, FIND_CAN_GO_PREV | FIND_CAN_GO_NEXT);
find_get_info (dialog);
+}
+
+FindNavigationFlags
+find_dialog_get_navigation_flags (FindDialog *dialog)
+{
+ g_return_val_if_fail (IS_FIND_DIALOG (dialog), 0);
- find_update_nav (dialog);
+ return dialog->priv->nav_flags;
}
diff --git a/embed/find-dialog.h b/embed/find-dialog.h
index 325f8a7b7..c93a78303 100644
--- a/embed/find-dialog.h
+++ b/embed/find-dialog.h
@@ -37,6 +37,12 @@ typedef struct FindDialogClass FindDialogClass;
typedef struct FindDialogPrivate FindDialogPrivate;
+typedef enum
+{
+ FIND_CAN_GO_PREV = 1 << 0,
+ FIND_CAN_GO_NEXT = 1 << 1
+} FindNavigationFlags;
+
struct FindDialog
{
EphyEmbedDialog parent;
@@ -50,23 +56,20 @@ struct FindDialogClass
void (* search) (FindDialog *dialog);
};
-GType find_dialog_get_type (void);
-
-EphyDialog *find_dialog_new (EphyEmbed *embed);
-
-EphyDialog *find_dialog_new_with_parent (GtkWidget *window,
- EphyEmbed *embed);
+GType find_dialog_get_type (void);
+EphyDialog* find_dialog_new (EphyEmbed *embed);
-gboolean find_dialog_can_go_next (FindDialog *dialog);
+EphyDialog * find_dialog_new_with_parent (GtkWidget *window,
+ EphyEmbed *embed);
-gboolean find_dialog_can_go_prev (FindDialog *dialog);
+void find_dialog_go_next (FindDialog *dialog,
+ gboolean interactive);
-void find_dialog_go_next (FindDialog *dialog,
- gboolean interactive);
+void find_dialog_go_prev (FindDialog *dialog,
+ gboolean interactive);
-void find_dialog_go_prev (FindDialog *dialog,
- gboolean interactive);
+FindNavigationFlags find_dialog_get_navigation_flags (FindDialog *dialog);
G_END_DECLS
diff --git a/embed/print-dialog.c b/embed/print-dialog.c
index 2ba9ca348..baf636cd0 100755
--- a/embed/print-dialog.c
+++ b/embed/print-dialog.c
@@ -212,7 +212,7 @@ print_dialog_new (EphyEmbed *embed,
PrintDialog *dialog;
dialog = PRINT_DIALOG (g_object_new (PRINT_DIALOG_TYPE,
- "EphyEmbed", embed,
+ "embed", embed,
NULL));
if (!embed) dialog->only_collect_info = TRUE;
@@ -229,7 +229,7 @@ print_dialog_new_with_parent (GtkWidget *window,
PrintDialog *dialog;
dialog = PRINT_DIALOG (g_object_new (PRINT_DIALOG_TYPE,
- "EphyEmbed", embed,
+ "embed", embed,
"ParentWindow", window,
NULL));
diff --git a/src/ephy-window.c b/src/ephy-window.c
index aea9399f0..aec447159 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -514,6 +514,32 @@ setup_window (EphyWindow *window)
}
static void
+sync_find_dialog (FindDialog *dialog, GParamSpec *spec, EphyWindow *window)
+{
+ EggActionGroup *action_group;
+ EggAction *action;
+ FindNavigationFlags flags;
+ gboolean can_go_prev = FALSE, can_go_next = FALSE;
+
+ flags = find_dialog_get_navigation_flags (dialog);
+
+ if (flags & FIND_CAN_GO_PREV)
+ {
+ can_go_prev = TRUE;
+ }
+ if (flags & FIND_CAN_GO_NEXT)
+ {
+ can_go_next = TRUE;
+ }
+
+ action_group = window->priv->action_group;
+ action = egg_action_group_get_action (action_group, "EditFindPrev");
+ g_object_set (action, "sensitive", can_go_prev, NULL);
+ action = egg_action_group_get_action (action_group, "EditFindNext");
+ g_object_set (action, "sensitive", can_go_next, NULL);
+}
+
+static void
sync_tab_address (EphyTab *tab, GParamSpec *pspec, EphyWindow *window)
{
const char *address;
@@ -756,8 +782,6 @@ sync_tab_visibility (EphyTab *tab, GParamSpec *pspec, EphyWindow *window)
if (window->priv->closing) return;
- LOG ("sync tab visibility window %p tab %p", window, tab)
-
tabs = ephy_window_get_tabs (window);
for (l = tabs; l != NULL; l = l->next)
{
@@ -1139,6 +1163,9 @@ ephy_window_finalize (GObject *object)
if (window->priv->find_dialog)
{
+ g_signal_handlers_disconnect_by_func (window->priv->find_dialog,
+ G_CALLBACK (sync_find_dialog),
+ window);
g_object_unref (G_OBJECT (window->priv->find_dialog));
}
@@ -1546,25 +1573,6 @@ update_favorites_control (EphyWindow *window)
ephy_favorites_menu_update (window->priv->fav_menu);
}
-static void
-update_find_control (EphyWindow *window)
-{
- gboolean can_go_next, can_go_prev;
-
- if (window->priv->find_dialog)
- {
- can_go_next = find_dialog_can_go_next
- (FIND_DIALOG(window->priv->find_dialog));
- can_go_prev = find_dialog_can_go_prev
- (FIND_DIALOG(window->priv->find_dialog));
-/*
- ephy_bonobo_set_sensitive (BONOBO_UI_COMPONENT(window->ui_component),
- EDIT_FIND_NEXT_CMD_PATH, can_go_next);
- ephy_bonobo_set_sensitive (BONOBO_UI_COMPONENT(window->ui_component),
- EDIT_FIND_PREV_CMD_PATH, can_go_prev);*/
- }
-}
-
void
ephy_window_update_control (EphyWindow *window,
ControlID control)
@@ -1573,9 +1581,6 @@ ephy_window_update_control (EphyWindow *window,
switch (control)
{
- case FindControl:
- update_find_control (window);
- break;
case FavoritesControl:
update_favorites_control (window);
break;
@@ -1585,17 +1590,6 @@ ephy_window_update_control (EphyWindow *window,
}
}
-void
-ephy_window_update_all_controls (EphyWindow *window)
-{
- g_return_if_fail (IS_EPHY_WINDOW (window));
-
- if (ephy_window_get_active_tab (window) != NULL)
- {
- update_find_control (window);
- }
-}
-
EphyTab *
ephy_window_get_active_tab (EphyWindow *window)
{
@@ -1698,16 +1692,9 @@ ephy_window_notebook_switch_page_cb (GtkNotebook *notebook,
update_embed_dialogs (window, tab);
/* update window controls */
- ephy_window_update_all_controls (window);
update_tabs_menu_sensitivity (window);
}
-static void
-find_dialog_search_cb (FindDialog *dialog, EphyWindow *window)
-{
- ephy_window_update_control (window, FindControl);
-}
-
EphyDialog *
ephy_window_get_find_dialog (EphyWindow *window)
{
@@ -1724,9 +1711,11 @@ ephy_window_get_find_dialog (EphyWindow *window)
dialog = find_dialog_new_with_parent (GTK_WIDGET(window),
embed);
- g_signal_connect (dialog, "search",
- G_CALLBACK (find_dialog_search_cb),
- window);
+ sync_find_dialog (FIND_DIALOG (dialog), NULL, window);
+ g_signal_connect_object (dialog, "notify::embed",
+ G_CALLBACK (sync_find_dialog), window, 0);
+ g_signal_connect_object (dialog, "notify::navigation",
+ G_CALLBACK (sync_find_dialog), window, 0);
window->priv->find_dialog = dialog;
diff --git a/src/ephy-window.h b/src/ephy-window.h
index d1915b201..378dc76d2 100644
--- a/src/ephy-window.h
+++ b/src/ephy-window.h
@@ -62,7 +62,6 @@ typedef enum
typedef enum
{
- FindControl,
FavoritesControl
} ControlID;
diff --git a/src/window-commands.c b/src/window-commands.c
index 54bf1d55b..94e53474f 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -497,8 +497,6 @@ window_cmd_edit_find_next (EggAction *action,
dialog = ephy_window_get_find_dialog (window);
find_dialog_go_next (FIND_DIALOG(dialog), FALSE);
-
- ephy_window_update_control (window, FindControl);
}
void
@@ -510,8 +508,6 @@ window_cmd_edit_find_prev (EggAction *action,
dialog = ephy_window_get_find_dialog (window);
find_dialog_go_prev (FIND_DIALOG(dialog), FALSE);
-
- ephy_window_update_control (window, FindControl);
}
void