Fixed prevent issue
[apps/osp/Gallery.git] / src / GlFileListEditorForm.cpp
index d7784a9..30f36f9 100644 (file)
@@ -25,6 +25,7 @@
 #include "GlFileListPresentationModel.h"
 #include "GlGalleryApp.h"
 #include "GlImageListEditorPanel.h"
+#include "GlProgressAnimation.h"
 #include "GlResourceManager.h"
 #include "GlSlideSettingListener.h"
 #include "GlSlideShowPopUp.h"
@@ -37,28 +38,31 @@ using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Content;
 using namespace Tizen::Graphics;
+using namespace Tizen::System;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
 using namespace Tizen::Base::Utility;
 
-static const int GAP_W_POPUP_ITEM = 5;
-static const int W_DELETE_POPUP = 600;
-static const int H_DELETE_POPUP = 300;
-static const int H_DELETE_LABEL = 180;
-static const int Y_DELETE_BUTTON = 180;
-static const int H_DELETE_BUTTON = 80;
+static const int GAP_W_POPUP_ITEM = 10;
+static const int W_DELETE_POPUP = 688;
+static const int H_DELETE_POPUP = 230;
+static const int H_DELETE_LABEL = 80;
+static const int Y_DELETE_BUTTON = 132;
+static const int H_DELETE_BUTTON = 74;
+static const int W_DELETE_BUTTON = 318;
 static const int H_TOAST_LABEL = 48;
+static const int Y_DELETE_LABEL = 32;
 
 static const unsigned int COLOR_DELETE_BUTTON_NORMAL = Color32<208, 82, 82>::Value;
 static const unsigned int COLOR_DELETE_BUTTON_PRESSED = Color32<194, 71, 71>::Value;
 static const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Value;
 
+static const String RESERVED_MEDIA_PATH = Environment::GetMediaPath();
+
 FileListEditorForm::FileListEditorForm(void)
-       : __pContextMenuMore(null)
-       , __pContextMenuShare(null)
-       , __pContextEditorMenuMove(null)
-       , __pContextSelectionMenuMove(null)
+       : __pShareContextMenu(null)
+       , __pOptionMenu(null)
        , __pDeletePopup(null)
        , __morePosition(Point(0, 0))
        , __pContentDirectoryList(null)
@@ -67,9 +71,11 @@ FileListEditorForm::FileListEditorForm(void)
        , __pFileMove(null)
        , __isCopyOperation(false)
        , __pPresentationModel(null)
