Esempio n. 1
0
static void
on_htmlview_history_back (GtkWidget *widget, gpointer user_data)
{
	LifereaHtmlView	*htmlview = LIFEREA_HTMLVIEW (user_data);
	gchar		*url;

	url = browser_history_back (htmlview->priv->history);

	gtk_widget_set_sensitive (htmlview->priv->forward, browser_history_can_go_forward (htmlview->priv->history));
	gtk_widget_set_sensitive (htmlview->priv->back,    browser_history_can_go_back (htmlview->priv->history));

	liferea_htmlview_launch_URL_internal (htmlview, url);
	gtk_entry_set_text (GTK_ENTRY (htmlview->priv->urlentry), url);
}
Esempio n. 2
0
void
liferea_htmlview_launch_URL_internal (LifereaHtmlView *htmlview, const gchar *url)
{
	/* before loading untrusted URLs suppress internal link schema */
	htmlview->priv->internal = FALSE;

	browser_history_add_location (htmlview->priv->history, (gchar *)url);

	gtk_widget_set_sensitive (htmlview->priv->forward, browser_history_can_go_forward (htmlview->priv->history));
	gtk_widget_set_sensitive (htmlview->priv->back,    browser_history_can_go_back (htmlview->priv->history));

	gtk_entry_set_text (GTK_ENTRY (htmlview->priv->urlentry), url);
	
	(RENDERER (htmlview)->launch) (htmlview->priv->renderWidget, url);
}
Esempio n. 3
0
void
liferea_htmlview_location_changed (LifereaHtmlView *htmlview, const gchar *location)
{
	if (!htmlview->priv->internal) {
		browser_history_add_location (htmlview->priv->history, location);

		gtk_widget_set_sensitive (htmlview->priv->forward, browser_history_can_go_forward (htmlview->priv->history));
		gtk_widget_set_sensitive (htmlview->priv->back,    browser_history_can_go_back (htmlview->priv->history));

		gtk_entry_set_text (GTK_ENTRY (htmlview->priv->urlentry), location);

		/* We show the toolbar as it should be visible when loading external content */
		gtk_widget_show_all (htmlview->priv->toolbar);
	}

	g_signal_emit_by_name (htmlview, "location-changed", location);
}
Esempio n. 4
0
static void
on_htmlview_history_back (GtkWidget *widget, gpointer user_data)
{
	LifereaHtmlView	*htmlview = LIFEREA_HTMLVIEW (user_data);
	gchar		*url;

	/* Going back is a bit more complex than forward as we want to switch
	   from inline browsing back to headlines when we are in the item view.
	   So we expect an URL or NULL for switching back to the headline */
	url = browser_history_back (htmlview->priv->history);
	if (url) {
		gtk_widget_set_sensitive (htmlview->priv->forward, browser_history_can_go_forward (htmlview->priv->history));
		gtk_widget_set_sensitive (htmlview->priv->back,    browser_history_can_go_back (htmlview->priv->history));

		liferea_htmlview_launch_URL_internal (htmlview, url);
		gtk_entry_set_text (GTK_ENTRY (htmlview->priv->urlentry), url);
	} else {
		gtk_widget_hide (htmlview->priv->toolbar);
		liferea_htmlview_clear (htmlview);
		itemview_update_all_items ();
		itemview_update ();
	}
}