rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=6ebb44ff97261d55413e1e2eed2763dbc2448c76

commit 6ebb44ff97261d55413e1e2eed2763dbc2448c76
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Tue Oct 13 12:23:47 2015 +0300

    project_export: remake the export as develop file
    
    Move from connector to separatly module.
    
    Change-Id: Ia0dab8e1f243d091355e8f13c573e57016503117
---
 src/bin/Makefile.am         |  3 +-
 src/bin/ui/connector.c      |  6 +++-
 src/bin/ui/project_common.c |  2 +-
 src/bin/ui/project_export.c | 77 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 85 insertions(+), 3 deletions(-)

diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index b3d7e8c..d22125c 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -31,8 +31,9 @@ libete_a_SOURCES = \
 ../../src/bin/ui/menu.c \
 ../../src/bin/ui/main_window.c \
 ../../src/bin/ui/popup.c \
-../../src/bin/ui/project_close.c \
 ../../src/bin/ui/project_common.c \
+../../src/bin/ui/project_close.c \
+../../src/bin/ui/project_export.c \
 ../../src/bin/ui/connector.c \
 ../../src/bin/ui/splash.c \
 ../../src/bin/ui/shortcuts/shortcuts.c \
diff --git a/src/bin/ui/connector.c b/src/bin/ui/connector.c
index e84b939..234d2e2 100644
--- a/src/bin/ui/connector.c
+++ b/src/bin/ui/connector.c
@@ -531,6 +531,7 @@ _progress_print(void *data __UNUSED__, Eina_Stringshare 
*progress_string)
    return true;
 }
 
+/*
 static void
 _progress_end(void *data __UNUSED__, PM_Project_Result result)
 {
@@ -573,11 +574,12 @@ _progress_end(void *data __UNUSED__, PM_Project_Result 
result)
         enventor_object_focus_set(ap.enventor, true);
         //pm_save_to_dev(ap.project, ap.project->current_style, true);
      }
-#endif /* HAVE_ENVENTOR */
+#endif
 
    splash_del(ap.splash);
    ap.splash = NULL;
 }
+*/
 
 TODO("I think, this functionality need move to dialogs")
 static void
@@ -655,6 +657,7 @@ export_warning(Evas_Object *parent, const char *title, 
const char *msg)
    return result;
 }
 
+/*
 static Eina_Bool
 _export_splash_setup(void *data, Splash_Status status __UNUSED__)
 {
@@ -753,6 +756,7 @@ project_export_develop(void)
    elm_win_inwin_content_set(win, fs);
    ui_menu_items_list_disable_set(ap.menu, MENU_ITEMS_LIST_MAIN, true);
 }
+*/
 
 static void
 _on_export_edc_group_done(void *data,
diff --git a/src/bin/ui/project_common.c b/src/bin/ui/project_common.c
index 2540b9c..abdbd5e 100644
--- a/src/bin/ui/project_common.c
+++ b/src/bin/ui/project_common.c
@@ -34,7 +34,7 @@ exist_permission_check(const char *path, const char *name,
     * So need to check there is the folder "path/name" */
    buf = eina_strbuf_new();
    eina_strbuf_append_printf(buf, "%s/%s", path, name);
-   if (!ecore_file_exists(eina_strbuf_string_get(buf))) return false;
+   if (!ecore_file_exists(eina_strbuf_string_get(buf))) return true;
    btn_res = popup_want_action(title, msg, NULL,
                                NULL, BTN_REPLACE | BTN_CANCEL, NULL, NULL);
    if (btn_res == BTN_CANCEL) return false;
diff --git a/src/bin/ui/project_export.c b/src/bin/ui/project_export.c
new file mode 100644
index 0000000..b24971c
--- /dev/null
+++ b/src/bin/ui/project_export.c
@@ -0,0 +1,77 @@
+/*
+ * Edje Theme Editor
+ * Copyright (C) 2013-2015 Samsung Electronics.
+ *
+ * This file is part of Edje Theme Editor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; If not, see www.gnu.org/licenses/lgpl.html.
+ */
+
+#include "main_window.h"
+#include "project_common.h"
+
+static Eina_Bool
+_export_teardown(void *data, Splash_Status status __UNUSED__)
+{
+   eina_stringshare_del(data);
+   ui_menu_items_list_disable_set(ap.menu, MENU_ITEMS_LIST_MAIN, false);
+   return true;
+}
+
+static Eina_Bool
+_export_develop_setup(void *data, Splash_Status status __UNUSED__)
+{
+   const char *path  = (const char *)data;
+
+   assert(path != NULL);
+
+   pm_project_develop_export(ap.project, path, progress_print, progress_end, 
NULL);
+   return true;
+}
+
+Eina_Bool
+_export_dev(void *data __UNUSED__,
+            Evas_Object *obj, /* this is fileselector from popup */
+            void *event_info)
+{
+   Eina_List *selected = (Eina_List *)event_info;
+   Eina_Strbuf *buf;
+
+   assert(selected != NULL);
+
+   buf = eina_strbuf_new();
+   eina_strbuf_append_printf(buf,
+                             _("<font_size=16>A project file '%s' already 
exist."
+                               "Do you want to replace it?</font_size>"),
+                             (const char *)eina_list_data_get(selected));
+   if (!exist_permission_check(elm_fileselector_path_get(obj),
+                               elm_fileselector_current_name_get(obj),
+                               _("Export to develop edj-file"),
+                               eina_strbuf_string_get(buf)))
+     return false;
+   eina_strbuf_free(buf);
+
+   ap.splash = splash_add(ap.win, _export_develop_setup, _export_teardown,
+                           NULL, (void 
*)eina_stringshare_add(eina_list_data_get(selected)));
+   evas_object_focus_set(ap.splash, true);
+   evas_object_show(ap.splash);
+
+   return true;
+}
+
+void
+project_export_develop(void)
+{
+   ui_menu_items_list_disable_set(ap.menu, MENU_ITEMS_LIST_MAIN, true);
+   popup_fileselector_edj_helper("Export to develop edj-file", NULL, NULL, 
_export_dev, NULL, false, true);
+}

-- 


Reply via email to