From 6e95a2beffd41eb2f313070315ffa9eda4f3db9a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Telle-Tiia=20Pitk=C3=A4nen?= Date: Wed, 29 May 2013 14:39:58 +0300 Subject: [PATCH] Launch sharing ugs specifically. Fixes TZSP-6016, TDIS-5131 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- feature/include/ivug-ext-ug.h | 1 + feature/src/ivug-ext-ug.c | 37 ++++++++++++++++++++++++++++++++--- main/src/view/ivug-main-view-menu.cpp | 5 ++--- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/feature/include/ivug-ext-ug.h b/feature/include/ivug-ext-ug.h index 27ed5b1..86cb243 100755 --- a/feature/include/ivug-ext-ug.h +++ b/feature/include/ivug-ext-ug.h @@ -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 } diff --git a/feature/src/ivug-ext-ug.c b/feature/src/ivug-ext-ug.c index dcc7aab..8f24655 100755 --- a/feature/src/ivug-ext-ug.c +++ b/feature/src/ivug-ext-ug.c @@ -29,10 +29,11 @@ #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); diff --git a/main/src/view/ivug-main-view-menu.cpp b/main/src/view/ivug-main-view-menu.cpp index 2f79cc3..048d62a 100755 --- a/main/src/view/ivug-main-view-menu.cpp +++ b/main/src/view/ivug-main-view-menu.cpp @@ -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); -- 2.7.4