seoz pushed a commit to branch master.

http://git.enlightenment.org/tools/elm-theme-viewer.git/commit/?id=fe1e46f8bb2c2587a7b64df1c2fb8e379ad5894d

commit fe1e46f8bb2c2587a7b64df1c2fb8e379ad5894d
Author: Daniel Juyung Seo <[email protected]>
Date:   Fri Feb 28 02:31:47 2014 +0900

    gui: added dummy fileselector for open menu.
---
 src/bin/gui.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/src/bin/gui.c b/src/bin/gui.c
index fa978b2..1d8bbb1 100644
--- a/src/bin/gui.c
+++ b/src/bin/gui.c
@@ -223,6 +223,52 @@ gui_panes_clicked_double_cb(void *data EINA_UNUSED, 
Evas_Object *obj,
    INF("size y %f %d", size, contracted);
 }
 
+/**
+  * GUI Open File
+  */
+static void
+_gui_open_file_done_cb(void *data, Evas_Object *obj EINA_UNUSED,
+                       void *event_info)
+{
+   const char *file = event_info;
+
+   if (file)
+     {
+
+     }
+
+   evas_object_del(data);
+}
+
+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, ".edj"))
+     return EINA_TRUE;
+   return EINA_FALSE;
+}
+
+static void
+_gui_open_file(void)
+{
+   Evas_Object *popup = NULL, *table = NULL, *fs = NULL;
+
+   popup = elm_popup_add(gd->win);
+   elm_object_part_text_set(popup, "title,text", "Open Theme File");
+   evas_object_show(popup);
+
+   fs = elm_fileselector_add(popup);
+   elm_fileselector_path_set(fs, getenv("HOME"));
+   elm_fileselector_custom_filter_append(fs, _edje_filter, NULL, "Theme 
Files");
+   elm_fileselector_is_save_set(fs, EINA_FALSE);
+   evas_object_smart_callback_add(fs, "done", _gui_open_file_done_cb, popup);
+   evas_object_show(fs);
+
+   table = util_elm_min_set(fs, 300, 400);
+   elm_object_content_set(popup, table);
+}
+
 static void
 _toolbar_open_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
                    void *event_info)
@@ -231,6 +277,7 @@ _toolbar_open_cb(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED,
    if (!it) return;
 
    elm_toolbar_item_selected_set(it, EINA_FALSE);
+   _gui_open_file();
 }
 
 static void

-- 


Reply via email to