Corrected Selection/updation Logic 19/69219/1
authorChandan <ch.kumar@samsung.com>
Thu, 12 May 2016 07:50:38 +0000 (13:20 +0530)
committerChandan <ch.kumar@samsung.com>
Thu, 12 May 2016 07:51:25 +0000 (13:21 +0530)
Change-Id: Ie959dd61c6a3013a1bffefd35d0b6198bd83fc5f
Signed-off-by: Chandan <ch.kumar@samsung.com>
attach-panel-gallery.xml
src/view/ge-albums.c

index e27f4c1..71316ad 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" package="attach-panel-gallery" api-version="2.4" version="1.1.26" install-location="internal-only">
+<manifest xmlns="http://tizen.org/ns/packages" package="attach-panel-gallery" api-version="3.0" version="1.1.26" install-location="internal-only">
        <label>Gallery Appcontrol</label>
                <label xml:lang="hy-am">Gallery Appcontrol</label>
                <label xml:lang="az-az">Gallery Appcontrol</label>
@@ -54,7 +54,7 @@
                <label xml:lang="fr-ca">Gallery Appcontrol</label>
        <author email="jiansong.jin@samsung.com" href="www.samsung.com">Jiansong Jin</author>
        <description>Gallery application</description>
-       <ui-application appid="attach-panel-gallery" exec="/usr/ug/bin/attach-panel-gallery" hw-acceleration="use-GL" nodisplay="true" multiple="true" type="capp"  taskmanage="false" >
+       <ui-application appid="attach-panel-gallery" exec="/usr/ug/bin/attach-panel-gallery" hw-acceleration="on" process-pool="true" nodisplay="true" multiple="true" type="capp"  taskmanage="false" >
                <icon>/usr/ug/res/images/attach-panel-gallery/attach-panel-gallery.png</icon>
                <label>Gallery</label>
                <label xml:lang="hy-am">Պատկերասրահ</label>
index e26fd3c..52e21b9 100644 (file)
@@ -1481,6 +1481,30 @@ ge_update_gengrid(ge_ugdata *ugd)
        ugd->thumbs_d->medias_cnt = eina_list_count(ugd->thumbs_d->medias_elist);
        ge_dbg("Grid view updated media count: %d", ugd->thumbs_d->medias_cnt);
 
+       if (ugd->thumbs_d->medias_cnt == 0) {
+               _ge_data_util_free_mtype_items(&ugd->selected_elist);
+       } else {
+               EINA_LIST_FOREACH(ugd->selected_elist, l, sit) {
+                       bool flag = false;
+                       for (i = 0; i < ugd->thumbs_d->medias_cnt; i++) {
+                               gitem = eina_list_nth(ugd->thumbs_d->medias_elist, i);
+                               if (gitem == NULL || gitem->item == NULL ||
+                                               gitem->item->uuid == NULL) {
+                                       ge_dbgE("Invalid gitem!");
+                                       continue;
+                               }
+                               if (sit && strcmp(sit->file_url, gitem->item->file_url) == 0) {
+                                       flag = true;
+                                       break;
+                               }
+                       }
+                       if (flag == false) {
+                               ugd->selected_elist = eina_list_remove(ugd->selected_elist, sit);
+                               _ge_data_util_free_sel_item(sit);
+                       }
+               }
+       }
+
        elm_gengrid_clear(ugd->thumbs_d->gengrid);
        if (ugd->thumbs_d->medias_cnt > 0) {
                if (ugd->nocontents) {
@@ -1543,6 +1567,19 @@ ge_update_gengrid(ge_ugdata *ugd)
                                        ugd);
        }
 
+       Evas_Object *btn = NULL;
+
+       btn = elm_object_item_part_content_get(ugd->nf_it , GE_NAVIFRAME_TITLE_RIGHT_BTN);
+       if (btn == NULL) {
+               ge_dbgE("Failed to get part information");
+       }
+
+       if (ugd->thumbs_d->tot_selected == 0) {
+               elm_object_disabled_set(btn, EINA_TRUE);
+       } else {
+               elm_object_disabled_set(btn, EINA_FALSE);
+       }
+
 
        char *text = g_strdup_printf(pd_selected, ugd->thumbs_d->tot_selected);
        elm_object_item_text_set(ugd->nf_it, text);