diff options
Diffstat (limited to 'src/simple-maps-mapview.c')
-rw-r--r-- | src/simple-maps-mapview.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/simple-maps-mapview.c b/src/simple-maps-mapview.c index af77336..6072251 100644 --- a/src/simple-maps-mapview.c +++ b/src/simple-maps-mapview.c @@ -278,6 +278,15 @@ static bool getLocationfromKeyword(maps_error_e result, int request_id, int inde static void mapview_cancel_cb(void *data, Evas_Object * obj, void *event_info) { + simple_maps_app_data *ad = (simple_maps_app_data *)data; + app_control_h reply = NULL; + + app_control_create(&reply); + int ret = app_control_reply_to_launch_request(reply, ad->app_control, APP_CONTROL_RESULT_FAILED); + if (ret != APP_CONTROL_ERROR_NONE) + dlog_print(DLOG_ERROR, LOG_TAG, "app_control_reply_to_launch_request fail. err=%d", ret); + app_control_destroy(reply); + ui_app_exit(); } @@ -321,6 +330,16 @@ static void mapview_done_cb(void *data, Evas_Object * obj, void *event_info) ui_app_exit(); } +void mapview_back_cb(void *data, Evas_Object *obj, void *event_info) +{ + simple_maps_app_data *ad = (simple_maps_app_data *)data; + + if (ad->operation == SIMPLE_MAPS_PICK) + mapview_cancel_cb(data, NULL, NULL); + else + ui_app_exit(); +} + static void maps_view_event_cb(maps_view_event_type_e type, maps_view_event_data_h event_data, void *user_data) { simple_maps_app_data *ad = (simple_maps_app_data *)user_data; @@ -367,6 +386,11 @@ static void user_consent_cb(bool consented, const char *maps_provider, void *use maps_coordinates_h maps_coord = NULL; int request_id = 0; + if (consented != true) { + mapview_back_cb(user_data, NULL, NULL); + return; + } + int ret = maps_service_create(maps_provider, &(ad->maps_service)); if (ret != MAPS_ERROR_NONE) { dlog_print(DLOG_ERROR, LOG_TAG, "maps_service_create fail, error = %d", ret); @@ -527,7 +551,7 @@ void mapview(simple_maps_app_data *ad) ad->map_cancel_btn = elm_button_add(ad->layout); elm_object_text_set(ad->map_cancel_btn, P_("IDS_COM_SK_CANCEL")); - evas_object_smart_callback_add(ad->map_cancel_btn, "clicked", mapview_cancel_cb, NULL); + evas_object_smart_callback_add(ad->map_cancel_btn, "clicked", mapview_cancel_cb, ad); evas_object_size_hint_weight_set(ad->map_cancel_btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(ad->map_cancel_btn, EVAS_HINT_FILL, 0.5); evas_object_show(ad->map_cancel_btn); |