rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=1b8ea8bbedb84e77cbb32ede41259691e9a19d81

commit 1b8ea8bbedb84e77cbb32ede41259691e9a19d81
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Tue Jan 5 10:11:06 2016 +0200

    project_export: implement UI side for export group source code
    
    Change-Id: I0e3eee11536e4c33c42cadd362068daaeead67e6
---
 src/bin/ui/menu.c           |  6 ++---
 src/bin/ui/project_export.c | 60 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+), 4 deletions(-)

diff --git a/src/bin/ui/menu.c b/src/bin/ui/menu.c
index c236cb1..a0a04b0 100644
--- a/src/bin/ui/menu.c
+++ b/src/bin/ui/menu.c
@@ -53,7 +53,7 @@ int MENU_ITEMS_LIST_BASE[] = {
 
 int MENU_ITEMS_LIST_STYLE_ONLY[] = {
    MENU_VIEW_WORKSPACE,
-   /* MENU_FILE_EXPORT_EDC_GROUP, */
+   MENU_FILE_EXPORT_EDC_GROUP,
 
    MENU_NULL
 };
@@ -107,8 +107,7 @@ _menu_cb(void *data __UNUSED__,
          project_save();
          break;
       case MENU_FILE_EXPORT_EDC_GROUP:
-         TODO("Implement me")
-         /* project_export_edc_group(); */
+         project_export_edc_group();
          break;
       case MENU_FILE_EXPORT_EDC_PROJECT:
          project_export_edc_project();
@@ -290,7 +289,6 @@ ui_menu_add(void)
 
    TODO("remove lines after implementation this features")
    ui_menu_disable_set(menu, MENU_FILE_EXPORT_RELEASE, true);
-   ui_menu_disable_set(menu, MENU_FILE_EXPORT_EDC_GROUP, true);
    ui_menu_disable_set(menu, MENU_VIEW_WORKSPACE_ZOOM_IN, true);
    ui_menu_disable_set(menu, MENU_VIEW_WORKSPACE_ZOOM_OUT, true);
    ui_menu_disable_set(menu, MENU_VIEW_WORKSPACE_OBJECT_AREA, true);
diff --git a/src/bin/ui/project_export.c b/src/bin/ui/project_export.c
index 0a5aa8f..5a92985 100644
--- a/src/bin/ui/project_export.c
+++ b/src/bin/ui/project_export.c
@@ -18,6 +18,7 @@
  */
 
 #include "main_window.h"
+#include "tabs.h"
 #include "project_manager.h"
 #include "project_common.h"
 
@@ -127,3 +128,62 @@ project_export_edc_project(void)
 {
    popup_fileselector_folder_helper("Export source code", NULL, NULL, 
_export_source_code, NULL, false, false);
 }
+
+static Eina_Bool
+_export_group_source_code_setup(void *data, Splash_Status status __UNUSED__)
+{
+   Eina_Stringshare *path = (Eina_Stringshare *)data;
+
+   assert(path != NULL);
+
+   pm_group_source_code_export(ap.project,
+                               tabs_current_group_get(),
+                               path,
+                               progress_print,
+                               progress_end,
+                               NULL);
+   return true;
+}
+
+static Eina_Bool
+_export_group_source_code(void *data __UNUSED__,
+                          Evas_Object *obj __UNUSED__, /* this is fileselector 
from popup */
+                          void *event_info)
+{
+   Eina_List *selected = (Eina_List *)event_info;
+   Eina_Stringshare *path;
+   Eina_Strbuf *buf;
+   char *name;
+   Group *group;
+
+   assert(selected != NULL);
+
+   group = tabs_current_group_get();
+   name = strdup(group->name);
+   string_char_replace(name, '/', '_');
+
+   path = eina_stringshare_add((const char *)eina_list_data_get(selected));
+   buf = eina_strbuf_new();
+   eina_strbuf_append_printf(buf,
+                             _("<font_size=16>A project file '%s/%s' already 
exist."
+                               "Do you want to replace it?</font_size>"),
+                             path, name);
+   if (!exist_permission_check(path, name,
+                               _("Export group source code"),
+                               eina_strbuf_string_get(buf)))
+     return false;
+   eina_strbuf_free(buf);
+   free(name);
+
+   ap.splash = splash_add(ap.win, _export_group_source_code_setup, 
_export_teardown, NULL, (void *)path);
+   evas_object_focus_set(ap.splash, true);
+   evas_object_show(ap.splash);
+
+   return true;
+}
+
+void
+project_export_edc_group(void)
+{
+   popup_fileselector_folder_helper("Export group source code", NULL, NULL, 
_export_group_source_code, NULL, false, false);
+}

-- 


Reply via email to