Fix refresh bug. 36/36336/2 accepted/tizen/tv/20150305.103853 submit/tizen_tv/20150305.100133
authorJuWan Kim <juwan.kim@samsung.com>
Thu, 5 Mar 2015 09:13:47 +0000 (18:13 +0900)
committerJuWan Kim <juwan.kim@samsung.com>
Thu, 5 Mar 2015 09:55:12 +0000 (18:55 +0900)
  * When ctxpopup is clicked, grid item is refreshed totally.
  * But, the folder depth should be maintained

Change-Id: I763286575fc0ab23f7060a3df4d02a41e2fdbf77
Signed-off-by: JuWan Kim <juwan.kim@samsung.com>
include/FbAllLayout.h
include/FbMusicLayout.h
include/FbPhotoLayout.h
include/FbVideoLayout.h
src/layouts/FbAllLayout.cpp
src/layouts/FbMusicLayout.cpp
src/layouts/FbPhotoLayout.cpp
src/layouts/FbVideoLayout.cpp
src/views/BaseView/FbBaseView.cpp

index 0b31ba2..03f2be1 100644 (file)
@@ -11,7 +11,7 @@ private:
        static void sm_CbUpdatedGrid(void* cookie);
        static void sm_CbUnsetFocus(void* cookie);
        static void sm_CbLinkApp(void* cookie, int type, int source_type, char *path);
-       
+
        bool t_CreateFileGrid(Evas_Object *layout);
        void t_DestroyFileGrid(void);
 
@@ -26,8 +26,9 @@ public:
        bool Create(CLayoutMgr *mgr, void *data);
        virtual void Destroy(void);
 
-       void SetFocus(Eina_Bool flag);
+       void SetFocus(bool flag);
        void Action(void);
+       void SetUpdateFlag(bool flag);
 };
 
 
index f16c3d1..7fba53f 100644 (file)
@@ -26,8 +26,9 @@ public:
        bool Create(CLayoutMgr *mgr, void *data);
        virtual void Destroy(void);
 
-       void SetFocus(Eina_Bool flag);
+       void SetFocus(bool flag);
        void Action(void);
+       void SetUpdateFlag(bool flag);
 };
 
 
index 37bcb7f..6e16d16 100644 (file)
@@ -26,8 +26,9 @@ public:
        bool Create(CLayoutMgr *mgr, void *data);
        virtual void Destroy(void);
 
-       void SetFocus(Eina_Bool flag);
+       void SetFocus(bool flag);
        void Action(void);
+       void SetUpdateFlag(bool flag);
 };
 
 
index 90f2c51..271bb4a 100644 (file)
@@ -26,8 +26,9 @@ public:
        bool Create(CLayoutMgr *mgr, void *data);
        virtual void Destroy(void);
 
-       void SetFocus(Eina_Bool flag);
+       void SetFocus(bool flag);
        void Action(void);
+       void SetUpdateFlag(bool flag);
 };
 
 
index 9f8a4e6..3b6d31e 100644 (file)
@@ -21,6 +21,8 @@ struct SFbAllLayout {
 
        CLayoutMgr *pLayoutMgr;
        CViewMgr   *pViewMgr;
+
+       bool       updateFlag;
 };
 
 
@@ -117,7 +119,8 @@ void CFbAllLayout::t_OnShow(void)
 {
        elm_object_part_content_unset(m->eoBase, FBR_PART_CONTENT);
        elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, Layout()); 
-       m->pFileGrid->Update(false);
+       m->pFileGrid->Update(m->updateFlag);
+       m->updateFlag = false; // set default
        CBaseLayout::t_OnShow();
 }
 
@@ -139,6 +142,7 @@ bool CFbAllLayout::Create(CLayoutMgr *mgr, void *data)
                _CHECK(elm_layout_file_set(layout, EDJEFILE, FB_ALL_LAYOUT))
                _CHECK(t_CreateFileGrid(layout))
                _COMMAND{ 
+                       m->updateFlag = false;
                        elm_object_part_content_unset(m->eoBase, FBR_PART_CONTENT);
                        elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, layout); 
                }
@@ -172,7 +176,7 @@ void CFbAllLayout::Destroy(void)
 }
 
 
-void CFbAllLayout::SetFocus(Eina_Bool flag)
+void CFbAllLayout::SetFocus(bool flag)
 {
        ASSERT(m);
        _DBG();
@@ -187,3 +191,11 @@ void CFbAllLayout::Action(void)
        
        return m->pFileGrid->Action();
 }
+
+
+void CFbAllLayout::SetUpdateFlag(bool flag)
+{
+       ASSERT(m);
+
+       m->updateFlag = flag;
+}
index 6dd1de3..5d8a413 100644 (file)
@@ -21,6 +21,8 @@ struct SFbMusicLayout {
 
        CLayoutMgr *pLayoutMgr;
        CViewMgr   *pViewMgr;
+
+       bool       updateFlag;
 };
 
 
