Example #1
0
/* Fill last page (summary) */
static void
npw_druid_fill_summary_page (NPWDruid* druid)
{
	NPWPage* page;
	guint i;
	GString* text;
	GtkLabel* label;

	text = g_string_new (NULL);
	g_string_append_printf (text, "<b>%s</b>\n\n", _("Confirm the following information:"));

	/* The project type is translated too, it is something like
	 * generic, GNOME applet, Makefile project... */
	g_string_append_printf (text, _("Project Type: %s\n"), npw_header_get_name (druid->header));

	for (i = 0; (page = g_queue_peek_nth (druid->page_list, i)) != NULL; ++i)
	{
		npw_page_foreach_property (page, (GFunc)cb_druid_add_summary_property, text);
	}

	label = GTK_LABEL (druid->finish_text);
	gtk_label_set_markup (label, text->str);
	g_string_free (text, TRUE);

	gtk_assistant_set_page_complete (GTK_ASSISTANT (druid->window), druid->finish_page, TRUE);
}
Example #2
0
static gint
compare_header_name (NPWHeader *a, NPWHeader *b)
{
	if (npw_header_get_order (a) == npw_header_get_order (b))
	{
		return g_utf8_collate (npw_header_get_name (a), npw_header_get_name (b));
	}
	else if (npw_header_get_order (a) == 0)
	{
		return 1;
	}
	else if (npw_header_get_order (b) == 0)
	{
		return -1;
	}
	else
	{
		return npw_header_get_order (a) - npw_header_get_order (b);
	}
}
Example #3
0
/* Add a project in the icon list */
static void
cb_druid_insert_project_icon (gpointer data, gpointer user_data)
{
	NPWHeader *header = (NPWHeader *)data;
	GtkListStore* store = GTK_LIST_STORE (user_data);
	GtkTreeIter iter;
	GdkPixbuf *pixbuf;

	gtk_list_store_append (store, &iter);
	pixbuf = gdk_pixbuf_new_from_file (npw_header_get_iconfile (header), NULL);
	gtk_list_store_set (store, &iter, PIXBUF_COLUMN, pixbuf,
						TEXT_COLUMN, npw_header_get_name (header),
						DESC_COLUMN, npw_header_get_description (header),
						DATA_COLUMN, header,
						-1);

	g_object_unref (pixbuf);
}