I started making the open-with menu. Should I make the items with toggles and the last chosen app is then used for the normal open-item? I changed the code for key selection with control set. It now gets less messed up when selecting back and forth, but its not perfect. I thought about making a direct lookup for icons by coordinates, as it could make the selection-logic more simple.
To me the naming-scheme for icons and files seems a bit inconsistent. The List of E_Fm_Icon is called sd->files and then it includes a file- and an icon-object, sometimes its reffered to as selection.current.file and more often as icon. Is it grown or planned like that? If this is not planned, I would like to rename it to E_Fm_Item and sd->items and all function that work on E_Fm_Item and not on E_Fm_File or e_fileman_iconĀ“s smartdata. I can wait with that, but it would have been much easier for me to understand the code. regards, jeff
Index: e_fileman_file.c =================================================================== RCS file: /root/e17/apps/e/src/bin/e_fileman_file.c,v retrieving revision 1.1.1.1 diff -r1.1.1.1 e_fileman_file.c 12,17c12 < typedef struct _E_Fm_Assoc_App E_Fm_Assoc_App; < struct _E_Fm_Assoc_App < { < char *mime; < char *app; < }; --- > 49a45 > char *ext; 80c76 < if (S_ISDIR(file->mode)) --- > if (S_ISDIR(file->mode)){ 81a78,79 > file->mime = "directory"; > } 98a97,106 > if(!file->mime) > { > ext = strrchr(file->name, '.'); > if (ext) > { > file->mime = ext; > } > else > file->mime = "unknown"; > } 330a339,340 > > 420a431,454 > int e_fm_file_exec_with(E_Fm_File *file, char* exec_with) > { > Ecore_Exe *exe; > char app[PATH_MAX * 2]; > if (!exec_with || !file) return 0; > > snprintf(app, PATH_MAX * 2, "%s \"%s\"", exec_with, file->path); > exe = ecore_exe_run(app, NULL); > > if (!exe) > { > e_error_dialog_show(_("Run Error"), > _("3 Enlightenment was unable fork a child process:\n" > "\n" > "%s\n" > "\n"), > app); > return 0; > } > } > > > > 428a463 > ///??? if (file->mime) free(file->mime); 431a467 > Index: e_fileman_file.h =================================================================== RCS file: /root/e17/apps/e/src/bin/e_fileman_file.h,v retrieving revision 1.1.1.1 diff -r1.1.1.1 e_fileman_file.h 39a40 > char *mime; /* mimetype (just the extension) */ 68a70 > EAPI int e_fm_file_exec_with (E_Fm_File *file, char* exec_with); Index: e_fileman_smart.c =================================================================== RCS file: /root/e17/apps/e/src/bin/e_fileman_smart.c,v retrieving revision 1.1.1.41 diff -r1.1.1.41 e_fileman_smart.c 90c90 < --- > typedef enum _E_Fm_State E_Fm_State; 94c94,95 < int height; --- > int height; > Evas_List *apps; 142a144,151 > enum _E_Fm_State > { > E_FILEMAN_STATE_IDLE = 0, > E_FILEMAN_STATE_TYPEBUFFER = 1, > E_FILEMAN_STATE_RENAME = 2, > }; > > 163a173,174 > Evas_Hash *mime_menu_hash; > 176c187,189 < --- > > E_Fm_State state; > // E_Fm_Icon *active_file; 252a266,267 > static void _e_fm_file_rename_start(E_Fm_Icon *icon); > static void _e_fm_file_rename_abort(E_Fm_Icon *icon); 314c329 < --- > static int _e_fm_init_assoc(E_Fm_Smart_Data *sd); 379a395 > 614a631,683 > > > int > _e_fm_init_assoc(E_Fm_Smart_Data *sd) > { > E_Fm_Assoc_App *assoc; > > assoc = E_NEW(E_Fm_Assoc_App, 1); > assoc->mime = (char*)E_NEW(char *, 5); > snprintf(assoc->mime, 5, "%s", ".jpg"); > assoc->app = (char*)E_NEW(char *, 7); > snprintf(assoc->app, 5, "gimp"); > sd->conf.main->apps = evas_list_append(sd->conf.main->apps, assoc); > > assoc = E_NEW(E_Fm_Assoc_App, 1); > assoc->mime = (char*)E_NEW(char *, 5); > snprintf(assoc->mime, 5, "%s", ".jpg"); > assoc->app = (char*)E_NEW(char *, 7); > snprintf(assoc->app, 8, "exhibit"); > sd->conf.main->apps = evas_list_append(sd->conf.main->apps, assoc); > > assoc = E_NEW(E_Fm_Assoc_App, 1); > assoc->mime = (char*)E_NEW(char *, 5); > snprintf(assoc->mime, 5, "%s", ".png"); > assoc->app = (char*)E_NEW(char *, 7); > snprintf(assoc->app, 5, "gimp"); > sd->conf.main->apps = evas_list_append(sd->conf.main->apps, assoc); > > assoc = E_NEW(E_Fm_Assoc_App, 1); > assoc->mime = (char*)E_NEW(char *, 5); > snprintf(assoc->mime, 5, "%s", ".png"); > assoc->app = (char*)E_NEW(char *, 7); > snprintf(assoc->app, 8, "exhibit"); > sd->conf.main->apps = evas_list_append(sd->conf.main->apps, assoc); > > assoc = E_NEW(E_Fm_Assoc_App, 1); > assoc->mime = (char*)E_NEW(char *, 5); > snprintf(assoc->mime, 5, "%s", ".pdf"); > assoc->app = (char*)E_NEW(char *, 7); > snprintf(assoc->app, 7, "evince"); > sd->conf.main->apps = evas_list_append(sd->conf.main->apps, assoc); > > assoc = E_NEW(E_Fm_Assoc_App, 1); > assoc->mime = (char*)E_NEW(char *, 5); > snprintf(assoc->mime, 5, "%s", ".mp3"); > assoc->app = (char*)E_NEW(char *, 7); > snprintf(assoc->app, 8, "xmms -Q"); > sd->conf.main->apps = evas_list_append(sd->conf.main->apps, assoc); > > return 1; > } > > 728a798,799 > _e_fm_init_assoc(sd); > sd->state = E_FILEMAN_STATE_IDLE; 774a846 > evas_hash_free(sd->mime_menu_hash); 913,914c985,990 < _e_fm_file_rename(E_Fm_Icon *icon, const char* name) < { --- > _e_fm_file_rename(E_Fm_Icon *icon, const char* name) // could be better called _e_fm_file_rename_apply > { > e_fm_icon_edit_entry_set(icon->icon_obj, NULL); > evas_object_focus_set(icon->sd->entry_obj, 0); > evas_object_del(icon->sd->entry_obj); > icon->sd->entry_obj = NULL; 919,921c995,1013 < { < e_fm_icon_title_set(icon->icon_obj, name); < } --- > { > e_fm_icon_title_set(icon->icon_obj, name); > } > evas_object_focus_set(icon->sd->object, 1); > icon->sd->state = E_FILEMAN_STATE_IDLE; > > } > > static void > _e_fm_file_rename_abort(E_Fm_Icon *icon) > { > e_fm_icon_edit_entry_set(icon->icon_obj, NULL); > evas_object_focus_set(icon->sd->entry_obj, 0); > evas_object_del(icon->sd->entry_obj); > icon->sd->entry_obj = NULL; > e_fm_icon_title_set(icon->icon_obj, icon->file->name); > evas_object_focus_set(icon->sd->object, 1); > icon->sd->state = E_FILEMAN_STATE_IDLE; > 954c1046,1048 < --- > char *exe; > E_Fm_Assoc_App *assoc; > Evas_List *l; 955a1050,1059 > > for (l = icon->sd->conf.main->apps; l; l = l->next) > { > assoc = l->data; > if(!strcmp(assoc->app,mi->label)){ > e_fm_file_exec_with(icon->file, assoc->app); > return; > } > > } 999a1104,1105 > _e_fm_file_rename_start(icon); > } 1000a1107,1110 > static void > _e_fm_file_rename_start(E_Fm_Icon *icon) > { > icon->sd->state = E_FILEMAN_STATE_RENAME; 1009,1011c1119,1121 < e_fm_mouse_up_handler = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_UP, < _e_fm_win_mouse_up_cb, icon); < e_grabinput_get(icon->sd->win->evas_win, 1, icon->sd->win->evas_win); --- > // e_fm_mouse_up_handler = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_UP, > // _e_fm_win_mouse_up_cb, icon); > //e_grabinput_get(icon->sd->win->evas_win, 1, icon->sd->win->evas_win); 1013a1124 > 1015c1126,1127 < e_fm_grab_time = ecore_time_get(); --- > > // e_fm_grab_time = ecore_time_get(); 1741c1853 < sd->files = evas_list_prepend(sd->files, icon); --- > sd->files = evas_list_append(sd->files, icon); 1923c2035,2041 < --- > > if(sd->state == E_FILEMAN_STATE_RENAME) > { > _e_fm_file_rename_abort(sd->selection.current.file); > return; > } > 2149a2268 > 2155a2275,2280 > if(icon->sd->state == E_FILEMAN_STATE_RENAME) > { > _e_fm_file_rename_abort(icon->sd->selection.current.file); > return; > } > 2238,2240c2363,2365 < E_Menu *mn; < E_Menu_Item *mi; < int x, y, w, h; --- > //E_Menu *mn; > //E_Menu_Item *mi; > //int x, y, w, h; 2245c2370,2429 < mn = e_menu_new(); --- > > E_Menu *mn,*mo; > E_Menu_Item *mi, *mio; > int x, y, w, h; > > Evas_List *l; > E_Fm_Assoc_App *assoc; > > mn = e_menu_new(); > > > mi = NULL; > if((mo = evas_hash_find(icon->sd->mime_menu_hash,icon->file->mime)) == NULL) > { /*- Arrange -*/ > mo = e_menu_new(); > > > for (l = icon->sd->conf.main->apps; l; l = l->next) > { > assoc = l->data; > if (strcmp(icon->file->mime, assoc->mime) == 0) > { > > mi = e_menu_item_new(mo); > e_menu_item_label_set(mi, _(assoc->app)); > e_menu_item_radio_set(mi, 1); > e_menu_item_radio_group_set(mi, 2); > > //if (!((assoc->app->icon_class) && > // (e_util_menu_item_edje_icon_list_set(mi, assoc->app->icon_class)))) > // e_menu_item_icon_edje_set(mi, assoc->app->path, "item"); > > e_menu_item_callback_set(mi, _e_fm_file_menu_open, icon); > } > assoc = NULL; > } > if(mi) > { > icon->sd->mime_menu_hash = evas_hash_add(icon->sd->mime_menu_hash,strdup(icon->file->mime), mo); > mi = e_menu_item_new(mn); > e_menu_item_submenu_set(mi, mo); > e_menu_item_label_set(mi, _("Open with")); > e_menu_item_icon_edje_set(mi, > (char *)e_theme_edje_file_get("base/theme/fileman", > "fileman/button/open"), > "fileman/button/open"); > } > } > else > { > mi = e_menu_item_new(mn); > e_menu_item_label_set(mi, _("Open with")); > e_menu_item_icon_edje_set(mi, > (char *)e_theme_edje_file_get("base/theme/fileman", > "fileman/button/open"), > "fileman/button/open"); > e_menu_item_submenu_set(mi, mo); > } > > 2642a2827,2831 > > > > > 2646,2649c2835 < Evas_List *l; < < if(sd->selection.current.ptr) < { --- > Evas_List *l; 2651d2836 < Evas_Coord x, y, x2, y2; 2653,2664c2838,2861 < l = sd->selection.current.ptr; < icon = l->data; < evas_object_geometry_get(icon->icon_obj, &x, &y, NULL, NULL); < x2 = x + 1; < l = l->prev; < while(l && x != x2) < { < icon = l->data; < evas_object_geometry_get(icon->icon_obj, &x2, &y2, NULL, NULL); < if (evas_key_modifier_is_set(evas_key_modifier_get(sd->evas), "Control")) < { < if(icon->state.selected) --- > if(!sd->selection.current.ptr) > _e_fm_selections_add(sd->files->data, sd->files); > else > { > if(sd->selection.current.ptr->prev) /* are we already at the beginning? */ > { > Evas_Coord x, x2, y, w, h; > > l = sd->selection.current.ptr; > icon = l->data; > evas_object_geometry_get(icon->icon_obj, &x, NULL, NULL, NULL); > x2 = x + 1; > l = l->prev; > > if (!evas_key_modifier_is_set(evas_key_modifier_get(sd->evas), "Control")) > { > for(; l && (x != x2); l = l->prev) > { > icon = l->data; > evas_object_geometry_get(icon->icon_obj, &x2, NULL, NULL, NULL); > > } > _e_fm_selections_clear(sd); > if(!l) 2666,2667c2863,2864 < _e_fm_selections_del(l->data); < _e_fm_selections_current_set(l->data, l); --- > l = sd->files; // go to the beginning > _e_fm_selections_add(l->data, l); 2669,2711c2866,2917 < else < _e_fm_selections_add(l->data, l); < } < l = l->prev; < } < if(l && !evas_key_modifier_is_set(evas_key_modifier_get(sd->evas), "Control")) < { < if(l->next) l = l->next; < if(!l) return; < _e_fm_selections_clear(sd); < _e_fm_selections_add(l->data, l); < } < else if(!l) < { < if(!evas_key_modifier_is_set(evas_key_modifier_get(sd->evas), "Control")) < _e_fm_selections_clear(sd); < _e_fm_selections_add(sd->files->data, sd->files); < } < if(l) < { < E_Fm_Icon *icon; < Evas_Coord x, y, w, h; < icon = l->data; < evas_object_geometry_get(icon->icon_obj, &x, &y, &w, &h); < if(!E_CONTAINS(sd->x, sd->y, sd->w, sd->h, x, y, w, h)) < { < E_Event_Fm_Reconfigure *ev; < < ev = E_NEW(E_Event_Fm_Reconfigure, 1); < if (ev) < { < ev->object = sd->object; < ev->x = sd->x; < ev->y = sd->child.y - (sd->y - (y - sd->icon_info.y_space)); < ev->w = sd->w; < ev->h = sd->h; < ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL); < } < } < } < } < else < _e_fm_selections_add(sd->files->data, sd->files); --- > else > _e_fm_selections_add(l->next->data, l->next); > } > else /* Control modifier set */ > { > int flag = 0; > icon = l->data; > if(flag = icon->state.selected) > { > if(l->next->next) > icon = l->next->next->data; > else > icon = l->next->data; > > evas_object_geometry_get(icon->icon_obj, &x, NULL, NULL, NULL); > _e_fm_selections_del(sd->selection.current.ptr->data); > x2 = x + 1; > } > for(; l && (x != x2); l = l->prev) > { > icon = l->data; > evas_object_geometry_get(icon->icon_obj, &x2, NULL, NULL, NULL); > > if(icon->state.selected) > { > _e_fm_selections_del(l->data); > _e_fm_selections_current_set(l->data, l); > } > else > _e_fm_selections_add(l->data, l); > } > if(flag && l) > _e_fm_selections_current_set(l->data, l); > } > evas_object_geometry_get(icon->icon_obj, &x, &y, &w, &h); > if(!E_CONTAINS(sd->x, sd->y, sd->w, sd->h, x, y, w, h)) > { > E_Event_Fm_Reconfigure *ev; > > ev = E_NEW(E_Event_Fm_Reconfigure, 1); > if (ev) > { > ev->object = sd->object; > ev->x = sd->x; > ev->y = sd->child.y - (sd->y - (y - sd->icon_info.y_space)); > ev->w = sd->w; > ev->h = sd->h; > ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL); > } > } > } > } 2713a2920 > 2717,2735c2924,2949 < Evas_List *l; < < if(sd->selection.current.ptr) < { < E_Fm_Icon *icon; < Evas_Coord x, y, x2, y2; < < l = sd->selection.current.ptr; < icon = l->data; < evas_object_geometry_get(icon->icon_obj, &x, &y, NULL, NULL); < x2 = x + 1; < l = l->next; < while(l && x != x2) < { < icon = l->data; < evas_object_geometry_get(icon->icon_obj, &x2, &y2, NULL, NULL); < if (evas_key_modifier_is_set(evas_key_modifier_get(sd->evas), "Control")) < { < if(icon->state.selected) --- > Evas_List *l, *l2; > > if(!sd->selection.current.ptr) > _e_fm_selections_add(sd->files->data, sd->files); > else > { > if(sd->selection.current.ptr->next) /* are we already at the end? */ > { > > E_Fm_Icon *icon; > Evas_Coord x, x2, y, w, h;; > l = sd->selection.current.ptr; > icon = l->data; > evas_object_geometry_get(icon->icon_obj, &x, NULL, NULL, NULL); > x2 = x + 1; > l = l->next; > > if (!evas_key_modifier_is_set(evas_key_modifier_get(sd->evas), "Control")) > { > for(; l && (x != x2); l = l->next) > { > icon = l->data; > evas_object_geometry_get(icon->icon_obj, &x2, NULL, NULL, NULL); > } > _e_fm_selections_clear(sd); > if(!l) 2737,2738c2951,2952 < _e_fm_selections_del(l->data); < _e_fm_selections_current_set(l->data, l); --- > l = evas_list_last(sd->files); > _e_fm_selections_add(l->data, l); 2740,2782c2954,3006 < else < _e_fm_selections_add(l->data, l); < } < l = l->next; < } < if(l && !evas_key_modifier_is_set(evas_key_modifier_get(sd->evas), "Control")) < { < if(l->prev) l = l->prev; < if(!l) return; < _e_fm_selections_clear(sd); < _e_fm_selections_add(l->data, l); < } < else if(!l) < { < if(!evas_key_modifier_is_set(evas_key_modifier_get(sd->evas), "Control")) < _e_fm_selections_clear(sd); < _e_fm_selections_add((evas_list_last(sd->files))->data, evas_list_last(sd->files)); < } < if(l) < { < E_Fm_Icon *icon; < Evas_Coord x, y, w, h; < < icon = l->data; < evas_object_geometry_get(icon->icon_obj, &x, &y, &w, &h); < if(!E_CONTAINS(sd->x, sd->y, sd->w, sd->h, x, y, w, h)) < { < E_Event_Fm_Reconfigure *ev; < ev = E_NEW(E_Event_Fm_Reconfigure, 1); < if (ev) < { < ev->object = sd->object; < ev->x = sd->x; < ev->y = sd->child.y + y + h + sd->icon_info.y_space - (sd->y + sd->h); < ev->w = sd->w; < ev->h = sd->h; < ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL); < } < } < } < } < else < _e_fm_selections_add(sd->files->data, sd->files); --- > else > _e_fm_selections_add(l->prev->data, l->prev); > } > else /* Control modifier set */ > { > int flag = 0; > icon = l->data; > if(flag = icon->state.selected) > { > if(l->prev->prev) > icon = l->prev->prev->data; > else > icon = l->prev->data; // This case > > evas_object_geometry_get(icon->icon_obj, &x, NULL, NULL, NULL); > _e_fm_selections_del(sd->selection.current.ptr->data); > x2 = x + 1; > } > for(; l && (x != x2); l = l->next) > { > icon = l->data; > evas_object_geometry_get(icon->icon_obj, &x2, NULL, NULL, NULL); > > if(icon->state.selected) > { > _e_fm_selections_del(l->data); > _e_fm_selections_current_set(l->data, l); > } > else > _e_fm_selections_add(l->data, l); > } > if(flag && l) > _e_fm_selections_current_set(l->data, l); > > } > evas_object_geometry_get(icon->icon_obj, &x, &y, &w, &h); > if(!E_CONTAINS(sd->x, sd->y, sd->w, sd->h, x, y, w, h)) > { > E_Event_Fm_Reconfigure *ev; > > ev = E_NEW(E_Event_Fm_Reconfigure, 1); > if (ev) > { > ev->object = sd->object; > ev->x = sd->x; > ev->y = sd->child.y - (sd->y - (y - sd->icon_info.y_space)); > ev->w = sd->w; > ev->h = sd->h; > ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL); > } > } > } > } 2787,2792c3011,3016 < { < Evas_List *prev; < < if(sd->selection.current.ptr) < { < if(sd->selection.current.ptr->prev) --- > { > if(!sd->selection.current.ptr) > _e_fm_selections_add(sd->files->data, sd->files); > else > { > if(sd->selection.current.ptr->prev) 2794,2797c3018,3020 < prev = sd->selection.current.ptr->prev; < if (evas_key_modifier_is_set(evas_key_modifier_get(sd->evas), "Control")) < { < E_Fm_Icon *icon; --- > Evas_List *prev; > E_Fm_Icon *icon, *icon_prev; > Evas_Coord x, y, w, h; 2799,2800c3022,3028 < icon = prev->data; < if(icon->state.selected) --- > icon = sd->selection.current.ptr->data; > prev = sd->selection.current.ptr->prev; > icon_prev = prev->data; > > if (evas_key_modifier_is_set(evas_key_modifier_get(sd->evas), "Control")) > { > if(icon_prev->state.selected) 2802,2803c3030,3039 < _e_fm_selections_del(prev->data); < _e_fm_selections_current_set(prev->data, prev); --- > if(icon->state.selected) > { > _e_fm_selections_del(icon); > _e_fm_selections_current_set(icon_prev, prev); > } > else > { > _e_fm_selections_del(icon_prev); > _e_fm_selections_current_set(icon_prev, prev); > } 2805,2817c3041,3050 < else < _e_fm_selections_add(prev->data, prev); < } < else < { < _e_fm_selections_clear(sd); < _e_fm_selections_add(prev->data, prev); < } < { < E_Fm_Icon *icon; < Evas_Coord x, y, w, h; < icon = prev->data; < evas_object_geometry_get(icon->icon_obj, &x, &y, &w, &h); --- > else > _e_fm_selections_add(icon_prev, prev); > } > else > { > _e_fm_selections_clear(sd); > _e_fm_selections_add(icon_prev, prev); > } > > evas_object_geometry_get(icon_prev->icon_obj, &x, &y, &w, &h); 2819,2824c3052,3056 < { < E_Event_Fm_Reconfigure *ev; < < ev = E_NEW(E_Event_Fm_Reconfigure, 1); < if (ev) < { --- > { > E_Event_Fm_Reconfigure *ev; > ev = E_NEW(E_Event_Fm_Reconfigure, 1); > if (ev) > { 2831,2833c3063,3064 < } < } < } --- > } > } 2835,2837c3066 < } < else < _e_fm_selections_add(sd->files->data, sd->files); --- > } 2843,2847c3072,3076 < Evas_List *next; < < if (sd->selection.current.ptr) < { < if (sd->selection.current.ptr->next) --- > if(!sd->selection.current.ptr) > _e_fm_selections_add(sd->files->data, sd->files); > else > { > if (sd->selection.current.ptr->next) 2849,2855c3078,3089 < next = sd->selection.current.ptr->next; < if (evas_key_modifier_is_set(evas_key_modifier_get(sd->evas), "Control")) < { < E_Fm_Icon *icon; < < icon = next->data; < if (icon->state.selected) --- > Evas_List *next; > E_Fm_Icon *icon, *icon_next; > Evas_Coord x, y, w, h; > > icon = sd->selection.current.ptr->data; > > next = sd->selection.current.ptr->next; > icon_next = next->data; > > if (evas_key_modifier_is_set(evas_key_modifier_get(sd->evas), "Control")) > { > if (icon_next->state.selected) 2857,2872c3091,3111 < _e_fm_selections_del(next->data); < _e_fm_selections_current_set(next->data, next); < } < else < _e_fm_selections_add(next->data, next); < } < else < { < _e_fm_selections_clear(sd); < _e_fm_selections_add(next->data, next); < } < { < E_Fm_Icon *icon; < Evas_Coord x, y, w, h; < icon = next->data; < evas_object_geometry_get(icon->icon_obj, &x, &y, &w, &h); --- > if(icon->state.selected) > { > _e_fm_selections_del(icon); > _e_fm_selections_current_set(icon_next, next); > } > else > { > _e_fm_selections_del(icon_next); > _e_fm_selections_current_set(icon_next, next); > } > } > else > _e_fm_selections_add(icon_next, next); > } > else > { > _e_fm_selections_clear(sd); > _e_fm_selections_add(icon_next, next); > } > > evas_object_geometry_get(icon_next->icon_obj, &x, &y, &w, &h); 2874,2875c3113,3114 < { < E_Event_Fm_Reconfigure *ev; --- > { > E_Event_Fm_Reconfigure *ev; 2877,2879c3116,3118 < ev = E_NEW(E_Event_Fm_Reconfigure, 1); < if (ev) < { --- > ev = E_NEW(E_Event_Fm_Reconfigure, 1); > if (ev) > { 2886,2888c3125,3126 < } < } < } --- > } > } 2890,2892c3128 < } < else < _e_fm_selections_add(sd->files->data, sd->files); --- > } 2894a3131,3132 > > 2941,2944c3179,3182 < Evas_Event_Key_Down *ev; < E_Fm_Smart_Data *sd; < Evas_List *l; < E_Fm_Icon *icon; --- > Evas_Event_Key_Down *ev; > E_Fm_Smart_Data *sd; > Evas_List *l; > E_Fm_Icon *icon; 2946,3052c3184,3189 < ev = event_info; < sd = data; < < if (!strcmp(ev->keyname, "Tab")) < { < if(strcmp(edje_object_part_state_get(sd->edje_obj, "typebuffer", NULL), "shown")) < { < < _e_fm_autocomplete(sd); < } < } < if (!strcmp(ev->keyname, "Up")) < { < if(!strcmp(edje_object_part_state_get(sd->edje_obj, "typebuffer", NULL), "shown")) < { < edje_object_signal_emit(sd->edje_obj, "typebuf_hide", ""); < edje_object_part_text_set(sd->edje_obj, "text", ""); < for (l = sd->files; l; l = l->next) < { < icon = l->data; < e_fm_icon_signal_emit(icon->icon_obj, "default", ""); < } < edje_object_signal_emit(sd->edje_obj, "default", ""); < } < else < _e_fm_icon_select_up(sd); < } < else if (!strcmp(ev->keyname, "Down")) < { < if(!strcmp(edje_object_part_state_get(sd->edje_obj, "typebuffer", NULL), "shown")) < { < edje_object_signal_emit(sd->edje_obj, "typebuf_hide", ""); < edje_object_part_text_set(sd->edje_obj, "text", ""); < for (l = sd->files; l; l = l->next) < { < icon = l->data; < e_fm_icon_signal_emit(icon->icon_obj, "default", ""); < } < edje_object_signal_emit(sd->edje_obj, "default", ""); < } < else < _e_fm_icon_select_down(sd); < } < else if (!strcmp(ev->keyname, "Left")) < { < if(!strcmp(edje_object_part_state_get(sd->edje_obj, "typebuffer", NULL), "shown")) < {} < else < _e_fm_icon_select_left(sd); < } < else if (!strcmp(ev->keyname, "Right")) < { < if(!strcmp(edje_object_part_state_get(sd->edje_obj, "typebuffer", NULL), "shown")) < {} < else < _e_fm_icon_select_right(sd); < } < else if (!strcmp(ev->keyname, "Escape")) < { < if(!strcmp(edje_object_part_state_get(sd->edje_obj, "typebuffer", NULL), "shown")) < { < edje_object_signal_emit(sd->edje_obj, "typebuf_hide", ""); < edje_object_part_text_set(sd->edje_obj, "text", ""); < for (l = sd->files; l; l = l->next) < { < icon = l->data; < e_fm_icon_signal_emit(icon->icon_obj, "default", ""); < } < edje_object_signal_emit(sd->edje_obj, "default", ""); < } < } < else if (!strcmp(ev->keyname, "Return")) < { < if(!strcmp(edje_object_part_state_get(sd->edje_obj, "typebuffer", NULL), "shown")) < { < edje_object_signal_emit(sd->edje_obj, "typebuf_hide", ""); < edje_object_part_text_set(sd->edje_obj, "text", ""); < for (l = sd->files; l; l = l->next) < { < icon = l->data; < e_fm_icon_signal_emit(icon->icon_obj, "default", ""); < } < edje_object_signal_emit(sd->edje_obj, "default", ""); < } < else < _e_fm_icon_run(sd); < } < else if (!strcmp(ev->keyname, "BackSpace")) < { < if(!strcmp(edje_object_part_state_get(sd->edje_obj, "typebuffer", NULL), "shown")) < { < char *str; < str = NULL; < str = edje_object_part_text_get(sd->edje_obj, "text"); < if(str) < { < char *buf; < int size; < size = strlen(str); < buf = calloc(size , sizeof(char)); < snprintf(buf, size, "%s", str); < edje_object_part_text_set(sd->edje_obj, "text", buf); < _e_fm_icon_select_glob(sd, buf); < E_FREE(buf); < } < } < else --- > ev = event_info; > sd = data; > const char *name; > if(sd->state == E_FILEMAN_STATE_RENAME) > { > if (!strcmp(ev->keyname, "Return")) 3054,3082c3191,3201 < char *fullname; < < fullname = _e_fm_dir_pop(sd->dir); < if (fullname) < { < if (sd->win) < e_win_title_set(sd->win, fullname); < _e_fm_dir_set(sd, fullname); < free(fullname); < } < } < } < else if (ev->string) < { < char *str; < str = NULL; < str = edje_object_part_text_get(sd->edje_obj, "text"); < if(str) < { < char *buf; < int size; < size = strlen(str) + strlen(ev->string) + 2; < buf = calloc(size, sizeof(char)); < snprintf(buf, size, "%s%s", str, ev->string); < edje_object_part_text_set(sd->edje_obj, "text", buf); < _e_fm_icon_select_glob(sd, buf); < E_FREE(buf); < } < else --- > if(!sd->selection.current.file) return;///??? > icon = sd->selection.current.file; > name = e_entry_text_get(icon->sd->entry_obj); > // name = e_entry_text_get(icon->sd->entry_obj); > // e_fm_icon_edit_entry_set(icon->icon_obj, NULL); > // evas_object_focus_set(icon->sd->entry_obj, 0); > // evas_object_del(icon->sd->entry_obj); > // icon->sd->entry_obj = NULL; > _e_fm_file_rename(icon, name); > } > else if (!strcmp(ev->keyname, "Escape")) 3084,3090c3203,3336 < edje_object_part_text_set(sd->edje_obj, "text", ev->string); < _e_fm_icon_select_glob(sd, ev->string); < } < < if(strcmp(edje_object_part_state_get(sd->edje_obj, "typebuffer", NULL), "shown")) < edje_object_signal_emit(sd->edje_obj, "typebuf_show", ""); < } --- > if(!sd->selection.current.file) return;///??? > icon = sd->selection.current.file; > _e_fm_file_rename_abort(icon); > } > } > else > { > if(!strcmp(edje_object_part_state_get(sd->edje_obj, "typebuffer", NULL), "shown")) > { > if (!strcmp(ev->keyname, "Tab")) > { > _e_fm_autocomplete(sd); > } > else if (!strcmp(ev->keyname, "BackSpace")) > { > char *str; > str = NULL; > str = edje_object_part_text_get(sd->edje_obj, "text"); > if(str) > { > char *buf; > int size; > size = strlen(str); > buf = calloc(size , sizeof(char)); > snprintf(buf, size, "%s", str); > edje_object_part_text_set(sd->edje_obj, "text", buf); > _e_fm_icon_select_glob(sd, buf); > E_FREE(buf); > } > } > else if (!strcmp(ev->keyname, "Up") > || !strcmp(ev->keyname, "Down") > || !strcmp(ev->keyname, "Escape") > || !strcmp(ev->keyname, "Return")) > { > > edje_object_signal_emit(sd->edje_obj, "typebuf_hide", ""); > edje_object_part_text_set(sd->edje_obj, "text", ""); > for (l = sd->files; l; l = l->next) > { > icon = l->data; > e_fm_icon_signal_emit(icon->icon_obj, "default", ""); > } > edje_object_signal_emit(sd->edje_obj, "default", ""); > } > else if (ev->string) > { > char *str; > str = NULL; > str = edje_object_part_text_get(sd->edje_obj, "text"); > if(str) > { > char *buf; > int size; > size = strlen(str) + strlen(ev->string) + 2; > buf = calloc(size, sizeof(char)); > snprintf(buf, size, "%s%s", str, ev->string); > edje_object_part_text_set(sd->edje_obj, "text", buf); > _e_fm_icon_select_glob(sd, buf); > E_FREE(buf); > } > else > { > edje_object_part_text_set(sd->edje_obj, "text", ev->string); > _e_fm_icon_select_glob(sd, ev->string); > } > } > } > else if (!strcmp(ev->keyname, "Up")) > { > _e_fm_icon_select_up(sd); > } > else if (!strcmp(ev->keyname, "Down")) > { > _e_fm_icon_select_down(sd); > } > else if (!strcmp(ev->keyname, "Left")) > { > _e_fm_icon_select_left(sd); > } > else if (!strcmp(ev->keyname, "Right")) > { > _e_fm_icon_select_right(sd); > } > else if (!strcmp(ev->keyname, "F2")) > { > icon = sd->selection.current.file; > _e_fm_file_rename_start(icon); > } > else if (!strcmp(ev->keyname, "Escape")) > { > > } > else if (!strcmp(ev->keyname, "Return")) > { > _e_fm_icon_run(sd); > } > else if (!strcmp(ev->keyname, "BackSpace")) > { > char *fullname; > > fullname = _e_fm_dir_pop(sd->dir); > if (fullname) > { > if (sd->win) > e_win_title_set(sd->win, fullname); > _e_fm_dir_set(sd, fullname); > free(fullname); > } > } > else if (ev->string) > { > char *str; > str = NULL; > str = edje_object_part_text_get(sd->edje_obj, "text"); > if(str) > { > char *buf; > int size; > size = strlen(str) + strlen(ev->string) + 2; > buf = calloc(size, sizeof(char)); > snprintf(buf, size, "%s%s", str, ev->string); > edje_object_part_text_set(sd->edje_obj, "text", buf); > _e_fm_icon_select_glob(sd, buf); > E_FREE(buf); > } > else > { > edje_object_part_text_set(sd->edje_obj, "text", ev->string); > _e_fm_icon_select_glob(sd, ev->string); > } > if(sd->state == E_FILEMAN_STATE_IDLE) edje_object_signal_emit(sd->edje_obj, "typebuf_show", ""); > } > } Index: e_fileman_smart.h =================================================================== RCS file: /root/e17/apps/e/src/bin/e_fileman_smart.h,v retrieving revision 1.1.1.4 diff -r1.1.1.4 e_fileman_smart.h 7a8 > typedef struct _E_Fm_Assoc_App E_Fm_Assoc_App; 24a26,31 > struct _E_Fm_Assoc_App > { > char *mime; > char *app; > }; >