+       , __isScanProgress(false)
 {
        AppLogDebug("ENTER");
        _overlayMsg = false;
+       _pProgressAnim = null;
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
@@ -78,12 +84,22 @@ FileListEditorForm::~FileListEditorForm(void)
        AppLogDebug("ENTER");
        if (__pContentDirectoryList != null)
        {
+               __pContentDirectoryList->RemoveAll(true);
                delete __pContentDirectoryList;
+               __pContentDirectoryList = null;
+       }
+
+       if (__pPopUp != null)
+       {
+               delete __pPopUp;
+               __pPopUp = null;
        }
 
        if (__pContentDirectoryNameList != null)
        {
+               __pContentDirectoryNameList->RemoveAll(true);
                delete __pContentDirectoryNameList;
+               __pContentDirectoryNameList = null;
        }
        delete __pFileMove;
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -93,12 +109,46 @@ result
 FileListEditorForm::Initialize(void)
 {
        AppLogDebug("ENTER");
-       result r = Construct(FORM_STYLE_NORMAL | FORM_STYLE_HEADER | FORM_STYLE_FOOTER);
+       result r = Construct(FORM_STYLE_NORMAL | FORM_STYLE_HEADER | FORM_STYLE_FOOTER | FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE | FORM_STYLE_PORTRAIT_INDICATOR_AUTO_HIDE);
+
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
        return r;
 }
 
+void
+FileListEditorForm::ShowAnimation()
+{
+       AppLogDebug("ENTER");
+       Rectangle clientRect= GetClientAreaBounds();
+       Rectangle rect(0, 0, clientRect.width, clientRect.height);
+       _pProgressAnim = new (std::nothrow) ProgressAnimation;
+       _pProgressAnim->Construct(rect);
+       AddControl(_pProgressAnim);
+       _pProgressAnim->SetShowState(true);
+       GetFooter()->SetEnabled(false);
+       _pProgressAnim->AnimationStart();
+       _pProgressAnim->Draw();
+       _overlayMsg = true;
+       AppLogDebug("EXIT");
+}
+
+void
+FileListEditorForm::StopAnimation(void)
+{
+       AppLogDebug("ENTER");
+       if (_pProgressAnim)
+       {
+               _pProgressAnim->AnimationStop();
+               _pProgressAnim->SetShowState(false);
+               RemoveControl(_pProgressAnim);
+               GetFooter()->SetEnabled(true);
+               _pProgressAnim = null;
+               _overlayMsg = false;
+       }
+       AppLogDebug("EXIT");
+}
+
 result
 FileListEditorForm::OnInitializing(void)
 {
@@ -106,14 +156,8 @@ FileListEditorForm::OnInitializing(void)
        Header* pHeader = GetHeader();
        TryReturn(pHeader != null, E_FAILURE, "[%s] fail to get the header.", GetErrorMessage(GetLastResult()));
 
-       __pPopUp = new (std::nothrow) SlideShowPopUp();
-
-       if (__pPopUp != null)
-       {
-               __pPopUp->Initialize();
-               __pPopUp->SetEventListner(this);
-               AddControl(*__pPopUp);
-       }
+       SetOrientation(ORIENTATION_AUTOMATIC);
+       AddOrientationEventListener(*this);
 
        __pPresentationModel = FileListPresentationModel::GetInstance();
        __pPresentationModel->ClearThumbnailRequests();
@@ -164,35 +208,23 @@ FileListEditorForm::InitializeFooter(void)
                        footerConfirm.SetText(ResourceManager::GetString(L"IDS_COM_SK_DONE"));
                        pFooter->AddItem(footerConfirm);
                        pFooter->SetItemEnabled(0, false);
+                       pFooter->SetShowState(true);
+                       pFooter->Invalidate(true);
                }
                else
                {
                        pFooter->SetStyle(FOOTER_STYLE_SEGMENTED_TEXT);
+                       pFooter->SetShowState(false);
+                       pFooter->Invalidate(true);
                }
-               pFooter->SetBackButton();
+
                SetFormBackEventListener(this);
+
        }
        else
        {
                pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
-
-               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;
+               SetFormMenuEventListener(this);
 
                FooterItem footerShare;
                r = footerShare.Construct(IDA_FOOTER_SHARE);
@@ -228,7 +260,6 @@ FileListEditorForm::InitializeFooter(void)
                delete pBitmapDeleteDim;
                TryReturn(r == E_SUCCESS, r, "[%s] Unable to add item", GetErrorMessage(r));
 
-               pFooter->SetBackButton();
                SetFormBackEventListener(this);
 
                SceneManager* pSceneManager = SceneManager::GetInstance();
@@ -253,51 +284,19 @@ FileListEditorForm::InitializeFooter(void)
 
                AppLogDebug("GetItemCheckedCount(%d)", checkedCount);
 
-               if (__pContextMenuMore != null)
+               if (__pOptionMenu != null)
                {
-                       delete __pContextMenuMore;
-                       __pContextMenuMore = null;
-               }
-
-               __pContextMenuMore = new (std::nothrow) ContextMenu();
-               __pContextMenuMore->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
-
-               __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MOVE"),
-                               IDA_CONTEXT_MENU_MORE_MOVE);
-               __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_COPY"),
-                                               IDA_CONTEXT_MENU_MORE_COPY);
-
-               if (checkedCount > 1)
-               {
-                       __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_SLIDESHOW"),
-                                       IDA_CONTEXT_MENU_MORE_SLIDE_SHOW);
+                       delete __pOptionMenu;
+                       __pOptionMenu = null;
                }
 
