コード例 #1
0
ファイル: chanlist.c プロジェクト: Babl0lka/XChat
/**
 * Fills the gui GtkTreeView with stored items from the GSList.
 */
static void
chanlist_build_gui_list (server *serv)
{
	GSList *rows;

	/* first check if the list is present */
	if (serv->gui->chanlist_data_stored_rows == NULL)
	{
		/* start a download */
		chanlist_do_refresh (serv);
		return;
	}

	custom_list_clear ((CustomList *)GET_MODEL (serv));

	/* discard pending rows FIXME: free the structs? */
	g_slist_free (serv->gui->chanlist_pending_rows);
	serv->gui->chanlist_pending_rows = NULL;

	/* Reset the counters */
	chanlist_reset_counters (serv);

	/* Refill the list */
	for (rows = serv->gui->chanlist_data_stored_rows; rows != NULL;
		  rows = rows->next)
	{
		chanlist_place_row_in_gui (serv, rows->data, TRUE);
	}

	custom_list_resort ((CustomList *)GET_MODEL (serv));
}
コード例 #2
0
ファイル: chanlist.c プロジェクト: Babl0lka/XChat
void
fe_chan_list_end (server *serv)
{
	/* download complete */
	chanlist_flush_pending (serv);
	gtk_widget_set_sensitive (serv->gui->chanlist_refresh, TRUE);
	custom_list_resort ((CustomList *)GET_MODEL (serv));
}
コード例 #3
0
ファイル: custom-list.c プロジェクト: 94m3k1n9/hexchat
static void
custom_list_sortable_set_sort_column_id (GtkTreeSortable * sortable,
													  gint sort_col_id, GtkSortType order)
{
	CustomList *custom_list = CUSTOM_LIST (sortable);

	if (custom_list->sort_id == sort_col_id
		 && custom_list->sort_order == order)
		return;

	custom_list->sort_id = sort_col_id;
	custom_list->sort_order = order;

	custom_list_resort (custom_list);

	/* emit "sort-column-changed" signal to tell any tree views
	 *  that the sort column has changed (so the little arrow
	 *  in the column header of the sort column is drawn
	 *  in the right column)                                     */

	gtk_tree_sortable_sort_column_changed (sortable);
}