GTK changes for core search update (r12646).

svn path=/trunk/netsurf/; revision=12647
This commit is contained in:
Michael Drake 2011-08-24 12:31:27 +00:00
parent 63c07ee28d
commit 48917cbb82
3 changed files with 26 additions and 20 deletions

View File

@ -1297,8 +1297,8 @@ MULTIHANDLER(reload)
return TRUE;
/* clear potential search effects */
if (bw->search_context != NULL)
search_destroy_context(bw->search_context);
browser_window_search_destroy_context(bw);
nsgtk_search_set_forward_state(true, bw);
nsgtk_search_set_back_state(true, bw);
@ -1316,8 +1316,8 @@ MULTIHANDLER(back)
return TRUE;
/* clear potential search effects */
if (bw->search_context != NULL)
search_destroy_context(bw->search_context);
browser_window_search_destroy_context(bw);
nsgtk_search_set_forward_state(true, bw);
nsgtk_search_set_back_state(true, bw);
@ -1336,8 +1336,8 @@ MULTIHANDLER(forward)
return TRUE;
/* clear potential search effects */
if (bw->search_context != NULL)
search_destroy_context(bw->search_context);
browser_window_search_destroy_context(bw);
nsgtk_search_set_forward_state(true, bw);
nsgtk_search_set_back_state(true, bw);
@ -2223,8 +2223,8 @@ void nsgtk_scaffolding_toggle_search_bar_visibility(nsgtk_scaffolding *g)
gui_window_get_browser_window(g->top_level);
g_object_get(G_OBJECT(g->search->bar), "visible", &vis, NULL);
if (vis) {
if ((bw != NULL) && (bw->search_context != NULL))
search_destroy_context(bw->search_context);
if (bw != NULL)
browser_window_search_destroy_context(bw);
nsgtk_search_set_forward_state(true, bw);
nsgtk_search_set_back_state(true, bw);
gtk_widget_hide(GTK_WIDGET(g->search->bar));
@ -2251,8 +2251,7 @@ void nsgtk_scaffolding_set_top_level (struct gui_window *gw)
nsgtk_window_update_back_forward(nsgtk_get_scaffold(gw));
/* clear effects of potential searches */
if (bw->search_context != NULL)
search_destroy_context(bw->search_context);
browser_window_search_destroy_context(bw);
nsgtk_search_set_forward_state(true, bw);
nsgtk_search_set_back_state(true, bw);

View File

@ -70,8 +70,9 @@ gboolean nsgtk_search_forward_button_clicked(GtkWidget *widget, gpointer data)
(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
nsgtk_scaffolding_search(g)->checkAll)) ?
SEARCH_FLAG_SHOWALL : 0);
if (search_verify_new(bw, &nsgtk_search_callbacks, (void *)bw))
search_step(bw->search_context, flags, gtk_entry_get_text(
if (browser_window_search_verify_new(bw, &nsgtk_search_callbacks,
(void *)bw))
browser_window_search_step(bw, flags, gtk_entry_get_text(
nsgtk_scaffolding_search(g)->entry));
return TRUE;
}
@ -91,8 +92,9 @@ gboolean nsgtk_search_back_button_clicked(GtkWidget *widget, gpointer data)
(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
nsgtk_scaffolding_search(g)->checkAll)) ?
SEARCH_FLAG_SHOWALL : 0);
if (search_verify_new(bw, &nsgtk_search_callbacks, (void *)bw))
search_step(bw->search_context, flags, gtk_entry_get_text(
if (browser_window_search_verify_new(bw, &nsgtk_search_callbacks,
(void *)bw))
browser_window_search_step(bw, flags, gtk_entry_get_text(
nsgtk_scaffolding_search(g)->entry));
return TRUE;
}
@ -131,8 +133,10 @@ gboolean nsgtk_search_entry_changed(GtkWidget *widget, gpointer data)
nsgtk_scaffolding *g = (nsgtk_scaffolding *)data;
struct browser_window *bw = gui_window_get_browser_window(
nsgtk_scaffolding_top_level(g));
if ((bw != NULL) && (bw->search_context != NULL))
search_destroy_context(bw->search_context);
if (bw != NULL)
browser_window_search_destroy_context(bw);
nsgtk_search_set_forward_state(true, (void *)bw);
nsgtk_search_set_back_state(true, (void *)bw);
return TRUE;
@ -153,8 +157,10 @@ gboolean nsgtk_search_entry_activate(GtkWidget *widget, gpointer data)
(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
nsgtk_scaffolding_search(g)->checkAll)) ?
SEARCH_FLAG_SHOWALL : 0);
if (search_verify_new(bw, &nsgtk_search_callbacks, (void *)bw))
search_step(bw->search_context, flags, gtk_entry_get_text(
if (browser_window_search_verify_new(bw, &nsgtk_search_callbacks,
(void *)bw))
browser_window_search_step(bw, flags, gtk_entry_get_text(
nsgtk_scaffolding_search(g)->entry));
return FALSE;
}

View File

@ -194,8 +194,9 @@ void nsgtk_tab_page_changed(GtkNotebook *notebook, gpointer *page,
struct browser_window *bw = gui_window_get_browser_window(gw);
if (bw == NULL)
return;
if (bw->search_context != NULL)
search_destroy_context(bw->search_context);
browser_window_search_destroy_context(bw);
nsgtk_search_set_forward_state(true, bw);
nsgtk_search_set_back_state(true, bw);
nsgtk_scaffolding_set_top_level(gw);