Ejemplo n.º 1
0
static void
eds_receive_contacts_cb (EBook         *book,
			 EBookStatus    status,
			 GList         *contacts,
			 gpointer       user_data)
{
	GtkTreeIter        iter;
	GList             *l;
	GtkListStore      *model;
	PlannerPlugin     *plugin;
	PlannerPluginPriv *priv;
	GdkPixbuf         *pixbuf;
	AsyncQuery        *async_query;
	const gchar       *uid;
	gchar             *filename;

	async_query = (AsyncQuery *) user_data;

	uid = async_query->uid;
	plugin = async_query->plugin;
	priv = plugin->priv;
	model = GTK_LIST_STORE (priv->resources_model);

	g_free (async_query);

	if (eds_query_cancelled (plugin, uid)) {
		g_message ("Answer for query cancelled: %s", uid);
		return;
	}

	g_message ("Book status response: %d", status);
	g_message ("Answer for the query: %s", uid);

	/* Exceed limit is E_BOOK_ERROR_OTHER_ERROR :( */
	if (status == E_BOOK_ERROR_OK || status == E_BOOK_ERROR_OTHER_ERROR) {
		filename = mrp_paths_get_image_dir ("/resources.png");
		pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
		g_free (filename);
		for (l = contacts; l; l = l->next) {
			gchar *name, *email;
			name = e_contact_get (l->data, E_CONTACT_FULL_NAME);
			g_message ("Resource name: %s\n", name);
			email = e_contact_get (l->data, E_CONTACT_EMAIL_1);
			gtk_list_store_append (model, &iter);
			gtk_list_store_set (model, &iter,
					    COL_RESOURCE_NAME, name,
					    COL_RESOURCE_EMAIL, email,
					    COL_RESOURCE_SELECTED, FALSE,
					    COL_RESOURCE_PHOTO, pixbuf,
					    COL_RESOURCE_OBJECT, l->data, -1);
		}
	} else {
		g_warning ("Problem getting contacts ...");
	}

	eds_plugin_busy (plugin, FALSE);
}
Ejemplo n.º 2
0
static const gchar *
task_view_get_icon (PlannerView *view)
{
    static gchar *filename = NULL;

    if (!filename) {
        filename = mrp_paths_get_image_dir ("tasks.png");
    }

    return filename;
}
Ejemplo n.º 3
0
static const gchar *
show_view_get_icon (PlannerView *view)
{
	static gchar *filename = NULL;

	if (!filename) {
		filename = mrp_paths_get_image_dir ("24_simulate.png");
	}

	return filename;
}
Ejemplo n.º 4
0
static const gchar *
usage_view_get_icon (PlannerView *view)
{
	static gchar *filename = NULL;

	if (!filename) {
		filename = mrp_paths_get_image_dir ("resources_usage.png");
	}

        return filename;
}