-               __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_LEFT"),IDA_CONTEXT_MENU_ROTATE_LEFT);
-               __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_RIGHT"),IDA_CONTEXT_MENU_ROTATE_RIGHT);
-
-               __pContextMenuMore->SetShowState(false);
-               __pContextMenuMore->AddActionEventListener(*this);
-
-               __pContextMenuShare = new (std::nothrow) ContextMenu();
-               __pContextMenuShare->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
-               __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
-                               IDA_CONTEXT_MENU_SHARE_MESSAGE);
-               __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"),
-                               IDA_CONTEXT_MENU_SHARE_EMAIL);
-               __pContextMenuShare->SetShowState(false);
-               __pContextMenuShare->AddActionEventListener(*this);
-
-               __pContextEditorMenuMove = new (std::nothrow) ContextMenu();
-               __pContextEditorMenuMove->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
-               __pContextEditorMenuMove->AddActionEventListener(*this);
-
-               __pContextSelectionMenuMove = new (std::nothrow) ContextMenu();
-               __pContextSelectionMenuMove->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
-               __pContextSelectionMenuMove->AddActionEventListener(*this);
+               __pOptionMenu = new (std::nothrow) OptionMenu();
+               __pOptionMenu->Construct();
+               __pOptionMenu->AddActionEventListener(*this);
 
                if (__pContentDirectoryNameList != null)
                {
+                       __pContentDirectoryNameList->RemoveAll(true);
                        delete __pContentDirectoryNameList;
                        __pContentDirectoryNameList = null;
                }
@@ -338,32 +337,19 @@ FileListEditorForm::OnTerminating(void)
 {
        AppLogDebug("ENTER");
        __pPresentationModel->RemoveContentEventListener(this);
-       if (__pContextMenuMore != null)
-       {
-               __pContextMenuMore->RemoveActionEventListener(*this);
-               delete __pContextMenuMore;
-               __pContextMenuMore = null;
-       }
 
-       if (__pContextMenuShare != null)
+       if (__pOptionMenu != null)
        {
-               __pContextMenuShare->RemoveActionEventListener(*this);
-               delete __pContextMenuShare;
-               __pContextMenuShare = null;
+               __pOptionMenu->RemoveActionEventListener(*this);
+               delete __pOptionMenu;
+               __pOptionMenu = null;
        }
 
-       if (__pContextEditorMenuMove != null)
+       if (__pShareContextMenu != null)
        {
-               __pContextEditorMenuMove->RemoveActionEventListener(*this);
-               delete __pContextEditorMenuMove;
-               __pContextEditorMenuMove = null;
-       }
-
-       if (__pContextSelectionMenuMove != null)
-       {
-               __pContextSelectionMenuMove->RemoveActionEventListener(*this);
-               delete __pContextSelectionMenuMove;
-               __pContextSelectionMenuMove = null;
+               __pShareContextMenu->RemoveActionEventListener(*this);
+               delete __pShareContextMenu;
+               __pShareContextMenu = null;
        }
 
        if (__pDeletePopup != null)
@@ -390,52 +376,54 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId)
                SelectAllPressed();
        break;
 
-       case IDA_FOOTER_MORE:
+       case IDA_FOOTER_SHARE:
        {
-               InitializeFooter();
+               if (__pShareContextMenu != NULL)
+               {
+                       delete __pShareContextMenu;
+                       __pShareContextMenu = null;
+               }
+
+               Bitmap* pBitmapEmailContextItem = null;
+               Bitmap* pBitmapMessageContextItem = null;
+               pBitmapEmailContextItem = ResourceManager::GetBitmapN(IDB_IMAGE_CONTEXT_EMAIL_ICON);
+               pBitmapMessageContextItem = ResourceManager::GetBitmapN(IDB_IMAGE_CONTEXT_MESSAGE_ICON);
 
-               if (__pContextMenuMore->GetShowState() == false)
+               __pShareContextMenu = new (std::nothrow) ContextMenu();
+               __pShareContextMenu->Construct(Point(GetClientAreaBounds().width/3 + 15, GetClientAreaBounds().height),
+                               CONTEXT_MENU_STYLE_LIST, CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD);
+
+               if ( pBitmapMessageContextItem != null)
                {
-                       Rectangle rect = source.GetBounds();
-                       __morePosition = Point(rect.width / 8, rect.y);
-                       if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
-                       {
-                               __pContextMenuMore->SetAnchorPosition(Point(rect.width / 10, rect.y));
-                       }
-                       else
-                       {
-                               __pContextMenuMore->SetAnchorPosition(Point(rect.width / 10, rect.y - H_TOAST_LABEL));
-                       }
-                       __pContextMenuMore->SetShowState(true);
-                       __pContextMenuMore->Show();
+                       __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
+                               IDA_CONTEXT_MENU_SHARE_MESSAGE, *pBitmapMessageContextItem, null, null);
+                       delete pBitmapMessageContextItem;
                }
