From 561685d7f2985ba08d3428cc0e7769cbb00c97fd Mon Sep 17 00:00:00 2001 From: "bhutani.92" Date: Fri, 25 Nov 2016 14:04:00 +0530 Subject: [PATCH] Fixed Sound Player launch when opening from message application Change-Id: I878286beeb33200113b73e6748fdc753e04e8d16 Signed-off-by: bhutani.92 --- music-chooser/src/mc-track-list.c | 45 +++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/music-chooser/src/mc-track-list.c b/music-chooser/src/mc-track-list.c index e05f39b..23cbc61 100755 --- a/music-chooser/src/mc-track-list.c +++ b/music-chooser/src/mc-track-list.c @@ -558,13 +558,40 @@ static void _gl_sel_cb(void *data, Evas_Object *obj, void *event_info) return; } else { - it_data->checked = !it_data->checked; + if (it_data->checkbox_cb) { + it_data->checked = !it_data->checked; + } } if (ld->ad->select_type == MC_SELECT_MULTI && !it_data->checkbox_cb) { - Evas_Object *check = elm_object_item_part_content_get(item, "elm.swallow.end"); - Eina_Bool check_state = elm_check_state_get(check); - elm_check_state_set(check, !check_state); + /*Launching Sound Manager on clicking a song*/ + app_control_h app_control; + int ret = APP_CONTROL_ERROR_NONE; + ret = app_control_create(&app_control); + if (ret != APP_CONTROL_ERROR_NONE) { + DEBUG_TRACE("app_control_create()... [0x%x]", ret); + return; + } + ret = app_control_set_uri(app_control, path); + if (ret != APP_CONTROL_ERROR_NONE) { + DEBUG_TRACE("app_control_set_uri()... [0x%x]", ret); + return; + } + app_control_set_mime(app_control, "audio/*"); + ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW); + if (ret != APP_CONTROL_ERROR_NONE) { + DEBUG_TRACE("app_control_set_operation()... [0x%x]", ret); + return; + } + ret = app_control_send_launch_request(app_control, NULL, NULL); + if (ret == APP_CONTROL_ERROR_APP_NOT_FOUND) { + ERROR_TRACE("Cannot launch sound-player. Application not found."); + } else if (ret != APP_CONTROL_ERROR_NONE) { + DEBUG_TRACE("app_control_send_launch_request()... [0x%x]"); + } + if (app_control) { + app_control_destroy(app_control); + } } elm_genlist_item_fields_update(event_info, "elm.swallow.end", ELM_GENLIST_ITEM_FIELD_CONTENT); @@ -573,11 +600,6 @@ static void _gl_sel_cb(void *data, Evas_Object *obj, void *event_info) WARN_TRACE("Exceeded max size by caller"); size_exceeded = true; it_data->checked = !it_data->checked; - if (!it_data->checkbox_cb) { - Evas_Object *check = elm_object_item_part_content_get(item, "elm.swallow.end"); - Eina_Bool check_state = elm_check_state_get(check); - elm_check_state_set(check, !check_state); - } char *name = g_strdup(GET_STR(STR_MC_MAX_SIZE_EXCEEDED)); mc_post_status_message(name); IF_FREE(name); @@ -586,11 +608,6 @@ static void _gl_sel_cb(void *data, Evas_Object *obj, void *event_info) if ((ld->ad->select_type == MC_SELECT_MULTI) && ((ld->ad->max_count > 0) && _get_select_count(ld) > ld->ad->max_count)) { WARN_TRACE("Exceeded max count by caller"); it_data->checked = !it_data->checked; - if (!it_data->checkbox_cb) { - Evas_Object *check = elm_object_item_part_content_get(item, "elm.swallow.end"); - Eina_Bool check_state = elm_check_state_get(check); - elm_check_state_set(check, !check_state); - } char *name = g_strdup_printf(GET_STR(STR_MC_MAX_COUNT_EXCEEDED), ld->ad->max_count); mc_post_status_message(name); IF_FREE(name); -- 2.34.1