Launch sharing ugs specifically. Fixes TZSP-6016, TDIS-5131
authorTelle-Tiia Pitkänen <telle-tiia.pitkanen@ixonos.com>
Wed, 29 May 2013 11:39:58 +0000 (14:39 +0300)
committerTelle-Tiia Pitkänen <telle-tiia.pitkanen@ixonos.com>
Thu, 30 May 2013 10:34:28 +0000 (13:34 +0300)
When using the default launch, the ui gadget is launched by app_svc as without
bundle information. Therefore UG will be closed instead of pushing background.

Change-Id: I63b62ec2a2520072bf81b401d856f315eab509e4
Signed-off-by: Telle-Tiia Pitkänen <telle-tiia.pitkanen@ixonos.com>
feature/include/ivug-ext-ug.h
feature/src/ivug-ext-ug.c
main/src/view/ivug-main-view-menu.cpp

index 27ed5b1..86cb243 100755 (executable)
@@ -49,6 +49,7 @@ bool ivug_ext_launch_email(const char *uri);
 bool ivug_ext_launch_print(const char *uri);
 
 bool ivug_ext_launch_default(const char *uri, const char *operation, const char *pkg, void *data);
+bool ivug_ext_launch_to_send(const char *uri, const char *pkg, ug_destroy_cb func, void *data, ui_gadget_h ug);
 
 #ifdef __cplusplus
 }
index dcc7aab..8f24655 100755 (executable)
 #define EMAIL_UG_NAME                  "email-composer-efl"
 #define CONTACT_UG_NAME                "contacts-list-efl"
 #define MYFILE_DETAIL_UG_NAME  "myfile-detail-efl"
-#define BLUETOOTH_UG_NAME              "setting-bluetooth-efl"
+#define BLUETOOTH_UG_NAME              "ug-bluetooth-efl"
 #define MYFILE_UG_NAME                 "myfile-efl"
 
 #define CONTACT_SELECT_UG_NAME "contacts-tabui-efl"
+#define BLUETOOTH_SETTING_NAME "setting-bluetooth-efl"
 
 #define VIDEOPLAYER_PKG_NAME   "org.tizen.video-player"
 #define BLUETOOTH_PKG_NAME             "org.tizen.bluetooth"
@@ -386,7 +387,7 @@ bool  ivug_ext_launch_email(const char *uri)
                return false;
        }
 
-       ret = service_set_operation(handle, "http://tizen.org/appcontrol/operation/send");
+       ret = service_set_operation(handle, SERVICE_OPERATION_SEND);
        if(ret != SERVICE_ERROR_NONE)
        {
                MSG_IMAGEVIEW_ERROR("service_set_operation failed, %d", ret);
@@ -589,7 +590,7 @@ ui_gadget_h  ivug_ext_launch_bluetooth_send(const char *uri, ug_destroy_cb func,
                goto BT_END;
        }*/
 
-       ug = _ivug_ext_launch_ug(BLUETOOTH_UG_NAME, handle, func, data);
+       ug = _ivug_ext_launch_ug(BLUETOOTH_SETTING_NAME, handle, func, data);
 
 BT_END:
        destroy_ret = service_destroy(handle);
@@ -998,6 +999,36 @@ LAUNCH_END:
        return (ret == SERVICE_ERROR_NONE ? true : false);
 }
 
+bool ivug_ext_launch_to_send(const char *uri, const char *pkg,  ug_destroy_cb func, void *data, ui_gadget_h ug)
+{
+       MSG_IMAGEVIEW_HIGH("%s: %s %s", __func__, uri, pkg);
+
+       bool ret = false;
+       ug = NULL;
+
+       if (!strcmp(pkg, MESSAGE_UG_NAME))
+       {
+               ug = ivug_ext_launch_message(uri, func, data);
+               ret = ug ? true : false;
+       }
+       else if (!strcmp(pkg, EMAIL_UG_NAME))
+       {
+               ret = ivug_ext_launch_email(uri);
+       }
+       else if (!strcmp(pkg, BLUETOOTH_PKG_NAME) || !strcmp(pkg, BLUETOOTH_UG_NAME))
+       {
+               ug = ivug_ext_launch_bluetooth_send(uri, func, data);
+               ret = ug ? true : false;
+       }
+       else
+       {
+               /* Use default launch for other execs but bluetooth, that always requires settings */
+               ret = ivug_ext_launch_default(uri, SERVICE_OPERATION_SEND, pkg, data);
+       }
+
+       return ret;
+}
+
 bool ivug_ext_launch_print(const char *uri)
 {
        MSG_IMAGEVIEW_HIGH("%s. URI=%s", __func__, uri);
index 2f79cc3..048d62a 100755 (executable)
@@ -249,8 +249,7 @@ void _on_share_selected(void *data, Evas_Object *obj, void *event_info)
        path = mdata->filepath;
 
        bool ret = false;
-
-       ret = ivug_ext_launch_default(path, "http://tizen.org/appcontrol/operation/send", label, data);
+       ret = ivug_ext_launch_to_send(path, label, _on_ext_ug_destroy_cb, data, pMainView->ext_ug);
 
        /* appsvc failed or ug_create failed */
        if(ret == false)
@@ -1270,7 +1269,7 @@ void on_btn_share_clicked(void *data, Evas_Object *obj, void *event_info)
 
        service_h service;
        service_create(&service);
-       service_set_operation(service, "http://tizen.org/appcontrol/operation/send");
+       service_set_operation(service, SERVICE_OPERATION_SEND);
        service_set_uri(service, mdata->filepath);
        service_foreach_app_matched(service, _share_pkg_cb, (void *)popup);