3 typedef struct _E_Config_Data
5 const char *title, *icon, *dialog, *filename;
6 Eina_Bool show_autostart;
9 typedef struct _E_Config_App_List
11 E_Config_Dialog_Data *cfdata;
12 Evas_Object *o_list, *o_add, *o_del, *o_desc;
16 struct _E_Config_Dialog_Data
19 Evas_Object *o_list, *o_up, *o_down, *o_del;
21 Ecore_Timer *fill_delay;
22 E_Config_App_List apps_user;
23 E_Config_App_List apps_xdg; /* xdg autostart apps */
26 /* local function prototypes */
27 static E_Config_Dialog *_create_dialog(E_Container *con, E_Config_Data *data);
28 static void *_create_data(E_Config_Dialog *cfd);
29 static void _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata);
30 static Evas_Object *_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata);
31 static int _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata);
32 static Eina_List *_load_menu(const char *path);
33 static Eina_List *_load_order(const char *path);
34 static int _save_menu(E_Config_Dialog_Data *cfdata);
35 static int _save_order(E_Config_Dialog_Data *cfdata);
36 static void _fill_apps_list(E_Config_App_List *apps);
37 static void _fill_xdg_list(E_Config_App_List *apps);
38 static void _fill_order_list(E_Config_Dialog_Data *cfdata);
39 static void _cb_apps_list_selected(void *data);
40 static void _cb_order_list_selected(void *data);
41 static int _cb_desks_sort(const void *data1, const void *data2);
42 static int _cb_desks_name(const void *data1, const void *data2) ;
43 static int _cb_desks_sort(const void *data1, const void *data2);
44 static void _cb_add(void *data, void *data2 __UNUSED__);
45 static void _cb_del(void *data, void *data2 __UNUSED__);
46 static void _cb_up(void *data, void *data2 __UNUSED__);
47 static void _cb_down(void *data, void *data2 __UNUSED__);
48 static void _cb_order_del(void *data, void *data2 __UNUSED__);
49 static Eina_Bool _cb_fill_delay(void *data);
50 static void _list_items_state_set(E_Config_App_List *apps);
53 e_int_config_apps_add(E_Container *con, const char *params __UNUSED__)
57 if (!(ed = e_desktop_edit(con, NULL))) return NULL;
62 e_int_config_apps_favs(E_Container *con, const char *params __UNUSED__)
67 e_user_dir_concat_static(buff, "applications/menu/favorite.menu");
68 data = E_NEW(E_Config_Data, 1);
69 data->title = eina_stringshare_add(_("Favorite Applications"));
70 data->dialog = eina_stringshare_add("menus/favorites_menu");
71 data->icon = eina_stringshare_add("user-bookmarks");
72 data->filename = eina_stringshare_add(buff);
73 return _create_dialog(con, data);
77 e_int_config_apps_ibar(E_Container *con, const char *params __UNUSED__)
82 e_user_dir_concat_static(buff, "applications/bar/default/.order");
83 data = E_NEW(E_Config_Data, 1);
84 data->title = eina_stringshare_add(_("IBar Applications"));
85 data->dialog = eina_stringshare_add("applications/ibar_applications");
86 data->icon = eina_stringshare_add("preferences-applications-ibar");
87 data->filename = eina_stringshare_add(buff);
88 return _create_dialog(con, data);
92 e_int_config_apps_ibar_other(E_Container *con, const char *path)
96 if (!path) return NULL;
97 data = E_NEW(E_Config_Data, 1);
98 data->title = eina_stringshare_add(_("IBar Applications"));
99 data->dialog = eina_stringshare_add("internal/ibar_other");
100 data->icon = eina_stringshare_add("preferences-applications-ibar");
101 data->filename = eina_stringshare_add(path);
102 return _create_dialog(con, data);
106 e_int_config_apps_startup(E_Container *con, const char *params __UNUSED__)
111 e_user_dir_concat_static(buff, "applications/startup/.order");
112 data = E_NEW(E_Config_Data, 1);
113 data->title = eina_stringshare_add(_("Startup Applications"));
114 data->dialog = eina_stringshare_add("applications/startup_applications");
115 data->icon = eina_stringshare_add("preferences-applications-startup");
116 data->filename = eina_stringshare_add(buff);
117 data->show_autostart = EINA_TRUE;
118 return _create_dialog(con, data);
122 e_int_config_apps_restart(E_Container *con, const char *params __UNUSED__)
127 e_user_dir_concat_static(buff, "applications/restart/.order");
128 data = E_NEW(E_Config_Data, 1);
129 data->title = eina_stringshare_add(_("Restart Applications"));
130 data->dialog = eina_stringshare_add("applications/restart_applications");
131 data->icon = eina_stringshare_add("preferences-applications-restart");
132 data->filename = eina_stringshare_add(buff);
133 return _create_dialog(con, data);
136 /* local function prototypes */
137 static E_Config_Dialog *
138 _create_dialog(E_Container *con, E_Config_Data *data)
140 E_Config_Dialog *cfd;
141 E_Config_Dialog_View *v;
143 if (e_config_dialog_find("E", data->dialog))
145 if (data->title) eina_stringshare_del(data->title);
146 if (data->dialog) eina_stringshare_del(data->dialog);
147 if (data->icon) eina_stringshare_del(data->icon);
148 if (data->filename) eina_stringshare_del(data->filename);
153 v = E_NEW(E_Config_Dialog_View, 1);
154 v->create_cfdata = _create_data;
155 v->free_cfdata = _free_data;
156 v->basic.create_widgets = _basic_create;
157 v->basic.apply_cfdata = _basic_apply;
159 cfd = e_config_dialog_new(con, data->title, "E", data->dialog,
160 data->icon, 0, v, data);
165 _create_data(E_Config_Dialog *cfd)
167 E_Config_Dialog_Data *cfdata;
171 if (!(data = cfd->data)) return NULL;
172 if (!data->filename) return NULL;
173 if (!(ext = strrchr(data->filename, '.'))) return NULL;
175 cfdata = E_NEW(E_Config_Dialog_Data, 1);
177 cfdata->apps_xdg.cfdata = cfdata;
178 cfdata->apps_user.cfdata = cfdata;
179 if (!strcmp(ext, ".menu"))
180 cfdata->apps = _load_menu(data->filename);
181 else if (!strcmp(ext, ".order"))
182 cfdata->apps = _load_order(data->filename);
188 _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
191 Efreet_Desktop *desk;
193 if (cfdata->fill_delay) ecore_timer_del(cfdata->fill_delay);
195 if ((data = cfdata->data))
197 if (data->title) eina_stringshare_del(data->title);
198 if (data->dialog) eina_stringshare_del(data->dialog);
199 if (data->icon) eina_stringshare_del(data->icon);
200 if (data->filename) eina_stringshare_del(data->filename);
203 EINA_LIST_FREE(cfdata->apps, desk)
204 efreet_desktop_free(desk);
205 EINA_LIST_FREE(cfdata->apps_user.desks, desk)
206 efreet_desktop_free(desk);
207 EINA_LIST_FREE(cfdata->apps_xdg.desks, desk)
208 efreet_desktop_free(desk);
213 _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
215 Evas_Object *otb, *ot;
218 otb = e_widget_toolbook_add(evas, 24, 24);
220 if (cfdata->data->show_autostart)
222 /* XDG autostart page */
223 ot = e_widget_table_add(evas, EINA_FALSE);
224 cfdata->apps_xdg.o_list = e_widget_ilist_add(evas, 24, 24, NULL);
225 e_widget_ilist_multi_select_set(cfdata->apps_xdg.o_list, EINA_TRUE);
226 e_widget_size_min_get(cfdata->apps_xdg.o_list, &mw, NULL);
227 if (mw < (200 * e_scale)) mw = (200 * e_scale);
228 e_widget_size_min_set(cfdata->apps_xdg.o_list, mw, (75 * e_scale));
229 e_widget_table_object_append(ot, cfdata->apps_xdg.o_list, 0, 0, 2, 1, 1, 1, 1, 1);
231 cfdata->apps_xdg.o_desc = e_widget_textblock_add(evas);
232 e_widget_size_min_set(cfdata->apps_xdg.o_desc, 100, (45 * e_scale));
233 e_widget_table_object_append(ot, cfdata->apps_xdg.o_desc, 0, 1, 2, 1, 1, 1, 0, 0);
235 cfdata->apps_xdg.o_add = e_widget_button_add(evas, _("Add"), "list-add",
236 _cb_add, &cfdata->apps_xdg, NULL);
237 e_widget_disabled_set(cfdata->apps_xdg.o_add, EINA_TRUE);
238 e_widget_table_object_append(ot, cfdata->apps_xdg.o_add, 0, 2, 1, 1, 1, 1, 1, 0);
239 cfdata->apps_xdg.o_del = e_widget_button_add(evas, _("Remove"), "list-remove",
240 _cb_del, &cfdata->apps_xdg, NULL);
241 e_widget_disabled_set(cfdata->apps_xdg.o_del, EINA_TRUE);
242 e_widget_table_object_append(ot, cfdata->apps_xdg.o_del, 1, 2, 1, 1, 1, 1, 1, 0);
244 e_widget_toolbook_page_append(otb, NULL, _("System"), ot,
245 1, 1, 1, 1, 0.5, 0.0);
249 ot = e_widget_table_add(evas, EINA_FALSE);
250 cfdata->apps_user.o_list = e_widget_ilist_add(evas, 24, 24, NULL);
251 e_widget_ilist_multi_select_set(cfdata->apps_user.o_list, EINA_TRUE);
252 e_widget_size_min_get(cfdata->apps_user.o_list, &mw, NULL);
253 if (mw < (200 * e_scale)) mw = (200 * e_scale);
254 e_widget_size_min_set(cfdata->apps_user.o_list, mw, (75 * e_scale));
255 e_widget_table_object_append(ot, cfdata->apps_user.o_list, 0, 0, 2, 1, 1, 1, 1, 1);
256 cfdata->apps_user.o_add = e_widget_button_add(evas, _("Add"), "list-add",
257 _cb_add, &cfdata->apps_user, NULL);
258 e_widget_disabled_set(cfdata->apps_user.o_add, EINA_TRUE);
259 e_widget_table_object_append(ot, cfdata->apps_user.o_add, 0, 1, 1, 1, 1, 1, 1, 0);
260 cfdata->apps_user.o_del = e_widget_button_add(evas, _("Remove"), "list-remove",
261 _cb_del, &cfdata->apps_user, NULL);
262 e_widget_disabled_set(cfdata->apps_user.o_del, EINA_TRUE);
263 e_widget_table_object_append(ot, cfdata->apps_user.o_del, 1, 1, 1, 1, 1, 1, 1, 0);
264 e_widget_toolbook_page_append(otb, NULL, _("Applications"), ot,
265 1, 1, 1, 1, 0.5, 0.0);
268 ot = e_widget_table_add(evas, EINA_FALSE);
269 cfdata->o_list = e_widget_ilist_add(evas, 24, 24, NULL);
270 _fill_order_list(cfdata);
271 e_widget_table_object_append(ot, cfdata->o_list, 0, 0, 3, 1, 1, 1, 1, 1);
272 cfdata->o_up = e_widget_button_add(evas, _("Up"), "go-up",
273 _cb_up, cfdata, NULL);
274 e_widget_disabled_set(cfdata->o_up, EINA_TRUE);
275 e_widget_table_object_append(ot, cfdata->o_up, 0, 1, 1, 1, 1, 1, 1, 0);
276 cfdata->o_down = e_widget_button_add(evas, _("Down"), "go-down",
277 _cb_down, cfdata, NULL);
278 e_widget_disabled_set(cfdata->o_down, EINA_TRUE);
279 e_widget_table_object_append(ot, cfdata->o_down, 1, 1, 1, 1, 1, 1, 1, 0);
280 cfdata->o_del = e_widget_button_add(evas, _("Remove"), "list-remove",
281 _cb_order_del, cfdata, NULL);
282 e_widget_disabled_set(cfdata->o_del, EINA_TRUE);
283 e_widget_table_object_append(ot, cfdata->o_del, 2, 1, 1, 1, 1, 1, 1, 0);
284 e_widget_toolbook_page_append(otb, NULL, _("Order"), ot,
285 1, 1, 1, 1, 0.5, 0.0);
287 e_widget_toolbook_page_show(otb, 0);
289 if (cfdata->fill_delay) ecore_timer_del(cfdata->fill_delay);
290 cfdata->fill_delay = ecore_timer_add(0.2, _cb_fill_delay, cfdata);
292 e_dialog_resizable_set(cfd->dia, 1);
293 e_win_centered_set(cfd->dia->win, 1);
298 _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
302 if ((!cfdata->data) || (!cfdata->data->filename)) return 0;
303 if (!(ext = strrchr(cfdata->data->filename, '.'))) return 0;
304 if (!strcmp(ext, ".menu"))
305 return _save_menu(cfdata);
306 else if (!strcmp(ext, ".order"))
307 return _save_order(cfdata);
312 _load_menu(const char *path)
314 Efreet_Menu *menu, *entry;
315 Eina_List *apps = NULL, *l;
317 menu = efreet_menu_parse(path);
318 if ((!menu) || (!menu->entries)) return NULL;
319 EINA_LIST_FOREACH(menu->entries, l, entry)
321 if (entry->type != EFREET_MENU_ENTRY_DESKTOP) continue;
322 efreet_desktop_ref(entry->desktop);
323 apps = eina_list_append(apps, entry->desktop);
325 efreet_menu_free(menu);
330 _load_order(const char *path)
332 E_Order *order = NULL;
333 Eina_List *apps = NULL, *l;
334 Efreet_Desktop *desk;
336 if (!path) return NULL;
337 if (!(order = e_order_new(path))) return NULL;
338 EINA_LIST_FOREACH(order->desktops, l, desk)
340 efreet_desktop_ref(desk);
341 apps = eina_list_append(apps, desk);
343 e_object_del(E_OBJECT(order));
348 _save_menu(E_Config_Dialog_Data *cfdata)
351 Efreet_Menu *menu = NULL;
352 Efreet_Desktop *desk;
355 menu = efreet_menu_new("Favorites");
356 EINA_LIST_FOREACH(cfdata->apps, l, desk)
359 efreet_menu_desktop_insert(menu, desk, -1);
361 ret = efreet_menu_save(menu, cfdata->data->filename);
362 efreet_menu_free(menu);
367 _save_order(E_Config_Dialog_Data *cfdata)
370 E_Order *order = NULL;
371 Efreet_Desktop *desk;
373 if (!(order = e_order_new(cfdata->data->filename))) return 0;
374 e_order_clear(order);
375 EINA_LIST_FOREACH(cfdata->apps, l, desk)
378 e_order_append(order, desk);
380 e_object_del(E_OBJECT(order));
385 _list_items_state_set(E_Config_App_List *apps)
389 Efreet_Desktop *desk;
394 evas = evas_object_evas_get(apps->o_list);
395 evas_event_freeze(evas);
397 e_widget_ilist_freeze(apps->o_list);
398 e_widget_ilist_clear(apps->o_list);
400 EINA_LIST_FOREACH(apps->desks, l, desk)
402 Evas_Object *icon = NULL, *end = NULL;
404 end = edje_object_add(evas);
405 if (!e_theme_edje_object_set(end, "base/theme/widgets",
406 "e/widgets/ilist/toggle_end"))
408 evas_object_del(end);
414 if (eina_list_search_unsorted(apps->cfdata->apps, _cb_desks_sort, desk))
416 edje_object_signal_emit(end, "e,state,checked", "e");
420 edje_object_signal_emit(end, "e,state,unchecked", "e");
423 icon = e_util_desktop_icon_add(desk, 24, evas);
424 e_widget_ilist_append_full(apps->o_list, icon, end, desk->name,
425 _cb_apps_list_selected, apps, NULL);
428 e_widget_ilist_go(apps->o_list);
429 e_widget_ilist_thaw(apps->o_list);
431 evas_event_thaw(evas);
435 _fill_apps_list(E_Config_App_List *apps)
437 Eina_List *desks = NULL;
438 Efreet_Desktop *desk = NULL;
440 desks = efreet_util_desktop_name_glob_list("*");
441 EINA_LIST_FREE(desks, desk)
445 if (desk->no_display)
447 efreet_desktop_free(desk);
450 ll = eina_list_search_unsorted_list(apps->desks, _cb_desks_sort, desk);
455 old = eina_list_data_get(ll);
457 * This fixes when we have several .desktop with the same name,
458 * and the only difference is that some of them are for specific
461 if ((old->only_show_in) && (!desk->only_show_in))
463 efreet_desktop_free(old);
464 eina_list_data_set(ll, desk);
467 efreet_desktop_free(desk);
470 apps->desks = eina_list_append(apps->desks, desk);
472 apps->desks = eina_list_sort(apps->desks, -1, _cb_desks_sort);
474 _list_items_state_set(apps);
478 _fill_xdg_list(E_Config_App_List *apps)
481 Efreet_Desktop *desk = NULL;
482 const char *path = "/etc/xdg/autostart";
486 files = ecore_file_ls(path);
487 EINA_LIST_FREE(files, file)
491 if ((file[0] == '.') || !(ext = strrchr(file, '.')) || (strcmp(ext, ".desktop")))
496 snprintf(buf, sizeof(buf), "%s/%s", path, file);
499 desk = efreet_desktop_new(buf);
503 ll = eina_list_search_unsorted_list(apps->desks, _cb_desks_sort, desk);
508 old = eina_list_data_get(ll);
510 * This fixes when we have several .desktop with the same name,
511 * and the only difference is that some of them are for specific
514 if ((old->only_show_in) && (!desk->only_show_in))
516 efreet_desktop_free(old);
517 eina_list_data_set(ll, desk);
520 efreet_desktop_free(desk);
523 apps->desks = eina_list_append(apps->desks, desk);
526 apps->desks = eina_list_sort(apps->desks, -1, _cb_desks_sort);
528 _list_items_state_set(apps);
532 _fill_order_list(E_Config_Dialog_Data *cfdata)
535 Efreet_Desktop *desk = NULL;
538 evas = evas_object_evas_get(cfdata->o_list);
539 evas_event_freeze(evas);
541 e_widget_ilist_freeze(cfdata->o_list);
542 e_widget_ilist_clear(cfdata->o_list);
544 EINA_LIST_FOREACH(cfdata->apps, l, desk)
546 Evas_Object *icon = NULL;
548 icon = e_util_desktop_icon_add(desk, 24, evas);
549 e_widget_ilist_append(cfdata->o_list, icon, desk->name,
550 _cb_order_list_selected, cfdata, NULL);
553 e_widget_ilist_go(cfdata->o_list);
554 e_widget_ilist_thaw(cfdata->o_list);
556 evas_event_thaw(evas);
560 _cb_apps_list_selected(void *data)
562 E_Config_App_List *apps;
563 const E_Ilist_Item *it;
565 unsigned int enabled = 0, disabled = 0;
567 if (!(apps = data)) return;
568 EINA_LIST_FOREACH(e_widget_ilist_items_get(apps->o_list), l, it)
570 if ((!it->selected) || (it->header)) continue;
571 if (eina_list_search_unsorted(apps->cfdata->apps, _cb_desks_name, it->label))
579 Efreet_Desktop *desk;
582 sel = e_widget_ilist_selected_get(apps->o_list);
583 desk = eina_list_nth(apps->desks, sel);
585 e_widget_textblock_markup_set(apps->o_desc, desk->comment);
588 e_widget_disabled_set(apps->o_add, !disabled);
589 e_widget_disabled_set(apps->o_del, !enabled);
593 _cb_order_list_selected(void *data)
595 E_Config_Dialog_Data *cfdata;
598 if (!(cfdata = data)) return;
599 sel = e_widget_ilist_selected_get(cfdata->o_list);
600 count = eina_list_count(cfdata->apps);
601 e_widget_disabled_set(cfdata->o_up, (sel == 0));
602 e_widget_disabled_set(cfdata->o_down, !(sel < (count - 1)));
603 e_widget_disabled_set(cfdata->o_del, EINA_FALSE);
607 _cb_desks_name(const void *data1, const void *data2)
609 const Efreet_Desktop *d1;
612 if (!(d1 = data1)) return 1;
613 if (!d1->name) return 1;
614 if (!(d2 = data2)) return -1;
615 return strcmp(d1->name, d2);
619 _cb_desks_sort(const void *data1, const void *data2)
621 const Efreet_Desktop *d1, *d2;
623 if (!(d1 = data1)) return 1;
624 if (!d1->name) return 1;
625 if (!(d2 = data2)) return -1;
626 if (!d2->name) return -1;
627 return strcmp(d1->name, d2->name);
631 _cb_add(void *data, void *data2 __UNUSED__)
633 E_Config_App_List *apps;
634 const E_Ilist_Item *it;
637 if (!(apps = data)) return;
638 EINA_LIST_FOREACH(e_widget_ilist_items_get(apps->o_list), l, it)
640 Efreet_Desktop *desk;
642 if ((!it->selected) || (it->header)) continue;
643 if (!(desk = eina_list_search_unsorted(apps->desks, _cb_desks_name, it->label))) continue;
644 if (!eina_list_search_unsorted(apps->cfdata->apps, _cb_desks_sort, desk))
648 end = e_widget_ilist_item_end_get(it);
649 if (end) edje_object_signal_emit(end, "e,state,checked", "e");
650 efreet_desktop_ref(desk);
651 apps->cfdata->apps = eina_list_append(apps->cfdata->apps, desk);
654 e_widget_ilist_unselect(apps->o_list);
655 e_widget_disabled_set(apps->o_add, EINA_TRUE);
656 e_widget_disabled_set(apps->o_del, EINA_TRUE);
657 _fill_order_list(apps->cfdata);
661 _cb_del(void *data, void *data2 __UNUSED__)
663 E_Config_App_List *apps;
664 const E_Ilist_Item *it;
667 if (!(apps = data)) return;
668 EINA_LIST_FOREACH(e_widget_ilist_items_get(apps->o_list), l, it)
670 Efreet_Desktop *desk;
672 if ((!it->selected) || (it->header)) continue;
673 if ((desk = eina_list_search_unsorted(apps->cfdata->apps, _cb_desks_name, it->label)))
677 end = e_widget_ilist_item_end_get(it);
678 if (end) edje_object_signal_emit(end, "e,state,unchecked", "e");
679 apps->cfdata->apps = eina_list_remove(apps->cfdata->apps, desk);
680 efreet_desktop_unref(desk);
684 e_widget_ilist_unselect(apps->o_list);
685 e_widget_disabled_set(apps->o_add, EINA_TRUE);
686 e_widget_disabled_set(apps->o_del, EINA_TRUE);
687 _fill_order_list(apps->cfdata);
691 _cb_order_del(void *data, void *data2 __UNUSED__)
693 E_Config_Dialog_Data *cfdata;
694 const E_Ilist_Item *it;
697 if (!(cfdata = data)) return;
698 EINA_LIST_FOREACH(e_widget_ilist_items_get(cfdata->o_list), l, it)
700 Efreet_Desktop *desk;
702 if ((!it->selected) || (it->header)) continue;
704 if ((desk = eina_list_search_unsorted(cfdata->apps, _cb_desks_name, it->label)))
706 cfdata->apps = eina_list_remove(cfdata->apps, desk);
707 efreet_desktop_unref(desk);
711 _list_items_state_set(&(cfdata->apps_xdg));
712 _list_items_state_set(&(cfdata->apps_user));
714 e_widget_ilist_unselect(cfdata->o_list);
715 e_widget_disabled_set(cfdata->o_del, EINA_TRUE);
716 _fill_order_list(cfdata);
720 _cb_up(void *data, void *data2 __UNUSED__)
722 E_Config_Dialog_Data *cfdata;
728 if (!(cfdata = data)) return;
729 evas = evas_object_evas_get(cfdata->o_list);
730 evas_event_freeze(evas);
732 e_widget_ilist_freeze(cfdata->o_list);
734 sel = e_widget_ilist_selected_get(cfdata->o_list);
735 lbl = e_widget_ilist_selected_label_get(cfdata->o_list);
736 if ((l = eina_list_search_unsorted_list(cfdata->apps, _cb_desks_name, lbl)))
738 Efreet_Desktop *desk;
739 Evas_Object *icon = NULL;
741 desk = eina_list_data_get(l);
747 cfdata->apps = eina_list_remove_list(cfdata->apps, l);
748 cfdata->apps = eina_list_prepend_relative_list(cfdata->apps, desk, ll);
750 e_widget_ilist_remove_num(cfdata->o_list, sel);
751 e_widget_ilist_go(cfdata->o_list);
752 icon = e_util_desktop_icon_add(desk, 24, evas);
753 e_widget_ilist_prepend_relative(cfdata->o_list, icon, desk->name,
754 _cb_order_list_selected, cfdata,
756 e_widget_ilist_selected_set(cfdata->o_list, (sel - 1));
760 e_widget_ilist_go(cfdata->o_list);
761 e_widget_ilist_thaw(cfdata->o_list);
763 evas_event_thaw(evas);
767 _cb_down(void *data, void *data2 __UNUSED__)
769 E_Config_Dialog_Data *cfdata;
775 if (!(cfdata = data)) return;
776 evas = evas_object_evas_get(cfdata->o_list);
777 evas_event_freeze(evas);
779 e_widget_ilist_freeze(cfdata->o_list);
781 sel = e_widget_ilist_selected_get(cfdata->o_list);
782 lbl = e_widget_ilist_selected_label_get(cfdata->o_list);
783 if ((l = eina_list_search_unsorted_list(cfdata->apps, _cb_desks_name, lbl)))
785 Efreet_Desktop *desk;
786 Evas_Object *icon = NULL;
788 desk = eina_list_data_get(l);
794 cfdata->apps = eina_list_remove_list(cfdata->apps, l);
795 cfdata->apps = eina_list_append_relative_list(cfdata->apps, desk, ll);
797 e_widget_ilist_remove_num(cfdata->o_list, sel);
798 e_widget_ilist_go(cfdata->o_list);
799 icon = e_util_desktop_icon_add(desk, 24, evas);
800 e_widget_ilist_append_relative(cfdata->o_list, icon, desk->name,
801 _cb_order_list_selected, cfdata,
803 e_widget_ilist_selected_set(cfdata->o_list, (sel + 1));
807 e_widget_ilist_go(cfdata->o_list);
808 e_widget_ilist_thaw(cfdata->o_list);
810 evas_event_thaw(evas);
814 _cb_fill_delay(void *data)
816 E_Config_Dialog_Data *cfdata;
819 if (!(cfdata = data)) return ECORE_CALLBACK_CANCEL;
820 _fill_apps_list(&cfdata->apps_user);
821 e_widget_size_min_get(cfdata->apps_user.o_list, &mw, NULL);
822 if (mw < (200 * e_scale)) mw = (200 * e_scale);
823 e_widget_size_min_set(cfdata->apps_user.o_list, mw, (175 * e_scale));
825 if (cfdata->data->show_autostart)
827 _fill_xdg_list(&cfdata->apps_xdg);
828 e_widget_size_min_get(cfdata->apps_xdg.o_list, &mw, NULL);
829 if (mw < (200 * e_scale)) mw = (200 * e_scale);
830 e_widget_size_min_set(cfdata->apps_xdg.o_list, mw, (175 * e_scale));
833 cfdata->fill_delay = NULL;
834 return ECORE_CALLBACK_CANCEL;