rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=5f0307a7fef02aae0aa3eeb436ba211bfbfa095f

commit 5f0307a7fef02aae0aa3eeb436ba211bfbfa095f
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Mon Oct 12 14:59:35 2015 +0300

    project_common: move process_print/end to common
    
    Change-Id: I70034a0eab5b431b53d7f1b031ce91aaca01637d
---
 src/bin/ui/project_common.c      | 43 ++++++++++++++++++++++
 src/bin/ui/project_common.h      | 12 +++++--
 src/bin/ui/tab_home_common.c     | 78 ++++++++++++----------------------------
 src/bin/ui/tab_home_import_edc.c |  2 +-
 src/bin/ui/tab_home_import_edj.c |  2 +-
 src/bin/ui/tab_home_new.c        |  2 +-
 src/bin/ui/tab_home_open.c       |  2 +-
 src/bin/ui/tabs_private.h        |  9 ++---
 8 files changed, 82 insertions(+), 68 deletions(-)

diff --git a/src/bin/ui/project_common.c b/src/bin/ui/project_common.c
index 360f238..9b6ad15 100644
--- a/src/bin/ui/project_common.c
+++ b/src/bin/ui/project_common.c
@@ -48,3 +48,46 @@ exist_permission_check(const char *path, const char *name,
    ecore_file_recursive_rm(eina_strbuf_string_get(buf));
    eina_strbuf_free(buf);
 }
+
+Eina_Bool
+progress_print(void *data __UNUSED__, Eina_Stringshare *progress_string)
+{
+   elm_object_part_text_set(ap.splash, "label.info", progress_string);
+   return true;
+}
+
+void
+progress_end(void *data __UNUSED__, PM_Project_Result result)
+{
+   switch (result)
+     {
+      case PM_PROJECT_ERROR:
+        {
+           NOTIFY_INFO(3, _("Can't open project."));
+           break;
+        }
+      case PM_PROJECT_CANCEL:
+        {
+           NOTIFY_INFO(3, _("Project opening canceled."));
+           break;
+        }
+      case PM_PROJECT_SUCCESS:
+        {
+           NOTIFY_INFO(3, _("Project '%s' is opened."), ap.project->name);
+           STATUSBAR_PROJECT_PATH(ap.project->pro_path);
+           STATUSBAR_PROJECT_SAVE_TIME_UPDATE();
+           break;
+        }
+      default:
+        {
+           ERR("Wrong result");
+           abort();
+        }
+     }
+TODO("Don't forgot about Enventor")
+#ifdef HAVE_ENVENTOR
+#endif /* HAVE_ENVENTOR */
+
+   splash_del(ap.splash);
+   ap.splash = NULL;
+}
diff --git a/src/bin/ui/project_common.h b/src/bin/ui/project_common.h
index d370e09..0c10e1b 100644
--- a/src/bin/ui/project_common.h
+++ b/src/bin/ui/project_common.h
@@ -17,10 +17,16 @@
  * along with this program; If not, see www.gnu.org/licenses/lgpl.html.
  */
 
-#ifndef COMMON_H
-#define COMMON_H
+#ifndef PROJECT_COMMON_H
+#define PROJECT_COMMON_H
 
 void
 exist_permission_check(const char *path, const char *name, const char *title, 
const char *msg);
 
-#endif /* COMMON_H */
+Eina_Bool
+progress_print(void *data, Eina_Stringshare *progress_string);
+
+void
+progress_end(void *data, PM_Project_Result result);
+
+#endif /* PROJECT_COMMON_H */
diff --git a/src/bin/ui/tab_home_common.c b/src/bin/ui/tab_home_common.c
index 1215755..ed835c9 100644
--- a/src/bin/ui/tab_home_common.c
+++ b/src/bin/ui/tab_home_common.c
@@ -60,61 +60,6 @@ meta_controls_data_save(Meta_Data_Controls *meta)
 
 }
 