-               else
+
+               if ( pBitmapEmailContextItem != null)
                {
-                       __pContextMenuMore->SetShowState(false);
+                       __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"),
+                               IDA_CONTEXT_MENU_SHARE_EMAIL, *pBitmapEmailContextItem, null, null);
+                       delete pBitmapEmailContextItem;
                }
-       }
-       break;
+               __pShareContextMenu->SetFocusable(true);
+               __pShareContextMenu->AddActionEventListener(*this);
 
-       case IDA_FOOTER_SHARE:
-       {
-               if (__pContextMenuShare->GetShowState() == false)
+
+               Rectangle rect = source.GetBounds();
+
+               if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
                {
-                       Rectangle rect = source.GetBounds();
-                       if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
-                       {
-                               __pContextMenuShare->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y));
-                       }
-                       else
-                       {
-                               __pContextMenuShare->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y - H_TOAST_LABEL));
-                       }
-                       __pContextMenuShare->SetShowState(true);
-                       __pContextMenuShare->Show();
+                       __pShareContextMenu->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y));
                }
                else
                {
-                       __pContextMenuShare->SetShowState(false);
+                       __pShareContextMenu->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y - H_TOAST_LABEL));
                }
+
+               __pShareContextMenu->SetShowState(true);
+               __pShareContextMenu->Show();
+
        }
        break;
 
@@ -507,40 +495,29 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId)
                {
                        __isCopyOperation = true;
                }
+
                RefreshFolderList();
-               if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
-               {
-                       if (__pContextEditorMenuMove->GetShowState() == false)
-                       {
-                               __pContextEditorMenuMove->SetAnchorPosition(Point(__morePosition.x, __morePosition.y - 48));
-                               __pContextEditorMenuMove->SetShowState(true);
-                               __pContextEditorMenuMove->Show();
-                       }
-                       else
-                       {
-                               __pContextEditorMenuMove->SetShowState(false);
-                       }
-               }
-               else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
-               {
-                       if (__pContextSelectionMenuMove->GetShowState() == false)
-                       {
-                               __pContextSelectionMenuMove->SetAnchorPosition(__morePosition);
-                               __pContextSelectionMenuMove->SetShowState(true);
-                               __pContextSelectionMenuMove->Show();
-                       }
-                       else
-                       {
-                               __pContextSelectionMenuMove->SetShowState(false);
-                       }
-               }
+
+               __pOptionMenu->SetShowState(true);
+               __pOptionMenu->Show();
+
+
        }
        break;
 
        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();
                }
@@ -610,29 +587,27 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId)
                        }
 
                }
-       }
-       break;
-
-       case IDA_CONTEXTMENU_SELECTION_MOVE_CREATE_ALBUM:
-       {
-               if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
+               else
                {
-                       AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
-                       (pSceneManager->GetCurrentScene()->GetPanel());
-
-                       if (pSelectionPanel != null)
+                       if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
                        {
-                               IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
-                               pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
-                               if (__isCopyOperation)
-                               {
-                                       pList->InsertAt(new (std::nothrow) Integer(FILE_ACTION_COPY), ALBUM_SECOND_ELEMENT);
-                               }
-                               else
+                               AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
+                               (pSceneManager->GetCurrentScene()->GetPanel());
+
+                               if (pSelectionPanel != null)
                                {
-                                       pList->InsertAt(new (std::nothrow) Integer(FILE_ACTION_MOVE), ALBUM_SECOND_ELEMENT);
+                                       IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
+                                       pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
+                                       if (__isCopyOperation)
+                                       {
+                                               pList->InsertAt(new (std::nothrow) Integer(FILE_ACTION_COPY), ALBUM_SECOND_ELEMENT);
+                                       }
+                                       else
+                                       {
+                                               pList->InsertAt(new (std::nothrow) Integer(FILE_ACTION_MOVE), ALBUM_SECOND_ELEMENT);
+                                       }
+                                       pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
                                }
-                               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
                        }
                }
        }
