Exemplo n.º 1
0
static void
liferea_htmlview_online_status_changed (NetworkMonitor *nm, gboolean online, gpointer userdata)
{
	LifereaHtmlView *htmlview = LIFEREA_HTMLVIEW (userdata);
	
	liferea_htmlview_set_online (htmlview, online);
}
Exemplo n.º 2
0
static void
liferea_htmlview_proxy_changed (NetworkMonitor *nm, gpointer userdata)
{
	LifereaHtmlView *htmlview = LIFEREA_HTMLVIEW (userdata);

	(RENDERER (htmlview)->setProxy) (network_get_proxy_host (),
	                                 network_get_proxy_port (),
	                                 network_get_proxy_username (),
	                                 network_get_proxy_password ());
}
Exemplo n.º 3
0
static gboolean
on_htmlview_url_entry_activate (GtkWidget *widget, gpointer user_data)
{
	LifereaHtmlView	*htmlview = LIFEREA_HTMLVIEW (user_data);
	gchar	*url;

	url = (gchar *)gtk_entry_get_text (GTK_ENTRY (widget));
	liferea_htmlview_launch_URL_internal (htmlview, url);

	return TRUE;
}
Exemplo n.º 4
0
static void
liferea_htmlview_finalize (GObject *object)
{
	LifereaHtmlView *htmlview = LIFEREA_HTMLVIEW (object);

	browser_history_free (htmlview->priv->history);

	g_signal_handlers_disconnect_by_data (network_monitor_get (), object);

	G_OBJECT_CLASS (parent_class)->finalize (object);
}
Exemplo n.º 5
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);
}
Exemplo n.º 6
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 ();
	}
}
Exemplo n.º 7
0
LifereaHtmlView *
liferea_htmlview_new (gboolean forceInternalBrowsing)
{
	LifereaHtmlView *htmlview;
		
	htmlview = LIFEREA_HTMLVIEW (g_object_new (LIFEREA_HTMLVIEW_TYPE, NULL));
	htmlview->priv->forceInternalBrowsing = forceInternalBrowsing;

	liferea_htmlview_clear (htmlview);
	
	g_signal_connect (network_monitor_get (), "online-status-changed",
	                  G_CALLBACK (liferea_htmlview_online_status_changed),
	                  htmlview);
	g_signal_connect (network_monitor_get (), "proxy-changed",
	                  G_CALLBACK (liferea_htmlview_proxy_changed),
	                  htmlview);

	if (NULL != network_get_proxy_host ()) {
		debug0 (DEBUG_NET, "Setting initial HTML widget proxy...");
		liferea_htmlview_proxy_changed (network_monitor_get (), htmlview);
	}
	
	return htmlview;
}
Exemplo n.º 8
0
static void
on_popup_zoomout_activate (GtkWidget *widget, gpointer user_data)
{
	liferea_htmlview_do_zoom (LIFEREA_HTMLVIEW (user_data), FALSE);
}