From: Enlightenment S. <no-...@en...> - 2011-06-07 21:48:52
|
Log: Elfe: Save dock items into config Author: captainigloo Date: 2011-06-07 14:48:46 -0700 (Tue, 07 Jun 2011) New Revision: 60049 Trac: http://trac.enlightenment.org/e/changeset/60049 Modified: trunk/E-MODULES-EXTRA/elfe/src/desktop.c trunk/E-MODULES-EXTRA/elfe/src/desktop_page.c trunk/E-MODULES-EXTRA/elfe/src/dock.c trunk/E-MODULES-EXTRA/elfe/src/elfe_config.c Modified: trunk/E-MODULES-EXTRA/elfe/src/desktop.c =================================================================== --- trunk/E-MODULES-EXTRA/elfe/src/desktop.c 2011-06-07 21:29:18 UTC (rev 60048) +++ trunk/E-MODULES-EXTRA/elfe/src/desktop.c 2011-06-07 21:48:46 UTC (rev 60049) @@ -190,8 +190,6 @@ Evas_Event_Mouse_Up *ev = event_info; - printf("icon mouse up\n"); - evas_object_del(desk->floating_icon); evas_object_event_callback_del(desk->layout, EVAS_CALLBACK_MOUSE_MOVE, _icon_mouse_move_cb); evas_object_event_callback_del(desk->layout, EVAS_CALLBACK_MOUSE_UP, _icon_mouse_up_cb); @@ -265,8 +263,6 @@ size = MIN(ow, oh) / 5; - printf("Gadget long pressed\n"); - elfe_desktop_edit_mode_set(desk->layout, EINA_TRUE); elfe_dock_place_mode_set(desk->dock, EINA_TRUE); @@ -511,8 +507,6 @@ if (desk->edit_mode == mode) return; - - printf("Elfe desktop edit mode %d\n",mode); desk->edit_mode = mode; Modified: trunk/E-MODULES-EXTRA/elfe/src/desktop_page.c =================================================================== --- trunk/E-MODULES-EXTRA/elfe/src/desktop_page.c 2011-06-07 21:29:18 UTC (rev 60048) +++ trunk/E-MODULES-EXTRA/elfe/src/desktop_page.c 2011-06-07 21:48:46 UTC (rev 60049) @@ -148,8 +148,6 @@ { Evas_Coord x = 0, y = 0, w = 0, h = 0; - printf("Page %d populage item [%d %d]: %s\n", page->desktop, dic->row, dic->col, dic->name); - /* This position is already in use, this is a conf issue! */ /* FIXME: delete item from config ? */ if (eina_matrixsparse_data_idx_get(page->items, dic->row, dic->col)) Modified: trunk/E-MODULES-EXTRA/elfe/src/dock.c =================================================================== --- trunk/E-MODULES-EXTRA/elfe/src/dock.c 2011-06-07 21:29:18 UTC (rev 60048) +++ trunk/E-MODULES-EXTRA/elfe/src/dock.c 2011-06-07 21:48:46 UTC (rev 60049) @@ -53,8 +53,7 @@ elfe_desktop_item_pos_get(item, &row, &col); eina_matrixsparse_cell_idx_clear(dock->items, row, col); evas_object_del(item); - // elfe_home_config_dock_item_del(dock->desktop, - // row, col); + elfe_home_config_dock_item_del(col); } @@ -121,6 +120,10 @@ continue; evas_object_smart_callback_add(item, "item,delete", _item_delete_cb, dock); + evas_object_size_hint_min_set(item, elfe_home_cfg->icon_size, elfe_home_cfg->icon_size); + evas_object_size_hint_max_set(item, elfe_home_cfg->icon_size, elfe_home_cfg->icon_size); + evas_object_size_hint_align_set(item, 0.5, 0.5); + elm_table_pack(dock->table, item, dic->col, 0, 1, 1); evas_object_show(item); eina_matrixsparse_data_idx_set(dock->items, 0, dic->col, item); @@ -193,8 +196,6 @@ dock->edit_mode = mode; - printf("Dock edit mode\n"); - iter = eina_matrixsparse_iterator_new(dock->items); EINA_ITERATOR_FOREACH(iter, cell) { @@ -233,11 +234,8 @@ elm_table_pack(dock->table, item, col, 0, 1, 1); eina_matrixsparse_data_idx_set(dock->items, 0, col, item); - /* elfe_home_config_desktop_item_add(page->desktop, */ - /* ELFE_DESKTOP_ITEM_APP, */ - /* row, col, */ - /* 0, 0, 0, 0, */ - /* menu->desktop->orig_path); */ + elfe_home_config_dock_item_add(col, + menu->desktop->orig_path); evas_object_smart_callback_add(item, "item,delete", _item_delete_cb, dock); } Modified: trunk/E-MODULES-EXTRA/elfe/src/elfe_config.c =================================================================== --- trunk/E-MODULES-EXTRA/elfe/src/elfe_config.c 2011-06-07 21:29:18 UTC (rev 60048) +++ trunk/E-MODULES-EXTRA/elfe/src/elfe_config.c 2011-06-07 21:48:46 UTC (rev 60049) @@ -101,12 +101,10 @@ int elfe_home_config_save(void) { - printf("<<<<<<<<<<<<<<<<<<<<<<<<<<<< CONFIG SAVE\n"); e_config_domain_save("module.elfe", conf_edd, elfe_home_cfg); return 1; } -/* local functions */ void elfe_home_config_desktop_item_add(int desktop, Elfe_Desktop_Item_Type type, int row, int col, @@ -142,16 +140,37 @@ Elfe_Desktop_Item_Config *dic; Eina_List *l; - printf("DELETE CONFIG ITEM %d %d\n", col, row); dc = eina_list_nth(elfe_home_cfg->desktops, desktop); EINA_LIST_FOREACH(dc->items, l, dic) { if ((dic->row == row) && (dic->col == col)) { - printf("Delete %d %d\n", row, col); dc->items = eina_list_remove(dc->items, dic); elfe_home_config_save(); return; } } } + + +void elfe_home_config_dock_item_add(int col, + const char *name) +{ + Elfe_Desktop_Item_Config *dic; + + dic = calloc(1, sizeof(Elfe_Desktop_Item_Config)); + dic->type = ELFE_DESKTOP_ITEM_ICON; + dic->name = eina_stringshare_add(name); + dic->col = col; + elfe_home_cfg->dock_items = eina_list_append(elfe_home_cfg->dock_items, dic); + elfe_home_config_save(); +} + +void elfe_home_config_dock_item_del(int col) +{ + Elfe_Desktop_Item_Config *dic; + + dic = eina_list_nth(elfe_home_cfg->dock_items, col); + elfe_home_cfg->dock_items = eina_list_remove(elfe_home_cfg->dock_items, dic); + elfe_home_config_save(); +} |