@@ -776,11 +751,9 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId)
                                        {
                                                delete __pFileMove;
                                                IList* pItemIndexList = pEditorPanel->GetItemCheckedIndexListN();
-                                               GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel);
                                                __pFileMove = new (std::nothrow) FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
                                                if (__isCopyOperation)
                                                {
-                                                       AppLogDebug("Rash: Setting to Copy in FileListEditorForm");
                                                        __pFileMove->SetCopy();
                                                }
 
@@ -801,18 +774,18 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId)
                }
                else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
                {
-                       if ((IDA_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START <= actionId) &&
-                                       (actionId <= IDA_CONTEXTMENU_SELECTION_MOVE_CREATE_ALBUM + 1000))
+                       if ((IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START <= actionId) &&
+                                       (actionId <= IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM + 1000))
                        {
                                if (__pContentDirectoryList == null)
                                {
 
                                        return;
                                }
-                               if (__pContentDirectoryList->GetCount() > actionId - IDA_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START)
+                               if (__pContentDirectoryList->GetCount() > actionId - IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START)
                                {
                                        String* pDirectory = static_cast<String*>
-                                       (__pContentDirectoryList->GetAt(actionId - IDA_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START));
+                                       (__pContentDirectoryList->GetAt(actionId - IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START));
 
                                        AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
                                                (pSceneManager->GetCurrentScene()->GetPanel());
@@ -821,11 +794,9 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId)
                                        {
                                                delete __pFileMove;
                                                IList* pItemIndexList = pSelectionPanel->GetItemCheckedIndexListN();
-                                               GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel);
                                                __pFileMove = new (std::nothrow) FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
                                                if (__isCopyOperation)
                                                {
-                                                       AppLogDebug("Rash: Setting to Copy in FileListEditorForm");
                                                        __pFileMove->SetCopy();
                                                }
                                                result r = __pFileMove->StartTimer();
@@ -855,6 +826,27 @@ FileListEditorForm::OnFileOpInvalidate(enum FileActionMode actionId)
        Invalidate(true);
 }
 
+
+void
+FileListEditorForm::OnScanDirStart()
+{
+       AppLogDebug("ENTER");
+       GetHeader()->SetButtonEnabled(BUTTON_POSITION_RIGHT, false);
+       __isScanProgress = true;
+       Invalidate(true);
+       AppLogDebug("EXIT");
+}
+void
+FileListEditorForm::OnScanDirComplete()
+{
+       AppLogDebug("ENTER");
+       GetHeader()->SetButtonEnabled(BUTTON_POSITION_RIGHT, true);
+       __isScanProgress = false;
+       Invalidate(true);
+       AppLogDebug("EXIT");
+}
+
+
 bool
 FileListEditorForm::GetOverlayStatus(void) const
 {
@@ -864,6 +856,7 @@ FileListEditorForm::GetOverlayStatus(void) const
 void
 FileListEditorForm::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
 {
+       AppLogDebug("ENTER");
        _overlayMsg = false;
        __pPresentationModel->SetUpdateProgressStatus(false);
        if (res != COMPLETE_SUCCESS)
@@ -878,6 +871,7 @@ FileListEditorForm::OnFileOpComplete(enum FileActionMode actionId, enum FileActi
                AppAssert(pSceneManager);
                pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
        }
+       AppLogDebug("EXIT");
 }
 
 void
@@ -898,6 +892,23 @@ FileListEditorForm::OnContentUpdated()
                }
        }
 
