Example #1
0
static gboolean ui_update_monitor_update(void *data) {

	if(umdialog) {
		feedlist_foreach(ui_update_find_requests);
		return TRUE;
	} else {
		return FALSE;
	}	
}
Example #2
0
static gboolean
feedlist_schedule_save_cb (gpointer user_data)
{
	/* step 1: request each node to save its state */
	feedlist_foreach (node_save);

	/* step 2: request saving for the root node and thereby
	   forcing the root plugin to save the feed list structure */
	NODE_SOURCE_TYPE (ROOTNODE)->source_export (ROOTNODE);
	
	feedlist->priv->saveTimer = 0;
	
	return FALSE;
}
Example #3
0
static void
feedlist_init (FeedList *fl)
{
	gint	startup_feed_action;

	debug_enter ("feedlist_init");
	
	/* 1. Prepare globally accessible singleton */
	g_assert (NULL == feedlist);
	feedlist = fl;
	
	feedlist->priv = FEEDLIST_GET_PRIVATE (fl);
	feedlist->priv->loading = TRUE;
	
	/* 2. Set up a root node and import the feed list source structure. */
	debug0 (DEBUG_CACHE, "Setting up root node");
	ROOTNODE = node_source_setup_root ();

	/* 3. Ensure folder expansion and unread count*/
	debug0 (DEBUG_CACHE, "Initializing node state");
	feedlist_foreach (feedlist_init_node);

	ui_tray_update ();

	/* 4. Check if feeds do need updating. */
	debug0 (DEBUG_UPDATE, "Performing initial feed update");
	conf_get_int_value (STARTUP_FEED_ACTION, &startup_feed_action);
	if (0 == startup_feed_action) {
		/* Update all feeds */
		if (network_monitor_is_online ()) {
			debug0 (DEBUG_UPDATE, "initial update: updating all feeds");		
			node_update_subscription (feedlist_get_root (), GUINT_TO_POINTER (0));
		} else {
			debug0 (DEBUG_UPDATE, "initial update: prevented because we are offline");
		}
	} else {
		debug0 (DEBUG_UPDATE, "initial update: resetting feed counter");
		feedlist_reset_update_counters (NULL);
	}

	/* 5. Start automatic updating */
	feedlist->priv->autoUpdateTimer = g_timeout_add_seconds (10, feedlist_auto_update, NULL);
	g_signal_connect (network_monitor_get (), "online-status-changed", G_CALLBACK (on_network_status_changed), NULL);

	/* 6. Finally save the new feed list state */
	feedlist->priv->loading = FALSE;
	feedlist_schedule_save ();
	
	debug_exit ("feedlist_init");	
}
Example #4
0
static void
feed_list_view_reduce_mode_changed (void)
{
	if (flv->feedlist_reduced_unread) {
		gtk_tree_view_set_reorderable (flv->treeview, FALSE);
		gtk_tree_view_set_model (flv->treeview, GTK_TREE_MODEL (flv->filter));
		gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (flv->filter));
	} else {
		gtk_tree_view_set_reorderable (flv->treeview, TRUE);
		gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (flv->filter));
		gtk_tree_view_set_model (flv->treeview, GTK_TREE_MODEL (flv->feedstore));

		feedlist_foreach (feed_list_view_restore_folder_expansion);
	}
}
Example #5
0
void
feed_list_view_sort_folder (nodePtr folder)
{
	GtkTreeView             *treeview;

	treeview = GTK_TREE_VIEW (liferea_shell_lookup ("feedlist"));
	/* Unset the model from the view before clearing it and rebuilding it.*/
	gtk_tree_view_set_model (treeview, NULL);
	folder->children = g_slist_sort (folder->children, feed_list_view_sort_folder_compare);
	feed_list_view_reload_feedlist ();
	/* Reduce mode didn't actually change but we need to set the
	 * correct model according to the setting in the same way : */
	feed_list_view_reduce_mode_changed ();
	feedlist_foreach (feed_list_view_restore_folder_expansion);
	feedlist_schedule_save ();
}
Example #6
0
void
feedlist_mark_all_read (nodePtr node)
{
	if (!node)
		return;

	feedlist_reset_new_item_count ();

	if (node != ROOTNODE)
		node_mark_all_read (node);
	else 
		node_foreach_child (ROOTNODE, node_mark_all_read);
		
	feedlist_foreach (feedlist_update_node_counters);
	itemview_update_all_items ();
	itemview_update ();
}
Example #7
0
void
ui_indicator_update ()
{
	guint index;

	/* Do not update indicators if the user is interacting with the main window */
	if (!indicator_priv || gtk_window_is_active (GTK_WINDOW (liferea_shell_get_window ())))
		return;

	/* Remove all previous indicators from the menu */
	remove_all_indicators ();
	/* ...then walk the tree and add an indicator for each unread feed */
	feedlist_foreach (add_node_indicator);

	/* revert order of items */
	for (index = indicator_priv->indicators->len; index > 0; index--)
		indicate_indicator_show (g_ptr_array_index (indicator_priv->indicators, index - 1));	
}
Example #8
0
static void
feedlist_finalize (GObject *object)
{
	/* Stop all timer based activity */
	if (feedlist->priv->autoUpdateTimer)
		g_source_remove (feedlist->priv->autoUpdateTimer);
	if (feedlist->priv->saveTimer)
		g_source_remove (feedlist->priv->saveTimer);

	/* Enforce synchronous save upon exit */
	feedlist_save ();		
	
	/* And destroy everything */
	feedlist_foreach (feedlist_free_node);
	node_free (ROOTNODE);
	ROOTNODE = NULL;

	G_OBJECT_CLASS (parent_class)->finalize (object);
}
Example #9
0
void on_cancel_all_requests_clicked(GtkButton *button, gpointer user_data) {

	feedlist_foreach(ui_update_cancel);
}
Example #10
0
static void
on_updateallfavicons_clicked (GtkButton *button, gpointer user_data)
{
    feedlist_foreach (node_update_favicon);
}