Exemple #1
0
static void
case_sensitive_toggled_cb (GtkWidget *check,
			   EphyFindToolbar *toolbar)
{
	gboolean case_sensitive;
	GtkWidget *proxy;

	case_sensitive = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check));

	proxy = gtk_tool_item_get_proxy_menu_item (GTK_TOOL_ITEM (gtk_widget_get_parent (check)),
						   "menu-proxy");

	if (proxy != NULL)
	{
		g_signal_handlers_block_by_func
			(proxy, G_CALLBACK (case_sensitive_menu_toggled_cb), toolbar);

		gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (proxy),
						case_sensitive);
		g_signal_handlers_unblock_by_func
			(proxy, G_CALLBACK (case_sensitive_menu_toggled_cb), toolbar);
	}

#ifdef HAVE_WEBKIT2
        do_search (toolbar);
#else

	ephy_find_toolbar_mark_matches (toolbar);

	/*
	 * If we now use the stricter method (and are case sensitive),
	 * check that the current selection still matches. If not, find the
	 * next one.
	 * This currently requires going back and then forward, because
	 * there's no function in WebKit that would verify the current selection.
	 */
	if (case_sensitive)
	{
		EphyFindResult result;

		result = real_find (toolbar->priv, EPHY_FIND_DIRECTION_PREV);
		if (result != EPHY_FIND_RESULT_NOTFOUND)
			result = real_find (toolbar->priv,
					    EPHY_FIND_DIRECTION_NEXT);

		set_status (toolbar, result);
	}
#endif
}
static gboolean
do_search (EphyFindToolbar *toolbar)
{
	toolbar->find_source_id = 0;

        real_find (toolbar, EPHY_FIND_DIRECTION_NEXT);

	return FALSE;
}
Exemple #3
0
static gboolean
do_search (EphyFindToolbar *toolbar)
{
	EphyFindToolbarPrivate *priv = toolbar->priv;
#ifndef HAVE_WEBKIT2
	EphyFindResult result;
#endif

	priv->find_source_id = 0;

#ifdef HAVE_WEBKIT2
        real_find (priv, EPHY_FIND_DIRECTION_NEXT);
#else
	ephy_find_toolbar_mark_matches (toolbar);

	result = real_find (priv, EPHY_FIND_DIRECTION_NEXT);
	set_status (toolbar, result);
#endif

	return FALSE;
}
Exemple #4
0
static gboolean
find_again_cb (FindAgainCBStruct *data)
{
	EphyFindResult result;
	EphyFindToolbarPrivate *priv = data->toolbar->priv;

	result = real_find (priv, data->direction);

	/* Highlight matches again if the toolbar was hidden when the user
	 * requested find-again. */
	if (result != EPHY_FIND_RESULT_NOTFOUND && data->highlight)
		ephy_find_toolbar_mark_matches (data->toolbar);

	set_status (data->toolbar, result);

	priv->find_again_source_id = 0;

	return FALSE;
}