+       if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
+       {
+               AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
+               if (pEditorPanel != null)
+               {
+                       pEditorPanel->CancelUpdateProgress();
+               }
+       }
+       else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
+       {
+               AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
+               if (pSelectionPanel != null)
+               {
+                       pSelectionPanel->CancelUpdateProgress();
+               }
+       }
+
        if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK
                        && pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
        {
@@ -907,7 +918,8 @@ FileListEditorForm::OnContentUpdated()
        }
        else if (_overlayMsg == false)
        {
-               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
+               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
+                               SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY));
        }
 
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -927,32 +939,33 @@ FileListEditorForm::SetUpPopup(void)
 
        __pDeletePopup = new (std::nothrow) Popup();
        __pDeletePopup->Construct(false, Dimension(W_DELETE_POPUP, H_DELETE_POPUP));
+       __pDeletePopup->SetPropagatedKeyEventListener(this);
 
        Rectangle popupClientBounds = __pDeletePopup->GetClientAreaBounds();
 
        Label* pLabelText = new (std::nothrow) Label();
-       pLabelText->Construct(Rectangle(0, 0, popupClientBounds.width, H_DELETE_LABEL),
+       pLabelText->Construct(Rectangle(0, Y_DELETE_LABEL, popupClientBounds.width, H_DELETE_LABEL),
                        ResourceManager::GetString(L"IDS_COM_POP_DELETE_Q"));
        pLabelText->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
        pLabelText->SetTextConfig(34,LABEL_TEXT_STYLE_BOLD);
-       __pDeletePopup->AddControl(*pLabelText);
+       __pDeletePopup->AddControl(pLabelText);
 
        Button* pDeleteButton = new (std::nothrow) Button();
-       pDeleteButton->Construct(Rectangle(0, Y_DELETE_BUTTON, popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON),
+       pDeleteButton->Construct(Rectangle(popupClientBounds.width / 2 + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON, W_DELETE_BUTTON, H_DELETE_BUTTON),
                        ResourceManager::GetString(L"IDS_COM_BODY_DELETE"));
        pDeleteButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_DELETE_BUTTON_NORMAL);
        pDeleteButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_DELETE_BUTTON_PRESSED);
        pDeleteButton->SetTextColor(COLOR_DELETE_BUTTON_TEXT);
        pDeleteButton->SetActionId(IDA_DELETE_POPUP_DEL);
        pDeleteButton->AddActionEventListener(*this);
-       __pDeletePopup->AddControl(*pDeleteButton);
+       __pDeletePopup->AddControl(pDeleteButton);
 
        Button* pButtonCancel = new (std::nothrow) Button();
-       pButtonCancel->Construct(Rectangle(popupClientBounds.width / 2 + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON,
-                       popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON), ResourceManager::GetString(L"IDS_COM_POP_CANCEL"));
+       pButtonCancel->Construct(Rectangle(16, Y_DELETE_BUTTON, W_DELETE_BUTTON, H_DELETE_BUTTON),
+                       ResourceManager::GetString(L"IDS_COM_POP_CANCEL"));
        pButtonCancel->SetActionId(IDA_DELETE_POPUP_CANCEL);
        pButtonCancel->AddActionEventListener(*this);
-       __pDeletePopup->AddControl(*pButtonCancel);
+       __pDeletePopup->AddControl(pButtonCancel);
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
        return r;
@@ -987,38 +1000,63 @@ FileListEditorForm::RefreshFolderList(void)
 
        if (__pContentDirectoryList != null)
        {
+               __pContentDirectoryList->RemoveAll(true);
                delete __pContentDirectoryList;
+               __pContentDirectoryList = null;
        }
        __pContentDirectoryList = contentDirectory.GetContentDirectoryPathListN(SORT_ORDER_NONE);
+
+       if (__pContentDirectoryNameList != NULL)
+       {
+               __pContentDirectoryNameList->RemoveAll(true);
+               delete __pContentDirectoryNameList;
+               __pContentDirectoryNameList = null;
+       }
+
        __pContentDirectoryNameList = new (std::nothrow) ArrayList(SingleObjectDeleter);
        String* pDirPath = null;
        String* pDirName = null;
