2006-05-05 05:20:14 -07:00
|
|
|
#include "e.h"
|
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
/* local function protos */
|
|
|
|
static void _e_int_gadcon_config(E_Gadcon *gc, const char *title);
|
2006-05-05 05:20:14 -07:00
|
|
|
static void *_create_data(E_Config_Dialog *cfd);
|
|
|
|
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
2008-01-04 01:18:42 -08:00
|
|
|
static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
2007-07-15 19:15:37 -07:00
|
|
|
static int _cb_mod_update(void *data, int type, void *event);
|
2008-01-04 01:18:42 -08:00
|
|
|
static void _avail_list_cb_change(void *data, Evas_Object *obj);
|
|
|
|
static void _sel_list_cb_change(void *data, Evas_Object *obj);
|
|
|
|
static void _load_avail_gadgets(void *data);
|
|
|
|
static void _load_sel_gadgets(void *data);
|
|
|
|
static void _cb_add(void *data, void *data2);
|
|
|
|
static void _cb_del(void *data, void *data2);
|
|
|
|
static void _set_description(void *data, const char *name);
|
2008-01-11 16:27:41 -08:00
|
|
|
static int _gad_list_sort(void *data1, void *data2);
|
2008-01-04 01:18:42 -08:00
|
|
|
|
|
|
|
struct _E_Config_Dialog_Data
|
2006-05-05 05:20:14 -07:00
|
|
|
{
|
2008-01-04 01:18:42 -08:00
|
|
|
Evas_Object *o_avail, *o_sel;
|
|
|
|
Evas_Object *o_add, *o_del;
|
|
|
|
Evas_Object *o_desc;
|
2006-05-19 17:03:20 -07:00
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
E_Gadcon *gc;
|
2007-07-15 19:15:37 -07:00
|
|
|
Ecore_Event_Handler *hdl;
|
2006-05-05 05:20:14 -07:00
|
|
|
};
|
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
/* externals */
|
|
|
|
EAPI void
|
|
|
|
e_int_gadcon_config_shelf(E_Gadcon *gc)
|
2007-11-09 15:53:38 -08:00
|
|
|
{
|
|
|
|
_e_int_gadcon_config(gc, _("Shelf Contents"));
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
e_int_gadcon_config_toolbar(E_Gadcon *gc)
|
|
|
|
{
|
|
|
|
_e_int_gadcon_config(gc, _("Toolbar Contents"));
|
|
|
|
}
|
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
/* local functions */
|
2007-11-09 15:53:38 -08:00
|
|
|
static void
|
|
|
|
_e_int_gadcon_config(E_Gadcon *gc, const char *title)
|
2006-05-05 05:20:14 -07:00
|
|
|
{
|
|
|
|
E_Config_Dialog *cfd;
|
|
|
|
E_Config_Dialog_View *v;
|
2008-01-04 01:18:42 -08:00
|
|
|
E_Container *con;
|
|
|
|
|
2006-05-05 05:20:14 -07:00
|
|
|
v = E_NEW(E_Config_Dialog_View, 1);
|
2007-11-01 14:39:55 -07:00
|
|
|
if (!v) return;
|
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
con = e_container_current_get(e_manager_current_get());
|
|
|
|
|
|
|
|
v->create_cfdata = _create_data;
|
|
|
|
v->free_cfdata = _free_data;
|
|
|
|
v->basic.create_widgets = _basic_create;
|
2007-11-01 14:39:55 -07:00
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
cfd = e_config_dialog_new(con, title, "E", "_gadcon_config_dialog",
|
|
|
|
"enlightenment/shelf", 0, v, gc);
|
2007-11-01 14:39:55 -07:00
|
|
|
gc->config_dialog = cfd;
|
|
|
|
e_dialog_resizable_set(cfd->dia, 1);
|
2006-05-05 05:20:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void *
|
2008-01-04 01:18:42 -08:00
|
|
|
_create_data(E_Config_Dialog *cfd)
|
2006-05-05 05:20:14 -07:00
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
2008-01-04 01:18:42 -08:00
|
|
|
|
2006-05-05 05:20:14 -07:00
|
|
|
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
|
|
|
cfdata->gc = cfd->data;
|
|
|
|
return cfdata;
|
|
|
|
}
|
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
static void
|
|
|
|
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
2006-05-19 17:03:20 -07:00
|
|
|
{
|
2008-01-04 01:18:42 -08:00
|
|
|
E_Gadcon *gc = NULL;
|
2006-05-19 17:03:20 -07:00
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
if (cfdata->hdl) ecore_event_handler_del(cfdata->hdl);
|
|
|
|
E_FREE(cfdata);
|
|
|
|
|
|
|
|
if (!(gc = cfd->data)) return;
|
|
|
|
gc->config_dialog = NULL;
|
2006-05-19 17:03:20 -07:00
|
|
|
}
|
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
static Evas_Object *
|
|
|
|
_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
2006-05-19 17:03:20 -07:00
|
|
|
{
|
2008-01-04 01:18:42 -08:00
|
|
|
Evas_Object *o = NULL, *of = NULL;
|
|
|
|
Evas_Object *ow = NULL;
|
2006-05-19 17:03:20 -07:00
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
o = e_widget_table_add(evas, 0);
|
|
|
|
of = e_widget_frametable_add(evas, _("Available Gadgets"), 0);
|
|
|
|
ow = e_widget_ilist_add(evas, 24, 24, NULL);
|
|
|
|
e_widget_ilist_multi_select_set(ow, 1);
|
|
|
|
e_widget_on_change_hook_set(ow, _avail_list_cb_change, cfdata);
|
|
|
|
cfdata->o_avail = ow;
|
|
|
|
_load_avail_gadgets(cfdata);
|
|
|
|
e_widget_frametable_object_append(of, ow, 0, 0, 1, 1, 1, 1, 1, 1);
|
|
|
|
ow = e_widget_button_add(evas, _("Add Gadget"), NULL, _cb_add, cfdata, NULL);
|
|
|
|
e_widget_disabled_set(ow, 1);
|
|
|
|
cfdata->o_add = ow;
|
|
|
|
e_widget_frametable_object_append(of, ow, 0, 1, 1, 1, 1, 1, 1, 0);
|
|
|
|
e_widget_table_object_append(o, of, 0, 0, 1, 1, 1, 1, 1, 1);
|
2006-05-19 17:03:20 -07:00
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
of = e_widget_frametable_add(evas, _("Selected Gadgets"), 0);
|
|
|
|
ow = e_widget_ilist_add(evas, 24, 24, NULL);
|
|
|
|
e_widget_ilist_multi_select_set(ow, 1);
|
|
|
|
e_widget_on_change_hook_set(ow, _sel_list_cb_change, cfdata);
|
|
|
|
cfdata->o_sel = ow;
|
|
|
|
_load_sel_gadgets(cfdata);
|
|
|
|
e_widget_frametable_object_append(of, ow, 0, 0, 1, 1, 1, 1, 1, 1);
|
|
|
|
ow = e_widget_button_add(evas, _("Remove Gadget"), NULL, _cb_del, cfdata, NULL);
|
|
|
|
e_widget_disabled_set(ow, 1);
|
|
|
|
cfdata->o_del = ow;
|
|
|
|
e_widget_frametable_object_append(of, ow, 0, 1, 1, 1, 1, 1, 1, 0);
|
|
|
|
e_widget_table_object_append(o, of, 1, 0, 1, 1, 1, 1, 1, 1);
|
|
|
|
|
|
|
|
ow = e_widget_textblock_add(evas);
|
|
|
|
e_widget_min_size_set(ow, 200, 70);
|
|
|
|
e_widget_textblock_markup_set(ow, _("Description: Unavailable"));
|
|
|
|
cfdata->o_desc = ow;
|
|
|
|
e_widget_table_object_append(o, ow, 0, 1, 2, 1, 1, 1, 1, 0);
|
2006-05-19 17:03:20 -07:00
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
if (cfdata->hdl) ecore_event_handler_del(cfdata->hdl);
|
|
|
|
cfdata->hdl = ecore_event_handler_add(E_EVENT_MODULE_UPDATE,
|
|
|
|
_cb_mod_update, cfdata);
|
|
|
|
return o;
|
2006-05-19 17:03:20 -07:00
|
|
|
}
|
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
static int
|
|
|
|
_cb_mod_update(void *data, int type, void *event)
|
2006-05-19 17:03:20 -07:00
|
|
|
{
|
2008-01-04 01:18:42 -08:00
|
|
|
E_Config_Dialog_Data *cfdata = NULL;
|
2006-05-19 17:03:20 -07:00
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
if (type != E_EVENT_MODULE_UPDATE) return 1;
|
|
|
|
if (!(cfdata = data)) return 1;
|
|
|
|
_load_avail_gadgets(cfdata);
|
|
|
|
_load_sel_gadgets(cfdata);
|
|
|
|
return 1;
|
|
|
|
}
|
2006-05-19 17:03:20 -07:00
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
static void
|
|
|
|
_avail_list_cb_change(void *data, Evas_Object *obj)
|
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata = NULL;
|
|
|
|
const char *name;
|
|
|
|
int sel, count;
|
2006-08-03 08:35:38 -07:00
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
if (!(cfdata = data)) return;
|
|
|
|
e_widget_ilist_unselect(cfdata->o_sel);
|
|
|
|
e_widget_disabled_set(cfdata->o_del, 1);
|
|
|
|
e_widget_disabled_set(cfdata->o_add, 0);
|
|
|
|
count = e_widget_ilist_selected_count_get(cfdata->o_avail);
|
|
|
|
if ((count > 1) || (count == 0))
|
|
|
|
e_widget_textblock_markup_set(cfdata->o_desc, _("Description: Unavailable"));
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sel = e_widget_ilist_selected_get(cfdata->o_avail);
|
|
|
|
name = (char *)e_widget_ilist_nth_data_get(cfdata->o_avail, sel);
|
|
|
|
_set_description(cfdata, name);
|
2006-08-03 08:35:38 -07:00
|
|
|
}
|
2006-05-19 17:03:20 -07:00
|
|
|
}
|
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
static void
|
|
|
|
_sel_list_cb_change(void *data, Evas_Object *obj)
|
2006-05-19 17:03:20 -07:00
|
|
|
{
|
2008-01-04 01:18:42 -08:00
|
|
|
E_Config_Dialog_Data *cfdata = NULL;
|
|
|
|
const char *name;
|
|
|
|
int sel, count;
|
|
|
|
|
|
|
|
if (!(cfdata = data)) return;
|
|
|
|
e_widget_ilist_unselect(cfdata->o_avail);
|
|
|
|
e_widget_disabled_set(cfdata->o_add, 1);
|
|
|
|
e_widget_disabled_set(cfdata->o_del, 0);
|
|
|
|
count = e_widget_ilist_selected_count_get(cfdata->o_sel);
|
|
|
|
if ((count > 1) || (count == 0))
|
|
|
|
e_widget_textblock_markup_set(cfdata->o_desc, _("Description: Unavailable"));
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sel = e_widget_ilist_selected_get(cfdata->o_sel);
|
|
|
|
name = (char *)e_widget_ilist_nth_data_get(cfdata->o_sel, sel);
|
|
|
|
_set_description(cfdata, name);
|
|
|
|
}
|
2006-06-22 11:47:19 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-01-04 01:18:42 -08:00
|
|
|
_load_avail_gadgets(void *data)
|
2006-06-22 11:47:19 -07:00
|
|
|
{
|
2008-01-04 01:18:42 -08:00
|
|
|
E_Config_Dialog_Data *cfdata = NULL;
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *l = NULL;
|
2006-06-22 11:47:19 -07:00
|
|
|
Evas *evas;
|
2008-01-04 01:18:42 -08:00
|
|
|
int w;
|
2006-11-27 07:52:45 -08:00
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
if (!(cfdata = data)) return;
|
|
|
|
evas = evas_object_evas_get(cfdata->o_avail);
|
2006-11-27 07:52:45 -08:00
|
|
|
evas_event_freeze(evas);
|
|
|
|
edje_freeze();
|
2008-01-04 01:18:42 -08:00
|
|
|
e_widget_ilist_freeze(cfdata->o_avail);
|
|
|
|
e_widget_ilist_clear(cfdata->o_avail);
|
2008-01-13 15:20:34 -08:00
|
|
|
// l = e_gadcon_provider_list();
|
2008-10-22 04:49:33 -07:00
|
|
|
// if (l) l = eina_list_sort(l, -1, _gad_list_sort);
|
2008-01-13 15:20:34 -08:00
|
|
|
for (l = e_gadcon_provider_list(); l; l = l->next)
|
2006-05-19 17:03:20 -07:00
|
|
|
{
|
2008-01-04 01:18:42 -08:00
|
|
|
E_Gadcon_Client_Class *cc;
|
|
|
|
Evas_Object *icon = NULL;
|
2008-02-12 20:51:01 -08:00
|
|
|
const char *lbl = NULL;
|
2008-01-04 01:18:42 -08:00
|
|
|
|
|
|
|
if (!(cc = l->data)) continue;
|
|
|
|
if (cc->func.label) lbl = cc->func.label();
|
|
|
|
if (!lbl) lbl = cc->name;
|
|
|
|
if (cc->func.icon) icon = cc->func.icon(evas);
|
|
|
|
e_widget_ilist_append(cfdata->o_avail, icon, lbl, NULL,
|
2008-02-12 20:51:01 -08:00
|
|
|
(void *)cc->name, NULL);
|
2006-05-19 17:03:20 -07:00
|
|
|
}
|
2008-01-04 01:18:42 -08:00
|
|
|
e_widget_ilist_go(cfdata->o_avail);
|
|
|
|
e_widget_min_size_get(cfdata->o_avail, &w, NULL);
|
2008-01-11 16:27:41 -08:00
|
|
|
if (w < 200) w = 200;
|
2008-01-04 01:18:42 -08:00
|
|
|
e_widget_min_size_set(cfdata->o_avail, w, 250);
|
|
|
|
e_widget_ilist_thaw(cfdata->o_avail);
|
2006-11-27 07:52:45 -08:00
|
|
|
edje_thaw();
|
|
|
|
evas_event_thaw(evas);
|
2006-06-22 11:47:19 -07:00
|
|
|
}
|
2006-05-19 17:03:20 -07:00
|
|
|
|
2006-06-22 11:47:19 -07:00
|
|
|
static void
|
2008-01-04 01:18:42 -08:00
|
|
|
_load_sel_gadgets(void *data)
|
2006-06-22 11:47:19 -07:00
|
|
|
{
|
2008-01-04 01:18:42 -08:00
|
|
|
E_Config_Dialog_Data *cfdata = NULL;
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *l = NULL, *l2 = NULL;
|
2006-06-22 11:47:19 -07:00
|
|
|
Evas *evas;
|
2008-01-04 01:18:42 -08:00
|
|
|
int w;
|
2006-07-21 08:19:54 -07:00
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
if (!(cfdata = data)) return;
|
|
|
|
evas = evas_object_evas_get(cfdata->o_sel);
|
2006-11-27 07:52:45 -08:00
|
|
|
evas_event_freeze(evas);
|
|
|
|
edje_freeze();
|
2008-01-04 01:18:42 -08:00
|
|
|
e_widget_ilist_freeze(cfdata->o_sel);
|
|
|
|
e_widget_ilist_clear(cfdata->o_sel);
|
|
|
|
for (l = cfdata->gc->cf->clients; l; l = l->next)
|
2006-05-19 17:03:20 -07:00
|
|
|
{
|
2008-01-04 01:18:42 -08:00
|
|
|
E_Config_Gadcon_Client *cgc;
|
|
|
|
|
|
|
|
if (!(cgc = l->data)) continue;
|
|
|
|
for (l2 = e_gadcon_provider_list(); l2; l2 = l2->next)
|
|
|
|
{
|
|
|
|
E_Gadcon_Client_Class *gcc;
|
|
|
|
Evas_Object *icon = NULL;
|
2008-02-12 20:51:01 -08:00
|
|
|
const char *lbl = NULL;
|
2008-01-04 01:18:42 -08:00
|
|
|
|
|
|
|
if (!(gcc = l2->data)) continue;
|
|
|
|
if ((cgc->name) && (gcc->name) &&
|
|
|
|
(!strcmp(cgc->name, gcc->name)))
|
|
|
|
{
|
|
|
|
if (gcc->func.label) lbl = gcc->func.label();
|
|
|
|
if (!lbl) lbl = gcc->name;
|
|
|
|
if (gcc->func.icon) icon = gcc->func.icon(evas);
|
|
|
|
e_widget_ilist_append(cfdata->o_sel, icon, lbl, NULL,
|
2008-02-12 20:51:01 -08:00
|
|
|
(void *)gcc->name, NULL);
|
2008-01-04 01:18:42 -08:00
|
|
|
}
|
|
|
|
}
|
2006-05-19 17:03:20 -07:00
|
|
|
}
|
2008-01-04 01:18:42 -08:00
|
|
|
e_widget_ilist_go(cfdata->o_sel);
|
|
|
|
e_widget_min_size_get(cfdata->o_sel, &w, NULL);
|
2008-01-11 16:27:41 -08:00
|
|
|
if (w < 200) w = 200;
|
2008-01-04 01:18:42 -08:00
|
|
|
e_widget_min_size_set(cfdata->o_sel, w, 250);
|
|
|
|
e_widget_ilist_thaw(cfdata->o_sel);
|
2006-11-27 07:52:45 -08:00
|
|
|
edje_thaw();
|
|
|
|
evas_event_thaw(evas);
|
2006-05-19 17:03:20 -07:00
|
|
|
}
|
2007-07-15 19:15:37 -07:00
|
|
|
|
2008-01-04 01:18:42 -08:00
|
|
|
static void
|
|
|
|
_cb_add(void *data, void *data2)
|
2007-07-15 19:15:37 -07:00
|
|
|
{
|
2008-01-04 01:18:42 -08:00
|
|
|
E_Config_Dialog_Data *cfdata = NULL;
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *l = NULL;
|
2008-01-04 01:18:42 -08:00
|
|
|
int i = 0, update = 0;
|
|
|
|
|
|
|
|
if (!(cfdata = data)) return;
|
|
|
|
for (i = 0, l = e_widget_ilist_items_get(cfdata->o_avail); l; l = l->next, i++)
|
|
|
|
{
|
|
|
|
E_Ilist_Item *item = NULL;
|
|
|
|
const char *name = NULL;
|
|
|
|
|
|
|
|
if (!(item = l->data)) continue;
|
|
|
|
if (!item->selected) continue;
|
|
|
|
name = (char *)e_widget_ilist_nth_data_get(cfdata->o_avail, i);
|
|
|
|
if (!name) continue;
|
|
|
|
if (!e_gadcon_client_config_new(cfdata->gc, name)) continue;
|
|
|
|
update = 1;
|
|
|
|
}
|
|
|
|
if (update)
|
|
|
|
{
|
|
|
|
e_gadcon_unpopulate(cfdata->gc);
|
|
|
|
e_gadcon_populate(cfdata->gc);
|
|
|
|
e_config_save_queue();
|
|
|
|
|
|
|
|
_load_sel_gadgets(cfdata);
|
|
|
|
e_widget_ilist_selected_set(cfdata->o_sel, i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_cb_del(void *data, void *data2)
|
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata = NULL;
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *l = NULL, *g = NULL;
|
2008-01-04 01:18:42 -08:00
|
|
|
int i = 0, update = 0;
|
|
|
|
|
|
|
|
if (!(cfdata = data)) return;
|
|
|
|
for (i = 0, l = e_widget_ilist_items_get(cfdata->o_sel); l; l = l->next, i++)
|
|
|
|
{
|
|
|
|
E_Ilist_Item *item = NULL;
|
|
|
|
const char *name = NULL;
|
|
|
|
|
|
|
|
if (!(item = l->data)) continue;
|
|
|
|
if (!item->selected) continue;
|
|
|
|
name = (char *)e_widget_ilist_nth_data_get(cfdata->o_sel, i);
|
|
|
|
if (!name) continue;
|
2008-09-01 20:11:55 -07:00
|
|
|
for (g = cfdata->gc->cf->clients; g; g = g->next)
|
2008-01-04 01:18:42 -08:00
|
|
|
{
|
|
|
|
E_Config_Gadcon_Client *cgc;
|
|
|
|
|
|
|
|
if (!(cgc = g->data)) continue;
|
|
|
|
if (strcmp(name, cgc->name)) continue;
|
|
|
|
e_gadcon_client_config_del(cfdata->gc->cf, cgc);
|
|
|
|
update = 1;
|
2008-06-11 00:02:05 -07:00
|
|
|
break;
|
2008-01-04 01:18:42 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (update)
|
|
|
|
{
|
|
|
|
e_gadcon_unpopulate(cfdata->gc);
|
|
|
|
e_gadcon_populate(cfdata->gc);
|
|
|
|
e_config_save_queue();
|
|
|
|
|
|
|
|
_load_sel_gadgets(cfdata);
|
|
|
|
|
|
|
|
/* we just default to selecting first one here as the user may have had
|
|
|
|
* more than one selected */
|
|
|
|
e_widget_ilist_selected_set(cfdata->o_sel, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_set_description(void *data, const char *name)
|
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata = NULL;
|
|
|
|
E_Module *mod = NULL;
|
|
|
|
Efreet_Desktop *desk = NULL;
|
|
|
|
char buf[4096];
|
|
|
|
|
|
|
|
if (!(cfdata = data)) return;
|
|
|
|
if (!name) return;
|
|
|
|
if (!(mod = e_module_find(name))) return;
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "%s/module.desktop", e_module_dir_get(mod));
|
|
|
|
if (!ecore_file_exists(buf)) return;
|
|
|
|
if (!(desk = efreet_desktop_get(buf))) return;
|
|
|
|
if (desk->comment)
|
|
|
|
e_widget_textblock_markup_set(cfdata->o_desc, desk->comment);
|
|
|
|
efreet_desktop_free(desk);
|
2007-07-15 19:15:37 -07:00
|
|
|
}
|
2008-01-11 16:27:41 -08:00
|
|
|
|
|
|
|
static int
|
|
|
|
_gad_list_sort(void *data1, void *data2)
|
|
|
|
{
|
|
|
|
E_Gadcon_Client_Class *cc, *cc2;
|
2008-02-12 20:51:01 -08:00
|
|
|
const char *lbl1 = NULL, *lbl2 = NULL;
|
2008-01-11 16:27:41 -08:00
|
|
|
|
|
|
|
if (!(cc = data1)) return 1;
|
|
|
|
if (!(cc2 = data2)) return -1;
|
|
|
|
|
|
|
|
if (cc->func.label) lbl1 = cc->func.label();
|
|
|
|
if (!lbl1) lbl1 = cc->name;
|
2008-01-13 15:20:34 -08:00
|
|
|
|
2008-01-11 16:27:41 -08:00
|
|
|
if (cc2->func.label) lbl2 = cc2->func.label();
|
|
|
|
if (!lbl2) lbl2 = cc2->name;
|
|
|
|
|
|
|
|
return (strcmp(lbl1, lbl2));
|
|
|
|
}
|