[TSAM-8862] Added Max selection count while calling IV in select view 08/95208/1 submit/tizen_mobile/20161102.122749
authorRahul Dadhich <r.dadhich@samsung.com>
Mon, 24 Oct 2016 05:04:42 +0000 (10:34 +0530)
committerRahul Dadhich <r.dadhich@samsung.com>
Wed, 2 Nov 2016 11:53:09 +0000 (04:53 -0700)
Change-Id: I4501822595c81c5d2edb46cb02d6d72086a734a2
Signed-off-by: Rahul Dadhich <r.dadhich@samsung.com>
(cherry picked from commit 136ead5156f10cdb461ce306c201fe9105908da1)

src/util/ge-ext-ug-load.c
src/view/ge-timeline.c

index 49296f6..74f4f11 100644 (file)
@@ -418,6 +418,12 @@ int _ge_ext_load_iv_ug_select_mode(void *data, ge_media_s *item, ge_ext_iv_type
        if (ret != APP_CONTROL_ERROR_NONE) {
                ge_dbgE("Setting the Media type failed");
        }
+
+       if (ugd->max_count != -1) {
+               char count[1024] = {};
+               snprintf(count, 1024, "%d", ugd->max_count);
+               ret = app_control_add_extra_data(service, APP_CONTROL_DATA_TOTAL_COUNT, strdup(count));
+       }
        ret = app_control_send_launch_request(service, __ge_appcontrol_select_result_cb, (void *)ugd);
 
        app_control_destroy(service);
index f1e1786..43e4b82 100644 (file)
@@ -511,6 +511,8 @@ void _ge_timeline_update_items_data_on_particular_date(void *data, _ge_date_item
        item = eina_list_nth(ugd->data_list, date_item->index);
        int number_of_items_on_particular_date = _get_count_of_items_on_same_date(item, ugd->data_list, &text, date_item->index + 1);
        int i;
+
+
        int corrupt_count =0;
        for (i = date_item->index; i < (date_item->index +number_of_items_on_particular_date); i++) {
                item = eina_list_nth(ugd->data_list, i);
@@ -522,6 +524,17 @@ void _ge_timeline_update_items_data_on_particular_date(void *data, _ge_date_item
                        corrupt_count++;
                }
        }
+       if (date_item->check_state == true) {
+               if (ugd->max_count > 0 && (number_of_items_on_particular_date - corrupt_count) > ugd->max_count) {
+                       char *noti = NULL;
+                       char *noti_str = GE_STR_MAXIMUM_COUNT;
+                       noti = g_strdup_printf(noti_str, ugd->max_count);
+                       _ge_ui_create_notiinfo(noti);
+                       GE_GFREEIF(noti);
+                       date_item->check_state = EINA_FALSE;
+                       return;
+               }
+       }
 
        if (date_item->check_state && corrupt_count == number_of_items_on_particular_date) {
                date_item->check_state = EINA_FALSE;
@@ -1625,6 +1638,20 @@ static void __ge_timeline_thumb_edit_selall_cb(void *data, Evas_Object *obj, voi
                elm_check_state_set(ugd->sel_all_ck, ugd->ck_state);
        }
 
+       if (ugd->ck_state == true) {
+               if (ugd->max_count > 0 && (ugd->count - ugd->unsupported_cnt) > ugd->max_count) {
+                       char *noti = NULL;
+                       char *noti_str = GE_STR_MAXIMUM_COUNT;
+                       noti = g_strdup_printf(noti_str, ugd->max_count);
+                       _ge_ui_create_notiinfo(noti);
+                       GE_GFREEIF(noti);
+                       ugd->ck_state = EINA_FALSE;
+                       if (ugd->sel_all_ck) {
+                               elm_check_state_set(ugd->sel_all_ck, ugd->ck_state);
+                       }
+                       return;
+               }
+       }
        if ((ugd->count - ugd->unsupported_cnt) <= 0) {
                ugd->ck_state = EINA_FALSE;
                elm_check_state_set(ugd->sel_all_ck, ugd->ck_state);