@@ -117,7 +119,8 @@ void CFbMusicLayout::t_OnShow(void)
 {
        elm_object_part_content_unset(m->eoBase, FBR_PART_CONTENT);
        elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, Layout()); 
-       m->pFileGrid->Update(false);
+       m->pFileGrid->Update(m->updateFlag);
+       m->updateFlag = false; // set default
        CBaseLayout::t_OnShow();
 }
 
@@ -139,6 +142,7 @@ bool CFbMusicLayout::Create(CLayoutMgr *mgr, void *data)
                _CHECK(elm_layout_file_set(layout, EDJEFILE, FB_MUSIC_LAYOUT))
                _CHECK(t_CreateFileGrid(layout))
                _COMMAND{ 
+                       m->updateFlag = false;
                        elm_object_part_content_unset(m->eoBase, FBR_PART_CONTENT);
                        elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, layout); 
                }
@@ -172,7 +176,7 @@ void CFbMusicLayout::Destroy(void)
 }
 
 
-void CFbMusicLayout::SetFocus(Eina_Bool flag)
+void CFbMusicLayout::SetFocus(bool flag)
 {
        ASSERT(m);
        _DBG();
@@ -187,3 +191,11 @@ void CFbMusicLayout::Action(void)
        
        return m->pFileGrid->Action();
 }
+
+
+void CFbMusicLayout::SetUpdateFlag(bool flag)
+{
+       ASSERT(m);
+
+       m->updateFlag = flag;
+}
index 5e55159..bda1bd1 100644 (file)
@@ -21,6 +21,8 @@ struct SFbPhotoLayout {
 
        CLayoutMgr *pLayoutMgr;
        CViewMgr   *pViewMgr;
+
+       bool       updateFlag;
 };
 
 
@@ -117,7 +119,8 @@ void CFbPhotoLayout::t_OnShow(void)
 {
        elm_object_part_content_unset(m->eoBase, FBR_PART_CONTENT);
        elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, Layout()); 
-       m->pFileGrid->Update(false);
+       m->pFileGrid->Update(m->updateFlag);
+       m->updateFlag = false; // set default
        CBaseLayout::t_OnShow();
 }
 
@@ -139,6 +142,7 @@ bool CFbPhotoLayout::Create(CLayoutMgr *mgr, void *data)
                _CHECK(elm_layout_file_set(layout, EDJEFILE, FB_PHOTO_LAYOUT))
                _CHECK(t_CreateFileGrid(layout))
                _COMMAND{ 
+                       m->updateFlag = false;
                        elm_object_part_content_unset(m->eoBase, FBR_PART_CONTENT);
                        elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, layout); 
                }
@@ -172,7 +176,7 @@ void CFbPhotoLayout::Destroy(void)
 }
 
 
-void CFbPhotoLayout::SetFocus(Eina_Bool flag)
+void CFbPhotoLayout::SetFocus(bool flag)
 {
        ASSERT(m);
        _DBG();
@@ -187,3 +191,11 @@ void CFbPhotoLayout::Action(void)
        
        return m->pFileGrid->Action();
 }
+
+
+void CFbPhotoLayout::SetUpdateFlag(bool flag)
+{
+       ASSERT(m);
+
+       m->updateFlag = flag;
+}
index 3ba8d47..333c8ed 100644 (file)
@@ -21,6 +21,8 @@ struct SFbVideoLayout {
 
        CLayoutMgr *pLayoutMgr;
        CViewMgr   *pViewMgr;
+
+       bool       updateFlag;
 };
 
 
@@ -117,7 +119,8 @@ void CFbVideoLayout::t_OnShow(void)
 {
        elm_object_part_content_unset(m->eoBase, FBR_PART_CONTENT);
        elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, Layout()); 
-       m->pFileGrid->Update(false);
+       m->pFileGrid->Update(m->updateFlag);
+       m->updateFlag = false; // set default
        CBaseLayout::t_OnShow();
 }
 
@@ -139,6 +142,7 @@ bool CFbVideoLayout::Create(CLayoutMgr *mgr, void *data)
                _CHECK(elm_layout_file_set(layout, EDJEFILE, FB_VIDEO_LAYOUT))
                _CHECK(t_CreateFileGrid(layout))
                _COMMAND{ 
+                       m->updateFlag = false;
                        elm_object_part_content_unset(m->eoBase, FBR_PART_CONTENT);
                        elm_object_part_content_set(m->eoBase, FBR_PART_CONTENT, layout); 
                }
@@ -172,7 +176,7 @@ void CFbVideoLayout::Destroy(void)
 }
 
 
