rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=3d608317f1e20bd39141ec50bfb3e16c42036c47
commit 3d608317f1e20bd39141ec50bfb3e16c42036c47 Author: Andrii Kroitor <an.kroi...@samsung.com> Date: Thu Apr 21 15:19:16 2016 +0300 popup: remember last fileselector folder --- src/bin/eflete.c | 5 +++++ src/bin/eflete.h | 1 + src/bin/ui/popup.c | 7 ++++++- src/bin/ui/tab_home_import_edc.c | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/bin/eflete.c b/src/bin/eflete.c index 9dff2b6..4aa870f 100644 --- a/src/bin/eflete.c +++ b/src/bin/eflete.c @@ -103,12 +103,17 @@ app_init() elm_need_ethumb(); + ap.last_path = NULL; + return true; } Eina_Bool app_shutdown() { + if (ap.last_path) + eina_stringshare_del(ap.last_path); + config_shutdown(); elm_theme_free(ap.theme); eina_shutdown(); diff --git a/src/bin/eflete.h b/src/bin/eflete.h index e20e6a6..7f3210c 100644 --- a/src/bin/eflete.h +++ b/src/bin/eflete.h @@ -90,6 +90,7 @@ struct _App_Data Menu *menu; TODO("Burn popup variable"); Evas_Object *popup; + Eina_Stringshare *last_path; Evas_Object *splash; Evas_Object *statusbar; /**< The statusbar object, which contain some items */ struct { diff --git a/src/bin/ui/popup.c b/src/bin/ui/popup.c index c0771fe..9cadc86 100644 --- a/src/bin/ui/popup.c +++ b/src/bin/ui/popup.c @@ -293,6 +293,10 @@ _done(void *data __UNUSED__, Eina_Stringshare *selected; Eina_Bool res = false; + if (ap.last_path) + eina_stringshare_del(ap.last_path); + ap.last_path = eina_stringshare_add(elm_fileselector_path_get(fs)); + if (!event_info) res = true; if (!res && dismiss_func) { @@ -353,7 +357,8 @@ _fileselector_helper(const char *title, } else elm_fileselector_folder_only_set(fs, true); - elm_fileselector_path_set(fs, path ? path : profile_get()->general.projects_folder); + elm_fileselector_path_set(fs, (path && (strcmp(path, ""))) ? path : + (ap.last_path) ? ap.last_path : profile_get()->general.projects_folder); evas_object_smart_callback_add(fs, "done", _done, follow_up); evas_object_smart_callback_add(fs, "activated", _done, follow_up); evas_object_size_hint_min_set(helper, FS_W, FS_H); diff --git a/src/bin/ui/tab_home_import_edc.c b/src/bin/ui/tab_home_import_edc.c index c3123dd..9105498 100644 --- a/src/bin/ui/tab_home_import_edc.c +++ b/src/bin/ui/tab_home_import_edc.c @@ -111,7 +111,7 @@ _elipsis(void *data, { popup_fileselector_folder_helper(NULL, (Evas_Object *)data, - elm_entry_entry_get(tab_edc.path), + elm_entry_entry_get(data), entry_path_set, (Evas_Object *)data, false, --