+       String mediaPath = RESERVED_MEDIA_PATH;
+       int length = mediaPath.GetLength();
+       mediaPath.Remove(length-1,1);
 
        int loopCount = __pContentDirectoryList->GetCount();
        for (int i = 0; i < loopCount; ++i)
        {
                pDirPath = static_cast<String*>(__pContentDirectoryList->GetAt(i));
                pDirName = new (std::nothrow) String(GetDirecotyNameFromFullPath(*pDirPath));
-               __pContentDirectoryNameList->Add(pDirName);
-       }
-       __pContextEditorMenuMove->RemoveAllItems();
-       __pContextEditorMenuMove->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_CREATE_ALBUM"),
-                       IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM);
-       __pContextSelectionMenuMove->RemoveAllItems();
-       __pContextSelectionMenuMove->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_CREATE_ALBUM"),
-                       IDA_CONTEXTMENU_SELECTION_MOVE_CREATE_ALBUM);
 
-       loopCount = __pContentDirectoryNameList->GetCount();
-       for (int i = 0; i < loopCount; ++i)
-       {
-               pDirName = static_cast<String*>(__pContentDirectoryNameList->GetAt(i));
-               __pContextEditorMenuMove->AddItem(*(new (std::nothrow) String(*pDirName)),
-                               IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START + i);
-               __pContextSelectionMenuMove->AddItem(*(new (std::nothrow) String(*pDirName)),
-                               IDA_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START + i);
+               if (*pDirPath == mediaPath)
+               {
+                       *pDirName = ResourceManager::GetString(L"IDS_MEDIABR_POP_NO_NAME");
+                       __pContentDirectoryNameList->Add(pDirName);
+               }
+               else
+               {
+                       __pContentDirectoryNameList->Add(pDirName);
+               }
        }
-       __pContextEditorMenuMove->SetShowState(false);
-       __pContextSelectionMenuMove->SetShowState(false);
+
+               __pOptionMenu->RemoveAllItems();
+               __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_CREATE_ALBUM"),
+                               IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM);
+
+               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() || *pDirName == dirAllAlbums)
+                       {
+                               __pOptionMenu->AddItem(*(new (std::nothrow) String(*pDirName)),
+                                               IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START + i);
+                       }
+               }
+
+
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
@@ -1027,6 +1065,12 @@ FileListEditorForm::OnFormBackRequested(Form& source)
 {
        AppLogDebug("ENTER");
 
+       if(__isScanProgress)
+       {
+               AppLog (" Skip the call");
+               return;
+       }
+
        SceneManager* pSceneManager = SceneManager::GetInstance();
        TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
 
@@ -1057,18 +1101,25 @@ FileListEditorForm::OnFormBackRequested(Form& source)
                }
                else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
                {
-                       AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
-                               (pSceneManager->GetCurrentScene()->GetPanel());
-                       if (pSelectionPanel != null)
+                       if (__pShareContextMenu != null && __pShareContextMenu->GetShowState() == true)
                        {
-                               IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
-                               if (pList == null)
+                               __pShareContextMenu->SetShowState(false);
+                       }
+                       else
+                       {
+                               AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
+                               (pSceneManager->GetCurrentScene()->GetPanel());
+                               if (pSelectionPanel != null)
                                {
-                                       pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
-                               }
+                                       IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
+                                       if (pList == null)
+                                       {
+                                               pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+                                       }
 
-                               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST_EDITOR, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
-                                                  SCENE_HISTORY_OPTION_ADD_HISTORY, SCENE_DESTROY_OPTION_DESTROY), pList);
+                                       pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST_EDITOR, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
+                                                       SCENE_HISTORY_OPTION_ADD_HISTORY, SCENE_DESTROY_OPTION_DESTROY), pList);
+                               }
                        }
                }
                else
