Removed Context Menu, used option menu
[apps/osp/Gallery.git] / src / GlAlbumListForm.cpp
index dc4c9ec..143a193 100644 (file)
@@ -42,10 +42,8 @@ static const int W_FOLDER_SIZE = 348;
 static const int H_FOLDER_SIZE = 348;
 
 AlbumListForm::AlbumListForm(void)
-       : __isHWBackButtonExist(false)
-       , __itemCount(0)
+       : __itemCount(0)
        , __pAlbumViewIconList(null)
-       , __pContextMenuMore(null)
        , __pOptionMenu(null)
        , __pPresentationModel(null)
 
@@ -75,12 +73,6 @@ AlbumListForm::OnInitializing(void)
 {
        AppLogDebug("ENTER");
        result r = E_SUCCESS;
-       GalleryApp* pApp = static_cast<GalleryApp*>(GalleryApp::GetInstance());
-
-        __isHWBackButtonExist = false;
-        __isHWBackButtonExist = pApp->IsHwKeySupported();
-       AppLogDebug("EXIT(%s)", GetErrorMessage(r));
-
 
        __pPresentationModel = AlbumListPresentationModel::GetInstance();
        __pPresentationModel->ClearThumbnailRequests();
@@ -172,6 +164,7 @@ AlbumListForm::InitializeFooter(void)
        {
                pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON);
                pFooter->SetBackButton();
+               pFooter->SetMenuButton();
                pFooter->RemoveAllItems();
 
                FooterItem itemCamera;
@@ -185,46 +178,16 @@ AlbumListForm::InitializeFooter(void)
                pFooter->AddItem(itemCamera);
                delete pBitmap1;
 
-
-               if( __isHWBackButtonExist == false )
-               {
-                       ButtonItem footerMore;
-                       footerMore.Construct(BUTTON_ITEM_STYLE_ICON, IDA_FOOTER_MORE);
-
-                       Bitmap* pBitmapMore = ResourceManager::GetBitmapN(IDB_CONTROLBAR_MORE);
-                       Bitmap* pBitmapMoreDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_MORE_DISABLED);
-                       Bitmap* pBitmapMorePressed = ResourceManager::GetBitmapN(IDB_CONTROLBAR_MORE_PRESSED);
-
-                       if (pBitmapMore != null && pBitmapMoreDim != null && pBitmapMorePressed != null)
-                       {
-                               footerMore.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitmapMore);
-                               footerMore.SetIcon(BUTTON_ITEM_STATUS_DISABLED, pBitmapMoreDim);
-                               footerMore.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitmapMorePressed);
-                       }
-
-                       pFooter->SetButton(BUTTON_POSITION_LEFT, footerMore);
-                       delete pBitmapMore;
-                       delete pBitmapMoreDim;
-                       delete pBitmapMorePressed;
-
-                       __pContextMenuMore = new (std::nothrow) ContextMenu();
-                       __pContextMenuMore->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
-                       __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_COM_HEADER_EDIT"), IDA_FOOTER_EDIT);
-                       __pContextMenuMore->SetShowState(false);
-                       __pContextMenuMore->AddActionEventListener(*this);
-               }
-               else
-               {
-                           __pOptionMenu = new (std::nothrow) OptionMenu();
-                           __pOptionMenu->Construct();
-                           __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_HEADER_EDIT"),IDA_FOOTER_EDIT);
-                           __pOptionMenu->SetShowState(false);
-                           __pOptionMenu->AddActionEventListener(*this);
-                           SetFormMenuEventListener(this);
-               }
-
+               __pOptionMenu = new (std::nothrow) OptionMenu();
+               __pOptionMenu->Construct();
+               __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_HEADER_EDIT"),IDA_FOOTER_EDIT);
+               __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_HEADER_EDIT"), IDA_FOOTER_EDIT);
+               __pOptionMenu->SetShowState(false);
+               __pOptionMenu->AddActionEventListener(*this);
+               SetFormMenuEventListener(this);
                SetFormBackEventListener(this);
        }
+
        pFooter->AddActionEventListener(*this);
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
@@ -393,22 +356,6 @@ AlbumListForm::OnActionPerformed(const Control& source, int actionId)
        }
        break;
 
-       case IDA_FOOTER_MORE:
-       {
-               if (__pContextMenuMore->GetShowState() == false && __pPresentationModel->GetFolderCount() != 0)
-               {
-                       Rectangle rect = source.GetBounds();
-                       __pContextMenuMore->SetAnchorPosition(Point(rect.width/10, rect.y));
-                       __pContextMenuMore->SetShowState(true);
-                       __pContextMenuMore->Show();
-               }
-               else
-               {
-                       __pContextMenuMore->SetShowState(false);
-               }
-       }
-       break;
-
        default:
                break;
        }
@@ -471,11 +418,11 @@ AlbumListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId&
 
        if ( __itemCount == 0 )
        {
-               GetFooter()->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
+               GetFooter()->SetMenuButtonEnabled(false);
        }
        else
        {
-               GetFooter()->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
+               GetFooter()->SetMenuButtonEnabled(true);
        }
 
        if (__pAlbumViewIconList != null)
@@ -500,11 +447,6 @@ AlbumListForm::OnContentUpdated(void)
 {
        AppLogDebug("ENTER");
 
-       if(__pContextMenuMore != null && __pContextMenuMore ->GetShowState() == true)
-       {
-               __pContextMenuMore->SetShowState(false);
-       }
-
        if ( __pOptionMenu != null && __pOptionMenu ->GetShowState() == true)
        {
                __pOptionMenu->SetShowState(false);
@@ -537,11 +479,11 @@ AlbumListForm::OnContentUpdated(void)
 
        if (__itemCount == 0 )
        {
-               GetFooter()->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
+               GetFooter()->SetMenuButtonEnabled(false);
        }
        else
        {
-               GetFooter()->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
+               GetFooter()->SetMenuButtonEnabled(true);
        }
 
        GetFooter()->Invalidate(true);