jaehwan pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=8e03989d2c511691ce2ec961b7dc21fe507f1a62

commit 8e03989d2c511691ce2ec961b7dc21fe507f1a62
Author: Jaehwan Kim <[email protected]>
Date:   Wed Jul 27 15:41:19 2016 +0900

    main: Add export-edj option in command line support
---
 src/bin/eflete.h            |  1 +
 src/bin/main.c              |  4 ++++
 src/bin/ui/menu.c           |  4 ++++
 src/bin/ui/project_export.c | 13 +++++++++++--
 4 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/src/bin/eflete.h b/src/bin/eflete.h
index 5516daf..ced6d0f 100644
--- a/src/bin/eflete.h
+++ b/src/bin/eflete.h
@@ -128,6 +128,7 @@ struct _App_Data
       Eina_Stringshare *layout_edj;
       Eina_Stringshare *edj_path;
       Eina_Stringshare *image_path;
+      Eina_Stringshare *export_edj;
    } path;
    Project *project;
    Shortcut_Module *shortcuts; /**< Structure with data from shortcuts module 
*/
diff --git a/src/bin/main.c b/src/bin/main.c
index b5942f9..fac4a4f 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -31,6 +31,7 @@
 static char *file = NULL;
 static char *pro_name = NULL;
 static char *pro_path = NULL;
+static char *export_edj = NULL;
 static Eina_List *img_dirs = NULL;
 static Eina_List *snd_dirs = NULL;
 static Eina_List *fnt_dirs = NULL;
@@ -61,6 +62,7 @@ static const Ecore_Getopt options = {
    {
       ECORE_GETOPT_STORE_STR(0, "name", N_("Name for new project")),
       ECORE_GETOPT_STORE_STR(0, "path", N_("Path to project directory")),
+      ECORE_GETOPT_STORE_STR(0, "export-edj", N_("Export file path")),
       ECORE_GETOPT_APPEND_METAVAR('i', "id", "Add image directory for edc 
compilation", "DIR_NAME", ECORE_GETOPT_TYPE_STR),
       ECORE_GETOPT_APPEND_METAVAR('s', "sd", "Add sound directory for edc 
compilation", "DIR_NAME", ECORE_GETOPT_TYPE_STR),
       ECORE_GETOPT_APPEND_METAVAR('f', "fd", "Add font directory for edc 
compilation", "DIR_NAME", ECORE_GETOPT_TYPE_STR),
@@ -181,6 +183,7 @@ elm_main(int argc, char **argv)
    Ecore_Getopt_Value values[] = {
      ECORE_GETOPT_VALUE_STR(pro_name),
      ECORE_GETOPT_VALUE_STR(pro_path),
+     ECORE_GETOPT_VALUE_STR(export_edj),
      ECORE_GETOPT_VALUE_LIST(img_dirs),
      ECORE_GETOPT_VALUE_LIST(snd_dirs),
      ECORE_GETOPT_VALUE_LIST(fnt_dirs),
@@ -321,6 +324,7 @@ elm_main(int argc, char **argv)
           }
 
 run:
+        ap.path.export_edj = export_edj;
         if (!ui_main_window_add())
           {
              app_shutdown();
diff --git a/src/bin/ui/menu.c b/src/bin/ui/menu.c
index 8eeb0f7..9bc340b 100644
--- a/src/bin/ui/menu.c
+++ b/src/bin/ui/menu.c
@@ -109,6 +109,10 @@ _menu_cb(void *data __UNUSED__,
          break;
       case MENU_FILE_SAVE:
          project_save();
+#if HAVE_TIZEN
+         if (ap.path.export_edj)
+           project_export_develop();
+#endif
          break;
       case MENU_FILE_EXPORT_EDC_GROUP:
          project_export_edc_group();
diff --git a/src/bin/ui/project_export.c b/src/bin/ui/project_export.c
index 8d57cf6..08baa03 100644
--- a/src/bin/ui/project_export.c
+++ b/src/bin/ui/project_export.c
@@ -65,7 +65,7 @@ _export_dev(void *data __UNUSED__,
    eina_strbuf_append_printf(buf,
                              _("<font_size=16>A project file '%s' already 
exist."
                                "Do you want to replace it?</font_size>"), 
path);
-   if (!exist_permission_check(elm_fileselector_path_get(obj),
+   if (obj && !exist_permission_check(elm_fileselector_path_get(obj),
                                elm_fileselector_current_name_get(obj),
                                _("Export to develop edj-file"),
                                eina_strbuf_string_get(buf), EINA_TRUE))
@@ -85,7 +85,16 @@ project_export_develop(void)
 {
    Eina_Strbuf *buf;
 
-   popup_fileselector_edj_helper("Export to develop edj-file", NULL, NULL, 
_export_dev, NULL, false, true);
+   if (!ap.path.export_edj)
+     popup_fileselector_edj_helper("Export to develop edj-file", NULL, NULL, 
_export_dev, NULL, false, true);
+   else
+     {
+        Eina_List *l;
+        l = eina_list_append(l, ap.path.export_edj);
+        _export_dev(NULL, NULL, l);
+               eina_list_free(l);
+     }
+
    buf = eina_strbuf_new();
    eina_strbuf_append_printf(buf, "%s-develop.edj", ap.project->name);
    popup_fileselector_file_set(eina_strbuf_string_get(buf));

-- 


Reply via email to