-void CFbVideoLayout::SetFocus(Eina_Bool flag)
+void CFbVideoLayout::SetFocus(bool flag)
 {
        ASSERT(m);
        _DBG();
@@ -187,3 +191,11 @@ void CFbVideoLayout::Action(void)
        
        return m->pFileGrid->Action();
 }
+
+
+void CFbVideoLayout::SetUpdateFlag(bool flag)
+{
+       ASSERT(m);
+
+       m->updateFlag = flag;
+}
index 256c7f6..d55cd96 100644 (file)
@@ -140,7 +140,7 @@ struct SFbBaseView {
                for (a = 0; a < TOTAL_GROUP_BTNS; a++)
                        delete pHandlerGroup[a];
        }
-       
+
        class CHandlerBase : public CListenerMgr, public IKeyDownListener {
                SFbBaseView *m;
 
@@ -187,11 +187,41 @@ struct SFbBaseView {
                        switch (instance->Type()) {
                        case CCtxPopup::TOPBTN_SORT:
                                elm_object_text_set(m->eoBtnSort, text);
+                               switch(m->curLayoutId)
+                               {
+                                       case ALL_LAYOUT:
+                                               m->pFbAllLayout->SetUpdateFlag(true);
+                                               break;
+                                       case PHOTO_LAYOUT:
+                                               m->pFbPhotoLayout->SetUpdateFlag(true);
+                                               break;
+                                       case VIDEO_LAYOUT:
+                                               m->pFbVideoLayout->SetUpdateFlag(true);
+                                               break;
+                                       case MUSIC_LAYOUT:
+                                               m->pFbMusicLayout->SetUpdateFlag(true);
+                                               break;
+                               }
                                m->pLayoutMgr->Show(_get_layout_id(m->curLayoutId));
                                break;
 
                        case CCtxPopup::TOPBTN_SOURCE:
                                elm_object_text_set(m->eoBtnSource, text);
+                               switch(m->curLayoutId)
+                               {
+                                       case ALL_LAYOUT:
+                                               m->pFbAllLayout->SetUpdateFlag(true);
+                                               break;
+                                       case PHOTO_LAYOUT:
+                                               m->pFbPhotoLayout->SetUpdateFlag(true);
+                                               break;
+                                       case VIDEO_LAYOUT:
+                                               m->pFbVideoLayout->SetUpdateFlag(true);
+                                               break;
+                                       case MUSIC_LAYOUT:
+                                               m->pFbMusicLayout->SetUpdateFlag(true);
+                                               break;
+                               }
                                m->pLayoutMgr->Show(_get_layout_id(m->curLayoutId));
                                break;
 
@@ -394,7 +424,7 @@ void CFbBaseView::t_CreateTopSession(void)
        struct _btn_info btninfo[TOTAL_TOP_BTNS];
        btninfo[TOPBTN_SOURCE].style = FBR_STYLE_SOURCE_BTN;
        btninfo[TOPBTN_SOURCE].part  = FBR_PART_SOURCE_HOVERSEL;
-       
+
        btninfo[TOPBTN_SORT].style = FBR_STYLE_SORT_BTN;
        btninfo[TOPBTN_SORT].part  = FBR_PART_SORT_HOVERSEL;
 
@@ -456,7 +486,7 @@ void CFbBaseView::t_CreateLeftSession(void)
                elm_box_pack_end(box, m->eoBtnGroup[i]);
                elm_object_style_set(m->eoBtnGroup[i], FBR_STYLE_GROUPBTN);
                elm_object_text_set(m->eoBtnGroup[i], _(btninfo[i].txt));
-               
+
                m->pHandlerGroup[i]->Connect(m->eoBtnGroup[i], i);
 
                ic = elm_image_add(m->eoBtnGroup[i]);
@@ -621,7 +651,7 @@ bool CFbBaseView::Create(void *data)
        // original create grid
        CInfo::SetSortType(0/*CSort::SORT_NAME_AZ*/);
        evas_object_data_set(eoBase, BASE_VIEW_DATA, this);
-       m->curLayoutId = ALL_LAYOUT;    
+       m->curLayoutId = ALL_LAYOUT;
        _DBG("curLayoutId = %s", _get_layout_id(m->curLayoutId));
        t_CreateFullView();
        elm_object_focus_allow_set(eoBase, EINA_FALSE);
@@ -641,7 +671,7 @@ void CFbBaseView::Destroy(void)
        m->pLayoutMgr->RemoveLayout(m->pFbMusicLayout);
        m->pFbMusicLayout->Destroy();
        delete m->pFbMusicLayout;
-       
+
        m->pLayoutMgr->RemoveLayout(m->pFbVideoLayout);
        m->pFbVideoLayout->Destroy();
        delete m->pFbVideoLayout;