-Eina_Bool
-progress_print(void *data __UNUSED__, Eina_Stringshare *progress_string)
-{
-   elm_object_part_text_set(ap.splash, "label.info", progress_string);
-   return true;
-}
-
-void
-progress_end(void *data, PM_Project_Result result)
-{
-   Meta_Data_Controls *meta = (Meta_Data_Controls *)data;
-
-   switch (result)
-     {
-      case PM_PROJECT_ERROR:
-        {
-           NOTIFY_INFO(3, _("Can't open project."));
-           break;
-        }
-      case PM_PROJECT_CANCEL:
-        {
-           NOTIFY_INFO(3, _("Project opening canceled."));
-           break;
-        }
-      case PM_PROJECT_SUCCESS:
-        {
-           ap.project = pm_project_thread_project_get();
-           assert(ap.project);
-           meta_controls_data_save(meta);
-
-           ui_menu_items_list_disable_set(ap.menu, MENU_ITEMS_LIST_BASE, 
false);
-           ui_menu_disable_set(ap.menu, MENU_FILE_CLOSE_PROJECT, false);
-           navigator_project_set();
-           tabs_menu_tab_open(TAB_HOME_PROJECT_INFO);
-
-           NOTIFY_INFO(3, _("Project '%s' is opened."), ap.project->name);
-           STATUSBAR_PROJECT_PATH(ap.project->pro_path);
-           STATUSBAR_PROJECT_SAVE_TIME_UPDATE();
-
-           config_recent_add(ap.project->name, ap.project->pro_path);
-           _tab_open_project_recents_update();
-           evas_object_smart_callback_call(ap.win, SIGNAL_PROJECT_OPENED, 
NULL);
-           break;
-        }
-      default:
-        {
-           ERR("Wrong result");
-           abort();
-        }
-     }
-
-   splash_del(ap.splash);
-   ap.splash = NULL;
-}
-
 void
 elipsis_btn_add(Evas_Object *entry, Evas_Smart_Cb cb_func, void *data)
 {
@@ -140,3 +85,26 @@ entry_path_set(void *data,
 
    elm_entry_entry_set(entry, eina_list_data_get(selected));
 }
+
+void
+_tabs_progress_end(void *data, PM_Project_Result result)
+{
+   Meta_Data_Controls *meta = (Meta_Data_Controls *)data;
+
+   if (PM_PROJECT_SUCCESS != result) return;
+
+   ap.project = pm_project_thread_project_get();
+   assert(ap.project);
+   meta_controls_data_save(meta);
+
+   ui_menu_items_list_disable_set(ap.menu, MENU_ITEMS_LIST_BASE, false);
+   ui_menu_disable_set(ap.menu, MENU_FILE_CLOSE_PROJECT, false);
+   navigator_project_set();
+   tabs_menu_tab_open(TAB_HOME_PROJECT_INFO);
+
+   config_recent_add(ap.project->name, ap.project->pro_path);
+   _tab_open_project_recents_update();
+   evas_object_smart_callback_call(ap.win, SIGNAL_PROJECT_OPENED, NULL);
+
+   progress_end(data, result);
+}
diff --git a/src/bin/ui/tab_home_import_edc.c b/src/bin/ui/tab_home_import_edc.c
index d0cb27a..bf7c688 100644
--- a/src/bin/ui/tab_home_import_edc.c
+++ b/src/bin/ui/tab_home_import_edc.c
@@ -373,7 +373,7 @@ _progress_end(void *data, PM_Project_Result result)
         elm_entry_entry_set(tab_edc.meta.licenses, NULL);
         elm_entry_entry_set(tab_edc.meta.comment, N_("Created with Eflete!"));
      }
-   progress_end(data, result);
+   _tabs_progress_end(data, result);
 }
 
 static Eina_Bool
diff --git a/src/bin/ui/tab_home_import_edj.c b/src/bin/ui/tab_home_import_edj.c
index 5c2d3ff..aecce7f 100644
--- a/src/bin/ui/tab_home_import_edj.c
+++ b/src/bin/ui/tab_home_import_edj.c
@@ -54,7 +54,7 @@ _progress_end(void *data, PM_Project_Result result)
         elm_entry_entry_set(tab_edj.meta.comment, N_("Created with Eflete!"));
      }
 
-   progress_end(data, result);
+   _tabs_progress_end(data, result);
 }
 
 static Eina_Bool
diff --git a/src/bin/ui/tab_home_new.c b/src/bin/ui/tab_home_new.c
index 1818cd4..3dc74c5 100644
--- a/src/bin/ui/tab_home_new.c
+++ b/src/bin/ui/tab_home_new.c
@@ -433,7 +433,7 @@ _progress_end(void *data, PM_Project_Result result)
         elm_entry_entry_set(tab_new.meta.comment, N_("Created with Eflete!"));
         _checks_set(false);
      }
-   progress_end(data, result);
+   _tabs_progress_end(data, result);
 }
 
 static Eina_Bool
diff --git a/src/bin/ui/tab_home_open.c b/src/bin/ui/tab_home_open.c
index f8db064..6e27c8d 100644
--- a/src/bin/ui/tab_home_open.c
+++ b/src/bin/ui/tab_home_open.c
@@ -46,7 +46,7 @@ _setup_open_splash(void *data, Splash_Status status 
__UNUSED__)
 
    assert(path != NULL);
 
-   pm_project_open(path, progress_print, progress_end, NULL);
+   pm_project_open(path, progress_print, _tabs_progress_end, NULL);
    eina_stringshare_del(path);
 
    return true;
diff --git a/src/bin/ui/tabs_private.h b/src/bin/ui/tabs_private.h
index 089d84e..fd8f892 100644
--- a/src/bin/ui/tabs_private.h
+++ b/src/bin/ui/tabs_private.h
@@ -22,6 +22,7 @@
 
 #include "main_window.h"
 #include "navigator.h"
+#include "project_common.h"
 
 struct _Meta_Data_Controls
 {
@@ -57,17 +58,13 @@ _tab_import_edc_add(void);
 Evas_Object *
 _tab_project_info_add(void);
 
-Eina_Bool
-progress_print(void *data, Eina_Stringshare *progress_string);
-
-void
-progress_end(void *data, PM_Project_Result result);
-
 void
 elipsis_btn_add(Evas_Object *entry, Evas_Smart_Cb cb_func, void *data);
 
 void
 entry_path_set(void *data, Evas_Object *obj, void *event_info);
 
+void
+_tabs_progress_end(void *data, PM_Project_Result result);
 
 #endif /* TABS_PRIVATE */

-- 


Reply via email to