From 9a284a178375c26c64f6643519baec3bc57a9fa3 Mon Sep 17 00:00:00 2001 From: Daniel Juyung Seo Date: Mon, 30 Dec 2013 00:21:55 +0900 Subject: [PATCH] test_fileselector: Added edje custom filter example to show the real use case of fileselector custom filter. This feature is really good. Thanks Ryuan! --- src/bin/test_fileselector.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/bin/test_fileselector.c b/src/bin/test_fileselector.c index aeae9b2..3af3089 100644 --- a/src/bin/test_fileselector.c +++ b/src/bin/test_fileselector.c @@ -482,6 +482,18 @@ _all_filter(const char *path EINA_UNUSED, return EINA_TRUE; } +static Eina_Bool +_edje_filter(const char *path, Eina_Bool dir, + void *data EINA_UNUSED) +{ + if (dir) return EINA_TRUE; + + if (eina_str_has_extension(path, ".edc") || + eina_str_has_extension(path, ".edj")) + return EINA_TRUE; + return EINA_FALSE; +} + void test_fileselector(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, @@ -523,6 +535,7 @@ test_fileselector(void *data EINA_UNUSED, elm_fileselector_mime_types_filter_append(fs, "text/*", "Text Files"); elm_fileselector_mime_types_filter_append(fs, "image/*", "Image Files"); elm_fileselector_custom_filter_append(fs, _all_filter, NULL, "All Files"); + elm_fileselector_custom_filter_append(fs, _edje_filter, NULL, "Edje Files"); evas_object_smart_callback_add(fs, "done", my_fileselector_done, win); evas_object_smart_callback_add(fs, "selected", my_fileselector_selected, -- 2.7.4