From 9b3c0034559c3c67851a7feaf0b41844770ab630 Mon Sep 17 00:00:00 2001 From: JuWan Kim Date: Tue, 17 Feb 2015 10:51:09 +0900 Subject: [PATCH] Fix UI issue / Launch issue / Mediadata issue Change-Id: I166f5b08115e36eaccefc6bfba638faedf54ee6e Signed-off-by: JuWan Kim --- include/define.h | 6 ++--- res/edc/views/base-layout.edc | 2 +- res/edc/widgets/button.edc | 3 +++ res/edc/widgets/gengrid.edc | 1 + src/data/FileInfo.cpp | 9 +++++--- src/data/MediadataImpl.cpp | 7 +++--- src/layouts/FbAllLayout.cpp | 2 +- src/main.cpp | 7 +++++- src/views/BaseView/FbBaseView.cpp | 47 +++++++++++++++++++++------------------ src/views/BaseView/FileGrid.cpp | 9 +++++++- 10 files changed, 58 insertions(+), 35 deletions(-) diff --git a/include/define.h b/include/define.h index 1bc938d..3a09f3f 100644 --- a/include/define.h +++ b/include/define.h @@ -148,9 +148,9 @@ /* KEY DEFINES */ #define KEY_ENTER "Return" -#define KEY_EXIT "XF86Close" -#define KEY_BACK "XF86Stop" -#define KEY_MENU "XF86Send" +#define KEY_EXIT "Exit" +#define KEY_BACK "Escape" +#define KEY_MENU "Super_L" /* CTXPOPUP POSITION */ #define POSITION_SORT_POPUP_X 1344 diff --git a/res/edc/views/base-layout.edc b/res/edc/views/base-layout.edc index 71fda16..f8b68a9 100644 --- a/res/edc/views/base-layout.edc +++ b/res/edc/views/base-layout.edc @@ -1,5 +1,5 @@ group { - name: FB_BASE_LAYOUT; + name: FB_ALL_LAYOUT; parts { part { name: "bg"; diff --git a/res/edc/widgets/button.edc b/res/edc/widgets/button.edc index aed31bb..3105c06 100644 --- a/res/edc/widgets/button.edc +++ b/res/edc/widgets/button.edc @@ -3,6 +3,7 @@ group { name: "elm/button/base/fbr_hover_entry"; + data.item: "focus_highlight" "on"; images { image: FBR_IMAGE_TICK COMP; } @@ -269,6 +270,7 @@ group { group { name: "elm/button/base/fbr_sourcebtn"; + data.item: "focus_highlight" "on"; images { image: FBR_IMAGE_PULLDOWN_ARROW COMP; image: FBR_IMAGE_ROUND_ICON COMP; @@ -613,6 +615,7 @@ group { group { name: "elm/button/base/fbr_menubtn"; + data.item: "focus_highlight" "on"; images { image: FBR_GROUPBTN_BG COMP; } diff --git a/res/edc/widgets/gengrid.edc b/res/edc/widgets/gengrid.edc index 7c22131..eb1c290 100644 --- a/res/edc/widgets/gengrid.edc +++ b/res/edc/widgets/gengrid.edc @@ -3,6 +3,7 @@ group { data.item: "selectraise" "on"; data.item: "texts" "elm.text elm.text1"; data.item: "contents" "elm.swallow.icon elm.swallow.icon1"; + data.item: "focus_highlight" "on"; parts { part { name: "bg_with_border"; diff --git a/src/data/FileInfo.cpp b/src/data/FileInfo.cpp index 155f567..b50a98c 100644 --- a/src/data/FileInfo.cpp +++ b/src/data/FileInfo.cpp @@ -158,10 +158,13 @@ bool CFileInfo::Load(void) if(str == NULL) { _ERR("Fail to get string by media_info_get_thumbnail_path"); - break; + //break; + } + else + { + SetThumbnailPath(str); + free(str); } - SetThumbnailPath(str); - free(str); TTime time; if (media_info_get_modified_time(m->handle, &time) != MEDIA_CONTENT_ERROR_NONE) { diff --git a/src/data/MediadataImpl.cpp b/src/data/MediadataImpl.cpp index 5305e92..1539e2c 100644 --- a/src/data/MediadataImpl.cpp +++ b/src/data/MediadataImpl.cpp @@ -183,11 +183,11 @@ bool CMediadataImpl::m_GetMediaList(const char *folderid) void CMediadataImpl::m_GetFolderList(void) { int r; - _DBG("this: 0x%x", this); + _DBG("START: this: 0x%x", this); r = media_folder_foreach_folder_from_db(m->filter, sm_CbFolderInfo, this); - _DBG(""); if (r != MEDIA_CONTENT_ERROR_NONE) _ERR("Media folder foreach folder from db failed"); + _DBG("END"); } void CMediadataImpl::m_UpdateFolderLists(void) @@ -197,6 +197,7 @@ void CMediadataImpl::m_UpdateFolderLists(void) RemoveAll(); for (type = E_GRP_ALL; type <= E_GRP_MUSIC; type++) { + _DBG("=================================================="); m->media_type = type; bool r = m_CreateFilter(m->source_type, m->media_type); @@ -209,6 +210,7 @@ void CMediadataImpl::m_UpdateFolderLists(void) m_DestroyFilter(m->filter); m->filter = NULL; + _DBG("=================================================="); } } @@ -270,7 +272,6 @@ bool CMediadataImpl::GetMediaList(const char* folderid, int media_type, int sour return false; } - // ƯÁ¤ Æú´õ ³»¿¡ ÀÖ´Â ÆÄÀϵéÀ» »Ì¾Æ m->filelist¿¡ ³ÖÀ½. r = m_GetMediaList(folderid); m_DestroyFilter(m->filter); diff --git a/src/layouts/FbAllLayout.cpp b/src/layouts/FbAllLayout.cpp index 0db2b59..773ad04 100644 --- a/src/layouts/FbAllLayout.cpp +++ b/src/layouts/FbAllLayout.cpp @@ -116,7 +116,7 @@ void CFbAllLayout::t_OnShow(void) { _DBG(); - m->pFileGrid->Update(false); +//m->pFileGrid->Update(false); // CBaseLayout::t_OnShow(); return; } diff --git a/src/main.cpp b/src/main.cpp index c12e309..2cfa360 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,6 +31,8 @@ #include #include "FbContextView.h" +#include + #define PARAM_SOURCE "source" #define FBR_WIN_TITLE "File Browser" @@ -38,7 +40,8 @@ Evas_Object *_add_win(const char *name) { Evas_Object *win; - win = elm_win_add(NULL, name, ELM_WIN_BASIC); + //win = elm_win_add(NULL, name, ELM_WIN_BASIC); + win = elm_win_util_standard_add(name, NULL); if (!win) return NULL; @@ -110,6 +113,8 @@ protected: ad.source = strdup("all"); } + CSortMgr::Initialize(); + CViewMgr::Initialize(ad.win,NULL); viewmgr = CViewMgr::GetInstance(); if(!viewmgr) { diff --git a/src/views/BaseView/FbBaseView.cpp b/src/views/BaseView/FbBaseView.cpp index 53fcecb..1fde9b6 100644 --- a/src/views/BaseView/FbBaseView.cpp +++ b/src/views/BaseView/FbBaseView.cpp @@ -94,9 +94,9 @@ struct SFbBaseView { char* *pCurrentLayoutId; CFbAllLayout *pFbAllLayout; - CFbPhotoLayout *pFbPhotoLayout; - CFbMusicLayout *pFbMusicLayout; - CFbVideoLayout *pFbVideoLayout; + //CFbPhotoLayout *pFbPhotoLayout; + //CFbMusicLayout *pFbMusicLayout; + //CFbVideoLayout *pFbVideoLayout; SFbBaseView() { int a; @@ -541,17 +541,17 @@ bool CFbBaseView::Create(void *data) _CHECK(m->pLayoutMgr = new CLayoutMgr) _CHECK(m->pLayoutMgr->Create(eoBase, NULL)) _CHECK(m->pFbAllLayout = new CFbAllLayout(FB_ALL_LAYOUT)) - _CHECK(m->pFbPhotoLayout = new CFbPhotoLayout(FB_PHOTO_LAYOUT)) - _CHECK(m->pFbVideoLayout = new CFbVideoLayout(FB_VIDEO_LAYOUT)) - _CHECK(m->pFbMusicLayout = new CFbMusicLayout(FB_MUSIC_LAYOUT)) + //_CHECK(m->pFbPhotoLayout = new CFbPhotoLayout(FB_PHOTO_LAYOUT)) + //_CHECK(m->pFbVideoLayout = new CFbVideoLayout(FB_VIDEO_LAYOUT)) + //_CHECK(m->pFbMusicLayout = new CFbMusicLayout(FB_MUSIC_LAYOUT)) _CHECK(m->pFbAllLayout->Create(m->pLayoutMgr, NULL)) - _CHECK(m->pFbPhotoLayout->Create(m->pLayoutMgr, NULL)) - _CHECK(m->pFbVideoLayout->Create(m->pLayoutMgr, NULL)) - _CHECK(m->pFbMusicLayout->Create(m->pLayoutMgr, NULL)) + //_CHECK(m->pFbPhotoLayout->Create(m->pLayoutMgr, NULL)) + //_CHECK(m->pFbVideoLayout->Create(m->pLayoutMgr, NULL)) + //_CHECK(m->pFbMusicLayout->Create(m->pLayoutMgr, NULL)) _CHECK(m->pLayoutMgr->AddLayout(m->pFbAllLayout)) - _CHECK(m->pLayoutMgr->AddLayout(m->pFbPhotoLayout)) - _CHECK(m->pLayoutMgr->AddLayout(m->pFbVideoLayout)) - _CHECK(m->pLayoutMgr->AddLayout(m->pFbMusicLayout)) + //_CHECK(m->pLayoutMgr->AddLayout(m->pFbPhotoLayout)) + //_CHECK(m->pLayoutMgr->AddLayout(m->pFbVideoLayout)) + //_CHECK(m->pLayoutMgr->AddLayout(m->pFbMusicLayout)) _CHECK(CUsbConnectionListener::Create()) _CHECK(CMediaContentDbUpdateListener::Create()) @@ -559,17 +559,17 @@ bool CFbBaseView::Create(void *data) _CHECK_FAIL{ CMediaContentDbUpdateListener::Destroy(); } _CHECK_FAIL{ CUsbConnectionListener::Destroy(); } - _CHECK_FAIL{ m->pLayoutMgr->RemoveLayout(m->pFbMusicLayout); } - _CHECK_FAIL{ m->pLayoutMgr->RemoveLayout(m->pFbVideoLayout); } - _CHECK_FAIL{ m->pLayoutMgr->RemoveLayout(m->pFbPhotoLayout); } + //_CHECK_FAIL{ m->pLayoutMgr->RemoveLayout(m->pFbMusicLayout); } + //_CHECK_FAIL{ m->pLayoutMgr->RemoveLayout(m->pFbVideoLayout); } + //_CHECK_FAIL{ m->pLayoutMgr->RemoveLayout(m->pFbPhotoLayout); } _CHECK_FAIL{ m->pLayoutMgr->RemoveLayout(m->pFbAllLayout); } - _CHECK_FAIL{ m->pFbMusicLayout->Destroy(); } - _CHECK_FAIL{ m->pFbVideoLayout->Destroy(); } - _CHECK_FAIL{ m->pFbPhotoLayout->Destroy(); } + //_CHECK_FAIL{ m->pFbMusicLayout->Destroy(); } + //_CHECK_FAIL{ m->pFbVideoLayout->Destroy(); } + //_CHECK_FAIL{ m->pFbPhotoLayout->Destroy(); } _CHECK_FAIL{ m->pFbAllLayout->Destroy(); } - _CHECK_FAIL{ delete m->pFbMusicLayout; m->pFbMusicLayout = NULL; } - _CHECK_FAIL{ delete m->pFbVideoLayout; m->pFbVideoLayout = NULL; } - _CHECK_FAIL{ delete m->pFbPhotoLayout; m->pFbPhotoLayout = NULL; } + //_CHECK_FAIL{ delete m->pFbMusicLayout; m->pFbMusicLayout = NULL; } + //_CHECK_FAIL{ delete m->pFbVideoLayout; m->pFbVideoLayout = NULL; } + //_CHECK_FAIL{ delete m->pFbPhotoLayout; m->pFbPhotoLayout = NULL; } _CHECK_FAIL{ delete m->pFbAllLayout; m->pFbAllLayout = NULL; } _CHECK_FAIL{ m->pLayoutMgr->Destroy(); } _CHECK_FAIL{ delete m->pLayoutMgr; m->pLayoutMgr = NULL; } @@ -580,9 +580,9 @@ bool CFbBaseView::Create(void *data) // original create grid - m->pLayoutMgr->Show(FB_ALL_LAYOUT); CInfo::SetSortType(0/*CSort::SORT_NAME_AZ*/); evas_object_data_set(eoBase, BASE_VIEW_DATA, this); + m->pLayoutMgr->Show(FB_ALL_LAYOUT); t_CreateFullView(); elm_object_focus_allow_set(eoBase, EINA_FALSE); m->pHandlerBase->Connect(eoBase); @@ -598,6 +598,7 @@ void CFbBaseView::Destroy(void) CMediaContentDbUpdateListener::Destroy(); CUsbConnectionListener::Destroy(); +#if 0 m->pLayoutMgr->RemoveLayout(m->pFbMusicLayout); m->pFbMusicLayout->Destroy(); delete m->pFbMusicLayout; @@ -609,6 +610,7 @@ void CFbBaseView::Destroy(void) m->pLayoutMgr->RemoveLayout(m->pFbPhotoLayout); m->pFbPhotoLayout->Destroy(); delete m->pFbPhotoLayout; +#endif m->pLayoutMgr->RemoveLayout(m->pFbAllLayout); m->pFbAllLayout->Destroy(); @@ -655,6 +657,7 @@ void CFbBaseView::OnConnect(void) void CFbBaseView::OnUpdated(const SEntity *entity) { + _DBG(); m->pPopup->Destroy(); delete m->pPopup; m->pPopup = NULL; diff --git a/src/views/BaseView/FileGrid.cpp b/src/views/BaseView/FileGrid.cpp index 438e119..d331e4d 100644 --- a/src/views/BaseView/FileGrid.cpp +++ b/src/views/BaseView/FileGrid.cpp @@ -125,6 +125,7 @@ void CFileGrid::sm_CbUnrealized(void *data, Evas_Object *obj, void *event_info) void CFileGrid::Action(void) { + _DBG(); m->handle_itinfo = m->ctxt_itinfo; m_HandleSelection(); m_DeleteContextView(); @@ -138,6 +139,7 @@ void CFileGrid::m_DeleteContextView(void) void CFileGrid::sm_CbSelectItem(void *data, Elm_Object_Item *it, const char *emission, const char *source) { + _DBG(); CFileGrid* root = (CFileGrid*)data; SItemInfo *pItemInfo; @@ -315,6 +317,9 @@ void CFileGrid::t_Update(char *fid, bool sort_flag) sortType = SORT_BY_NAME_AZ; break; } + + //ASSERT(m->elFile); + m->elFile = CSort::Sort(m->elFile, sortType); t_Fill(); @@ -433,9 +438,11 @@ Evas_Object* CFileGrid::Grid(void) void CFileGrid::OnKeyUp(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Up *ev) { - _DBG(); Elm_Object_Item *it; SItemInfo *pItemInfo; + + if(ev->keyname) + _DBG("%s", ev->keyname); if (strcmp(ev->keyname, KEY_BACK) == 0) { if (m->depth == 0) { -- 2.7.4