Fixed issue 47315
[apps/osp/Gallery.git] / src / GlFileListEditorForm.cpp
index 2c33ea5..fe02b20 100644 (file)
@@ -120,15 +120,6 @@ FileListEditorForm::OnInitializing(void)
        SetOrientation(ORIENTATION_AUTOMATIC);
        AddOrientationEventListener(*this);
 
-       __pPopUp = new (std::nothrow) SlideShowPopUp();
-
-       if (__pPopUp != null)
-       {
-               __pPopUp->Initialize();
-               __pPopUp->SetEventListner(this);
-               AddControl(__pPopUp);
-       }
-
        __pPresentationModel = FileListPresentationModel::GetInstance();
        __pPresentationModel->ClearThumbnailRequests();
 
@@ -368,28 +359,45 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId)
                        __pShareContextMenu = null;
                }
 
+               Bitmap* pBitmapEmailContextItem = null;
+               Bitmap* pBitmapMessageContextItem = null;
+               pBitmapEmailContextItem = ResourceManager::GetBitmapN(IDB_IMAGE_CONTEXT_EMAIL_ICON);
+               pBitmapMessageContextItem = ResourceManager::GetBitmapN(IDB_IMAGE_CONTEXT_MESSAGE_ICON);
+
                __pShareContextMenu = new (std::nothrow) ContextMenu();
                __pShareContextMenu->Construct(Point(GetClientAreaBounds().width/3 + 15, GetClientAreaBounds().height),
                                CONTEXT_MENU_STYLE_LIST, CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD);
-               __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
-                               IDA_CONTEXT_MENU_SHARE_MESSAGE);
-               __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"),
-                               IDA_CONTEXT_MENU_SHARE_EMAIL);
+
+               if ( pBitmapMessageContextItem != null)
+               {
+                       __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
+                               IDA_CONTEXT_MENU_SHARE_MESSAGE, *pBitmapMessageContextItem, null, null);
+                       delete pBitmapMessageContextItem;
+               }
+
+               if ( pBitmapEmailContextItem != null)
+               {
+                       __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"),
+                               IDA_CONTEXT_MENU_SHARE_EMAIL, *pBitmapEmailContextItem, null, null);
+                       delete pBitmapEmailContextItem;
+               }
                __pShareContextMenu->SetFocusable(true);
                __pShareContextMenu->AddActionEventListener(*this);
 
-                       Rectangle rect = source.GetBounds();
-                       if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
-                       {
-                               __pShareContextMenu->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y));
-                       }
-                       else
-                       {
-                               __pShareContextMenu->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y - H_TOAST_LABEL));
-                       }
 
-                       __pShareContextMenu->SetShowState(true);
-                       __pShareContextMenu->Show();
+               Rectangle rect = source.GetBounds();
+
+               if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
+               {
+                       __pShareContextMenu->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y));
+               }
+               else
+               {
+                       __pShareContextMenu->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y - H_TOAST_LABEL));
+               }
+
+               __pShareContextMenu->SetShowState(true);
+               __pShareContextMenu->Show();
 
        }
        break;
@@ -474,8 +482,17 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId)
 
        case IDA_CONTEXT_MENU_MORE_SLIDE_SHOW:
        {
+               if (__pPopUp != NULL)
+               {
+                       delete __pPopUp;
+                       __pPopUp = NULL;
+               }
+               __pPopUp = new (std::nothrow) SlideShowPopUp();
+
                if (__pPopUp != null)
                {
+                       __pPopUp->Initialize();
+                       __pPopUp->SetEventListner(this);
                        __pPopUp->SetShowState(true);
                        __pPopUp->Show();
                }
@@ -982,11 +999,13 @@ FileListEditorForm::RefreshFolderList(void)
 
                loopCount = __pContentDirectoryNameList->GetCount();
 
+               String dirAllAlbums = L"All albums";
+
                for (int i = 0; i < loopCount; ++i)
                {
                        pDirName = static_cast<String*>(__pContentDirectoryNameList->GetAt(i));
 
-                       if (*pDirName != __pPresentationModel->GetCurrentAlbumName())
+                       if (*pDirName != __pPresentationModel->GetCurrentAlbumName() || *pDirName == dirAllAlbums)
                        {
                                __pOptionMenu->AddItem(*(new (std::nothrow) String(*pDirName)),
                                                IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START + i);
@@ -1145,7 +1164,7 @@ FileListEditorForm::OnKeyReleased(Control& source, const Tizen::Ui::KeyEventInfo
 {
        AppLogDebug("ENTER");
 
-       if(keyEventInfo.GetKeyCode() == KEY_BACK)
+       if(keyEventInfo.GetKeyCode() == KEY_BACK || keyEventInfo.GetKeyCode() == KEY_ESC)
        {
                _overlayMsg = false;
                __pDeletePopup->SetShowState(false);