Arrange code
[apps/osp/Gallery.git] / src / GlAllListSelectionPanel.cpp
index 2448bb7..95f6ae6 100644 (file)
@@ -124,7 +124,6 @@ AllListSelectionPanel::OnTerminating(void)
        AppLogDebug("ENTER");
        result r = E_SUCCESS;
        __pPresentationModel->RemovePresentationModelListener(*this);
-       __pPresentationModel->RemoveContentEventListener(__pFileListEditorForm);
        if (__pSeletedIndexList != null)
        {
                delete __pSeletedIndexList;
@@ -281,6 +280,9 @@ AllListSelectionPanel::OnSceneActivatedN(const SceneId& previousSceneId,
                const SceneId& currentSceneId, IList* pArgs)
 {
        AppLogDebug("ENTER");
+
+       ChangeOrientation();
+
        __pPresentationModel = FileListPresentationModel::GetInstance();
 
        SceneManager* pSceneManager = SceneManager::GetInstance();
@@ -472,7 +474,8 @@ void AllListSelectionPanel::OnFileOpComplete(enum FileActionMode actionId, enum
 
        if (GetItemCount() > 0)
        {
-               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));
        }
        else
        {
@@ -481,6 +484,18 @@ void AllListSelectionPanel::OnFileOpComplete(enum FileActionMode actionId, enum
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
+void
+AllListSelectionPanel::ChangeOrientation()
+{
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       const Form* pForm = dynamic_cast<Form*>(pSceneManager->GetCurrentScene()->GetForm());
+       TryReturn(pForm != null,, "[%s] fail to get the form.", GetErrorMessage(GetLastResult()));
+
+       Rectangle clientAreaBounds = pForm->GetClientAreaBounds();
+       SetBounds(0, 0, clientAreaBounds.width, clientAreaBounds.height);
+       __pContentIconListView->SetBounds(0, 0, clientAreaBounds.width, clientAreaBounds.height);
+}
+
 result
 AllListSelectionPanel::OnRequestMessage(void)
 {
@@ -653,10 +668,7 @@ AllListSelectionPanel::ResetSelection(void)
        String bodyText = ResourceManager::GetString(L"IDS_COM_BODY_SELECTED");
        strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)", bodyText.GetPointer(), __itemCount);
        __pFileListEditorForm->SetTitleText(strTmp);
-       if (__pContentIconListView != null)
-       {
-               __pContentIconListView->UpdateList();
-       }
+
        SetButtonState();
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
@@ -768,3 +780,12 @@ AllListSelectionPanel::OnRotateRequested(RotateMode rotateMode)
        return E_SUCCESS;
 }
 
+void AllListSelectionPanel::CancelUpdateProgress(void)
+{
+       if (__pFileUpdateTimer!= null && __pFileUpdateTimer->IsStarted())
+       {
+               __pFileUpdateTimer->Cancel();
+               delete __pFileUpdateTimer;
+               __pFileUpdateTimer = null;
+       }
+}