@@ -1103,13 +1154,11 @@ FileListEditorForm::SetFooterButtonsState(const bool enableState)
        {
                if (enableState == true)
                {
-                       pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
                        pFooter->SetItemEnabled(0, true);
                        pFooter->SetItemEnabled(1, true);
                }
                else
                {
-                       pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
                        pFooter->SetItemEnabled(0, false);
                        pFooter->SetItemEnabled(1, false);
                }
@@ -1118,6 +1167,71 @@ FileListEditorForm::SetFooterButtonsState(const bool enableState)
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
+void
+FileListEditorForm::OnOrientationChanged(const Tizen::Ui::Control &source, Tizen::Ui::OrientationStatus orientationStatus)
+{
+       AppLogDebug("ENTER");
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       pSceneManager->GetCurrentScene();
+
+       if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
+       {
+               AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
+               if (pEditorPanel != null)
+               {
+                       pEditorPanel->ChangeOrientation();
+               }
+       }
+       else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
+       {
+               ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
+               if (pEditorPanel != null)
+               {
+                       pEditorPanel->ChangeOrientation();
+               }
+       }
+       else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
+       {
+               VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
+               if (pEditorPanel != null)
+               {
+                       pEditorPanel->ChangeOrientation();
+               }
+       }
+       else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
+       {
+               AllListSelectionPanel* pEditorPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
+               if (pEditorPanel != null)
+               {
+                       pEditorPanel->ChangeOrientation();
+               }
+       }
+
+       if (_pProgressAnim != null)
+       {
+               _pProgressAnim->ChangeOrientation(Form::GetBounds());
+               _pProgressAnim->Invalidate(true);
+       }
+
+       AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+}
+
+bool
+FileListEditorForm::OnKeyReleased(Control& source, const Tizen::Ui::KeyEventInfo& keyEventInfo)
+{
+       AppLogDebug("ENTER");
+
+       if(keyEventInfo.GetKeyCode() == KEY_BACK || keyEventInfo.GetKeyCode() == KEY_ESC)
+       {
+               _overlayMsg = false;
+               __pDeletePopup->SetShowState(false);
+               __pDeletePopup->Invalidate(true);
+       }
+       AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+
+       return false;
+}
+
 result
 FileListEditorForm::MoveToAlbum(const String& destDirectory)
 {
@@ -1237,3 +1351,80 @@ FileListEditorForm::OnSceneActivatedN(const SceneId& previousSceneId, const Scen
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
+void
+FileListEditorForm::OnFormMenuRequested (Tizen::Ui::Controls::Form &source)
+{
+       if(__isScanProgress)
+       {
+               return;
+       }
+
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       int checkedCount = 0;
+
+       if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
+       {
+               AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
+               if (pEditorPanel != null)
+               {
+                       checkedCount = pEditorPanel->GetItemCheckedCount();
+               }
+       }
+       else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
+       {
+               AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
+               if (pSelectionPanel != null)
+               {
+                       checkedCount = pSelectionPanel->GetItemCheckedCount();
+               }
+       }
+
+       if (__pShareContextMenu != null && __pShareContextMenu->GetShowState() == true)
+       {
+               __pShareContextMenu->SetShowState(false);
+       }
+
+       if (checkedCount < 2 &&  __pPresentationModel->GetCurrentAlbumName() == ALL_ALBUMS_REAL_NAME  )
+       {
+          return;  // no option Menu items in this case
+       }
+
+       if (checkedCount > 0)
+       {
+               if (__pOptionMenu == null)
+               {
+                       return;
+               }
+
+               __pOptionMenu->RemoveAllItems();
+
+               if ( __pPresentationModel->GetCurrentAlbumName() != ALL_ALBUMS_REAL_NAME )
+               {
+               __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MOVE"),
+                               IDA_CONTEXT_MENU_MORE_MOVE);
+               __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_COPY"),
+                               IDA_CONTEXT_MENU_MORE_COPY);
+               }
+
+               if (checkedCount > 1)
+               {
+                       __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_SLIDESHOW"),
+                                       IDA_CONTEXT_MENU_MORE_SLIDE_SHOW);
+               }
+
+               if ( __pPresentationModel->GetCurrentAlbumName() != ALL_ALBUMS_REAL_NAME )
+               {
+               __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_LEFT"),IDA_CONTEXT_MENU_ROTATE_LEFT);
+               __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_RIGHT"),IDA_CONTEXT_MENU_ROTATE_RIGHT);
+               }
+
+               __pOptionMenu->SetShowState(true);
+               __pOptionMenu->Show();
+       }
+}
+
+void
+FileListEditorForm::SetProgressState(const bool progressState)
+{
+       __isScanProgress = progressState;
+}