#include "GlAlbumEventListener.h"
#include "GlFormContentUpdateEventListener.h"
#include "GlBaseForm.h"
+#include "GlFileDeleteTimer.h"
class AlbumListPresentationModel;
class AlbumListEditorForm
, public Tizen::Ui::Controls::IIconListViewItemProvider
, public Tizen::Ui::Scenes::ISceneEventListener
, public IAlbumEventListener
+ , public IFileOpInvalidateListener
, public IFormContentUpdateEventListener
{
public:
virtual void OnFileInfoChanged(const Tizen::Content::ContentType contentType);
virtual void OnThumbnailDecoded(const int index);
+ virtual void OnFileOpInvalidate(enum FileActionMode __actionId);
+ virtual void OnFileOpComplete(enum FileActionMode __actionId, enum FileActionCompleteRes);
+
private:
result InitializeControl(void);
result InitializePopup(void);
void OnRequestEmail(void);
result DeleteFolder(void);
- int GetCheckedFolder(void);
+ int GetCheckedFolderCount(void);
+ Tizen::Base::Collection::IList* GetItemCheckedIndexListN(void) const;
result Update(void);
void SetFooterButtonsState(bool enableState);
void SetButtonState(void);
Tizen::Ui::Controls::ContextMenu* __pShareContextMenu;
Tizen::Ui::Controls::Popup* __pDeletePopup;
AlbumListPresentationModel* __pPresentationModel;
+ FileDeleteTimer* __pFileDeleteTimer;
};
#endif /* _GL_ALBUM_LIST_EDITOR_FORM_H_ */
#include <FUi.h>
#include "GlAlbumEventListener.h"
#include "GlFormContentUpdateEventListener.h"
+#include "GlIContentFileDeleteManager.h"
#include "GlResourceManager.h"
#include "GlThumbnailEventListener.h"
#include "GlThumbnailProvider.h"
class AlbumListPresentationModel
: public Tizen::Base::Object
+ , public IContentFileDeleteManager
, public IThumbnailEventListener
, public Tizen::Content::IContentScanListener
, public Tizen::System::IDeviceEventListener
const Tizen::Base::Collection::HashMap* pDataList, Tizen::App::IAppControlResponseListener* pListener);
void InitializeAlbumInfoList(const Tizen::Content::ContentType& contentType);
- result DeleteContentInfoInDirectory(int index, Tizen::Content::ContentType contentType);
void CallAlbumChangedEvent(void);
int GetFolderCount(void);
result RenameAlbum(const Tizen::Base::String&, const Tizen::Base::String&, IAlbumRenameEventListener*);
+ virtual Tizen::Base::Collection::IList* GetContentIdListAtIndexN(const Tizen::Base::Collection::IList& indexList);
+ virtual result DeleteContentFile(const Tizen::Content::ContentId& contentId);
+
virtual void OnThumbnailReceivedN(Tizen::Base::Runtime::IEventArg& eventArg);
virtual void OnContentScanCompleted (RequestId reqId, const Tizen::Base::String &scanPath, result r);
void OnContentDeleted(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r);
virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state);
+ void SetUpdateProgressStatus(bool status);
private:
AlbumListPresentationModel(void);
AppControlMode __appControlMode;
AppControlMediaType __appControlMediaType;
AppControlSelectionMode __appControlSelectionMode;
+ bool __updateProgressStatus;
};
#endif /* _GL_ALBUM_LIST_PRESENTATION_MODEL_H_ */
#ifndef _GL_FILE_DELETE_TIMER_H_
#define _GL_FILE_DELETE_TIMER_H_
+#include "GlIContentFileDeleteManager.h"
#include "GlTimerBase.h"
class FileListPresentationModel;
: public GlTimerBase
{
public:
- FileDeleteTimer(Tizen::Base::Collection::IList*, FileListPresentationModel*, IFileOpInvalidateListener*);
+ FileDeleteTimer(Tizen::Base::Collection::IList*, IContentFileDeleteManager*, IFileOpInvalidateListener*);
virtual ~FileDeleteTimer(void);
private:
private :
Tizen::Base::Collection::IList* __pDeleteIndexList;
- FileListPresentationModel* __pPresentationModel;
+ IContentFileDeleteManager* __pFileDeleteManager;
};
#endif // _GL_FILE_DELETE_TIMER_H_
#include "GlAlbumEventListener.h"
#include "GlFormContentUpdateEventListener.h"
#include "GlCommonUtil.h"
+#include "GlIContentFileDeleteManager.h"
#include "GlResourceManager.h"
#include "GlThumbnailEventListener.h"
#include "GlTypes.h"
class FileListPresentationModel
: public Tizen::Base::Object
+ , public IContentFileDeleteManager
, public IThumbnailEventListener
{
public:
Tizen::Content::ContentId GetContentInfoIndex(int index);
Tizen::Base::String GetContentFilePath(int index);
Tizen::Base::String ConvertToAlbumName(const Tizen::Base::String& targetPath)const;
- Tizen::Base::Collection::IList* GetContentIdListN(const Tizen::Base::Collection::IList& contentInfoList);
+
+ virtual Tizen::Base::Collection::IList* GetContentIdListAtIndexN(const Tizen::Base::Collection::IList& indexList);
AppControlMode GetAppControlMode(void) const;
AppControlMediaType GetAppControlMediaType(void) const;
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file GlIContentFileDeleteManager.h
+ * @brief This is the header file for IContentFileDeleteManager class.
+ */
+
+#ifndef _GL_ICONTENT_FILE_DELETE_MANAGER_H_
+#define _GL_ICONTENT_FILE_DELETE_MANAGER_H_
+
+#include <FBase.h>
+
+class IContentFileDeleteManager
+{
+public:
+ IContentFileDeleteManager(){}
+ virtual ~IContentFileDeleteManager(){}
+ virtual Tizen::Base::Collection::IList* GetContentIdListAtIndexN(const Tizen::Base::Collection::IList& indexList) = 0;
+ virtual result DeleteContentFile(const Tizen::Content::ContentId& contentId) = 0;
+};
+
+#endif /* _GL_ICONTENT_FILE_DELETE_MANAGER_H_ */
, __pShareContextMenu(null)
, __pDeletePopup(null)
, __pPresentationModel(null)
+ , __pFileDeleteTimer(null)
{
AppLogDebug("ENTER");
__overlayMsg = false;
__pPresentationModel = AlbumListPresentationModel::GetInstance();
__pPresentationModel->ClearThumbnailRequests();
__pPresentationModel->AddPresentationModelListener(this);
- __pPresentationModel->AddContentEventListener(this);
SetFormBackEventListener(this);
GetHeader()->AddActionEventListener(*this);
{
AppLogDebug("ENTER");
__pPresentationModel->RemovePresentationModelListener(*this);
- __pPresentationModel->RemoveContentEventListener(*this);
if (__pDeletePopup != null)
{
delete __pDeletePopup;
__pDeletePopup = null;
}
+ if (__pFileDeleteTimer != null)
+ {
+ delete __pFileDeleteTimer;
+ __pFileDeleteTimer = null;
+ }
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
return E_SUCCESS;
String tempString;
CreateIconListView();
- __checkedCount = GetCheckedFolder();
+ __checkedCount = GetCheckedFolderCount();
__pSelectCountLabel = static_cast<Label*>(GetControl(L"IDC_LABEL_ALBUM_LIST_EDITOR_SELECTED"));
AppAssert(__pSelectCountLabel);
if (status == ICON_LIST_VIEW_ITEM_CHECKED || status == ICON_LIST_VIEW_ITEM_UNCHECKED)
{
- if (status == ICON_LIST_VIEW_ITEM_CHECKED)
+ if (status == ICON_LIST_VIEW_ITEM_CHECKED) //to be unchecked after this call
{
- ++__checkedCount;
+ --__checkedCount;
}
- else if (status == ICON_LIST_VIEW_ITEM_UNCHECKED)
+ else if (status == ICON_LIST_VIEW_ITEM_UNCHECKED) //will get checked after this call hence increment
{
- --__checkedCount;
+ ++__checkedCount;
}
String tempString;
}
else
{
- tempString.Format(FORMAT_BUFFER_SIZE,
- ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), __checkedCount);
+ tempString.Format(FORMAT_BUFFER_SIZE, ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), __checkedCount);
}
__pSelectCountLabel->SetText(tempString);
result
AlbumListEditorForm::DeleteFolder()
{
- AppLogDebug("ENTER");
- int maxCount = __pPresentationModel->GetFolderCount();
- result r = E_FAILURE;
- int checkedCount = 0;
+ AppLogDebug("ENTER");
+ IList* pIndexList = GetItemCheckedIndexListN();
+ if (pIndexList->GetCount() <= 0)
+ {
+ delete pIndexList;
+ AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
+ return E_FAILURE;
+ }
- for (int i = 0 ; i < maxCount; ++i)
+ if (__pFileDeleteTimer != null)
{
- if (__pEditorFolderIconList->IsItemChecked(i) == true)
- {
- ++checkedCount;
- __pPresentationModel->DeleteContentInfoInDirectory(i, CONTENT_TYPE_ALL);
- if (i == 0)
- {
- break;
- }
- }
+ delete __pFileDeleteTimer;
}
+ __pFileDeleteTimer = new FileDeleteTimer(pIndexList, __pPresentationModel, this);
+ result r = __pFileDeleteTimer->StartTimer();
- if (checkedCount == 0)
+ if (IsFailed(r))
{
- r = E_FAILURE;
+ delete __pFileDeleteTimer;
+ __pFileDeleteTimer = null;
+ return E_FAILURE;
}
else
{
- r = E_SUCCESS;
+ __pPresentationModel->SetUpdateProgressStatus(true);
}
+ return E_SUCCESS;
+}
- SetAllCheckState(false);
- __pPresentationModel->InitializeAlbumInfoList(CONTENT_TYPE_ALL);
- __pEditorFolderIconList->UpdateList();
+IList*
+AlbumListEditorForm::GetItemCheckedIndexListN(void) const
+{
+ AppLogDebug("ENTER");
+ IList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ Integer* pIndex = null;
+
+ if (__pEditorFolderIconList!=null)
+ {
+ int loopCount = __pPresentationModel->GetFolderCount();
+ for (int i = 0; i < loopCount; ++i)
+ {
+ if (__pEditorFolderIconList->IsItemChecked(i) == true)
+ {
+ pIndex = new (std::nothrow) Integer(i);
+ pList->Add(pIndex);
+ AppLogDebug("checked index(%d)", i);
+ }
+ }
+ }
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
- return r;
+ return pList;
}
void
__pEditorFolderIconList->Draw();
__pSelectCountLabel->SetText(tempString);
__pSelectCountLabel->RequestRedraw();
- __checkedCount = GetCheckedFolder();
+ __checkedCount = GetCheckedFolderCount();
SetButtonState();
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
int
-AlbumListEditorForm::GetCheckedFolder()
+AlbumListEditorForm::GetCheckedFolderCount()
{
AppLogDebug("ENTER");
int maxCount = __pPresentationModel->GetFolderCount();
switch (actionId)
{
case ACTION_ID_ALBUM_LIST_SELECT_ALL:
- if (__pPresentationModel->GetFolderCount() == GetCheckedFolder())
+ if (__pPresentationModel->GetFolderCount() == GetCheckedFolderCount())
{
SetAllCheckState(false);
}
{
__pDeletePopup->SetShowState(false);
__pDeletePopup->Show();
- result r = DeleteFolder();
- AppLogDebug("CHECKBUTTONSTATE : R1");
- if (r == E_SUCCESS)
- {
- AppLogDebug("CHECKBUTTONSTATE : R2");
- SceneManager* pSceneManager = SceneManager::GetInstance();
- AppAssert(pSceneManager);
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
- }
- AppLogDebug("CHECKBUTTONSTATE : R3");
+ DeleteFolder();
break;
}
case ACTION_ID_DELETE_POPUP_CANCEL:
AppLogDebug("ENTER OnSceneActivatedN");
__pPresentationModel->InitializeAlbumInfoList(CONTENT_TYPE_ALL);
__pEditorFolderIconList->UpdateList();
+ __pPresentationModel->AddContentEventListener(this);
- __checkedCount = GetCheckedFolder();
+ __checkedCount = GetCheckedFolderCount();
String tempString;
}
void
-AlbumListEditorForm::OnSceneDeactivated(const SceneId& currentSceneId,
- const SceneId& nextSceneId)
+AlbumListEditorForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
{
AppLogDebug("ENTER");
+ __pPresentationModel->RemoveContentEventListener(*this);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
+void AlbumListEditorForm::OnFileOpInvalidate(enum FileActionMode actionId)
+{
+ Invalidate(true);
+}
+
+void AlbumListEditorForm::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
+{
+ AppLogDebug("ENTER");
+ __pPresentationModel->SetUpdateProgressStatus(false);
+ SetAllCheckState(false);
+ __pPresentationModel->InitializeAlbumInfoList(CONTENT_TYPE_ALL);
+ __pEditorFolderIconList->UpdateList();
+
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
+}
+
result
AlbumListEditorForm::Update(void)
{
{
AppLogDebug("ENTER");
- int checkCount = GetCheckedFolder();
+ int checkCount = GetCheckedFolderCount();
if (checkCount <= 0)
{
{
AppLogDebug("ENTER");
- int checkCount = GetCheckedFolder();
+ int checkCount = GetCheckedFolderCount();
if (checkCount <= 0)
{
AlbumListEditorForm::SetButtonState(void)
{
AppLogDebug("ENTER");
- if (GetCheckedFolder() > 0)
+ if (GetCheckedFolderCount() > 0)
{
AppLogDebug("BUTTONSTATE : Request Enable");
SetFooterButtonsState(true);
__pPresentationModel = AlbumListPresentationModel::GetInstance();
__pPresentationModel->ClearThumbnailRequests();
__pPresentationModel->AddPresentationModelListener(this);
- __pPresentationModel->AddContentEventListener(this);
if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
{
{
AppLogDebug("ENTER");
__pPresentationModel->RemovePresentationModelListener(*this);
- __pPresentationModel->RemoveContentEventListener(*this);
if (__pContextMenuMore != null)
{
const SceneId& currentSceneId, IList* pArgs)
{
AppLogDebug("ENTER");
+ __pPresentationModel->AddContentEventListener(this);
if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
{
const SceneId& nextSceneId)
{
AppLogDebug("ENTER");
+ __pPresentationModel->RemoveContentEventListener(*this);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
, __appControlMode(APP_CONTROL_MODE_MAIN)
, __appControlMediaType(APPCONTROL_MEDIA_TYPE_IMAGE)
, __appControlSelectionMode(APPCONTROL_SELECTION_MODE_SINGLE)
+ , __updateProgressStatus(false)
{
AppLogDebug("ENTER");
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
result
-AlbumListPresentationModel::DeleteContentInfoInDirectory(int index, ContentType contentType)
+AlbumListPresentationModel::DeleteContentFile(const ContentId& contentId)
{
AppLogDebug("ENTER");
result r = E_SUCCESS;
- if (__pAlbumInfoList == null)
- {
- AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
-
- return r;
- }
-
- AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(__pAlbumInfoList->GetAt(index));
-
- int loopCount = pAlbumInfo->GetDirectoryCount();
- for (int i = 0; i < loopCount; ++i)
+ ContentManager contentManager;
+ r = contentManager.Construct();
+ if (r == E_SUCCESS)
{
- ContentDirectory directory;
- const String contentDirectoryPath = pAlbumInfo->GetDirectory(i);
-
- if (contentType == CONTENT_TYPE_ALL)
- {
- IListT< ContentType >* pListT = new (std::nothrow) ArrayListT<ContentType>();
- pListT->Add(CONTENT_TYPE_IMAGE);
- pListT->Add(CONTENT_TYPE_VIDEO);
- r = directory.Construct(*pListT);
- delete pListT;
- }
- else
- {
- r = directory.Construct(contentType);
- }
- if (r != E_SUCCESS)
- {
- continue;
- }
-
- int pageNo = 1;
- int countPerPage = directory.GetContentDirectoryItemCount(contentDirectoryPath);
- IList* pContentInfoList = directory.GetContentDirectoryItemListN(contentDirectoryPath, pageNo,
- countPerPage, CONTENT_INFO_ORDER, SORT_ORDER_ASCENDING);
- ContentManager contentManager;
- r = contentManager.Construct();
- if (r != E_SUCCESS)
- {
- delete pContentInfoList;
- continue;
- }
-
- if ((pContentInfoList != null) && (pContentInfoList->GetCount() > 0))
- {
- IEnumerator* pEnum = pContentInfoList->GetEnumeratorN();
- while (pEnum->MoveNext() == E_SUCCESS || r == E_SUCCESS)
- {
- ContentInfo* pContentInfo = static_cast<ContentInfo*>(pEnum->GetCurrent());
- ContentId contentId = pContentInfo->GetContentId();
- r = contentManager.DeleteContent(contentId);
- }
- delete pEnum;
- }
-
- delete pContentInfoList;
+ r = contentManager.DeleteContent(contentId);
}
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
return __pAlbumInfoList;
}
+IList* AlbumListPresentationModel::GetContentIdListAtIndexN(const IList& indexList)
+{
+ AppLogDebug("ENTER");
+ ContentDirectory directory;
+ IList* pContentIdList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+
+ IListT< ContentType >* pListT = new (std::nothrow) ArrayListT<ContentType>();
+ TryReturn(pListT != null,null, "Unable to Create ArrayListT");
+ pListT->Add(CONTENT_TYPE_IMAGE);
+ pListT->Add(CONTENT_TYPE_VIDEO);
+
+ directory.Construct(*pListT);
+ delete pListT;
+
+ IList* pContentDirectoryPathList = directory.GetContentDirectoryPathListN(SORT_ORDER_ASCENDING);
+ String* pDirPath = null;
+ if ((pContentDirectoryPathList != null) && (pContentDirectoryPathList->GetCount() > 0))
+ {
+ if (static_cast<const Integer*>(indexList.GetAt(0))->ToInt() == 0) //if all-album is selected, get all files for delete
+ {
+ int loopCount = pContentDirectoryPathList->GetCount();
+ for (int i = 0; i < loopCount; ++i)
+ {
+ pDirPath = static_cast<String*>(pContentDirectoryPathList->GetAt(i));
+ pContentIdList->AddItems(*(GetContentIdListInDirectoryN(*pDirPath, CONTENT_TYPE_ALL)));
+ }
+ }
+ else //get all files in directories which are checked for deletion
+ {
+ int loopCount = indexList.GetCount();
+ for (int i = 0; i < loopCount; ++i)
+ {
+ const Integer* pIndex = static_cast<const Integer*>(indexList.GetAt(i));
+ pDirPath = static_cast<String*>(pContentDirectoryPathList->GetAt(pIndex->ToInt() - 1)); //index 0 is all-album which is not counted as a directory. hence delete 1 index
+ if (pDirPath == null)
+ {
+ continue;
+ }
+ pContentIdList->AddItems(*(GetContentIdListInDirectoryN(*pDirPath, CONTENT_TYPE_ALL)));
+ }
+ }
+ }
+ return pContentIdList;
+}
+
void
AlbumListPresentationModel::OnThumbnailReceivedN(IEventArg& eventArg)
{
AlbumListPresentationModel::OnContentCreated(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r)
{
AppLogDebug("ENTER");
+ if (__updateProgressStatus == true)
+ {
+ AppLogDebug("EXIT update in application");
+ return;
+ }
IFormContentUpdateEventListener* pInterface = null;
IEnumerator* pEventEnum = __pContentEventListener->GetEnumeratorN();
while (pEventEnum->MoveNext() == E_SUCCESS)
AlbumListPresentationModel::OnContentUpdated(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r)
{
AppLogDebug("ENTER");
+ if (__updateProgressStatus == true)
+ {
+ AppLogDebug("EXIT update in application");
+ return;
+ }
IFormContentUpdateEventListener* pInterface = null;
IEnumerator* pEventEnum = __pContentEventListener->GetEnumeratorN();
while (pEventEnum->MoveNext() == E_SUCCESS)
AlbumListPresentationModel::OnContentDeleted(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r)
{
AppLogDebug("ENTER");
+ if (__updateProgressStatus == true)
+ {
+ AppLogDebug("EXIT update in application");
+ return;
+ }
IFormContentUpdateEventListener* pInterface = null;
IEnumerator* pEventEnum = __pContentEventListener->GetEnumeratorN();
while (pEventEnum->MoveNext() == E_SUCCESS)
}
void
+AlbumListPresentationModel::SetUpdateProgressStatus(bool status)
+{
+ AppLogDebug("ENTER status = %d",status);
+ __updateProgressStatus = status;
+ AppLogDebug("EXIT");
+}
+
+void
AlbumListPresentationModel::RequestThumbnail(const int folderIndex, int pathIndex)
{
AppLogDebug("ENTER : folderIndex(%d), pathIndex(%d)", folderIndex, pathIndex);
__pFileListEditorForm = dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
TryReturnVoid(__pFileListEditorForm != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
__pPresentationModel->AddContentEventListener(__pFileListEditorForm);
- if (previousSceneId == IDSCN_ALL_LIST_SELECTION)
- {
- /* ResetSelection();
- if (pArgs != null && pArgs->GetCount() > 0)
- {
- IList* pSeletedIndexList = pArgs;
- int loopCount = pSeletedIndexList->GetCount();
- for (int i = 0; i < loopCount; ++i)
- {
- int index = static_cast<Integer*>(pSeletedIndexList->GetAt(i))->ToInt();
- __pContentIconListView->SetItemChecked(index, true);
- }
- __pContentIconListView->RequestRedraw(true);
- }*/
- }
- else if (previousSceneId == IDSCN_ALL_LIST)
+
+ if (previousSceneId == IDSCN_ALL_LIST)
{
ResetSelection();
}
else
{
__pPresentationModel->SetUpdateProgressStatus(true);
- //__deleteInProgress = true;
}
return E_SUCCESS;
}
void AllListEditorPanel::OnFileOpInvalidate(enum FileActionMode actionId)
{
- //SceneManager* pSceneManager = SceneManager::GetInstance();
__pFileListEditorForm->Invalidate(true);
}
void AllListEditorPanel::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
{
__pPresentationModel->SetUpdateProgressStatus(false);
- //__deleteInProgress = false;
__pLabelSelectCnt->SetText(ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED"));
__pLabelSelectCnt->RequestRedraw(true);
const SceneId& currentSceneId, IList* pArgs)
{
AppLogDebug("ENTER");
+
__pPresentationModel = FileListPresentationModel::GetInstance();
if (currentSceneId == IDSCN_ALL_LIST)
__pContentIconListView->UpdateList();
}
}
-
SceneManager* pSceneManager = SceneManager::GetInstance();
AppAssert(pSceneManager);
if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST)
{
pFileListForm->SetTitleText(__pPresentationModel->GetCurrentAlbumName());
}
+ __pPresentationModel->AddContentEventListener(pFileListForm);
}
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
const SceneId& nextSceneId)
{
AppLogDebug("ENTER");
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
+ if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST)
+ {
+ FileListForm* pFileListForm = dynamic_cast<FileListForm*>(pSceneManager->GetCurrentScene()->GetForm());
+ __pPresentationModel->RemoveContentEventListener(pFileListForm);
+ }
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
using namespace Tizen::Ui::Controls;
using namespace Tizen::Ui::Scenes;
-FileDeleteTimer::FileDeleteTimer(Tizen::Base::Collection::IList* pDelList, FileListPresentationModel* pPM,
- IFileOpInvalidateListener* invalidate)
+FileDeleteTimer::FileDeleteTimer(Tizen::Base::Collection::IList* pDelList
+ , IContentFileDeleteManager* pFDM
+ , IFileOpInvalidateListener* invalidate)
: GlTimerBase(invalidate, FILE_DELETE_ACTION)
, __pDeleteIndexList(pDelList)
- , __pPresentationModel(pPM)
+ , __pFileDeleteManager(pFDM)
{
}
IList * FileDeleteTimer::TimerStart(void)
{
- return __pPresentationModel->GetContentIdListN(*__pDeleteIndexList);
+ return __pFileDeleteManager->GetContentIdListAtIndexN(*__pDeleteIndexList);
}
result FileDeleteTimer::TimerExpired(const ContentId& contentId)
{
- return __pPresentationModel->DeleteContentFile(contentId);
+ return __pFileDeleteManager->DeleteContentFile(contentId);
}
void FileDeleteTimer::TimerCancel(int, enum FileActionCancelRes res)
__pPresentationModel = FileListPresentationModel::GetInstance();
__pPresentationModel->ClearThumbnailRequests();
- //__pPresentationModel->AddContentEventListener(this);
pHeader->SetStyle(HEADER_STYLE_TITLE);
pHeader->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"));
{
AppLogDebug("ENTER");
- //__pPresentationModel->RemoveContentEventListener(this);
if (__pContextMenuMore != null)
{
__pContextMenuMore->RemoveActionEventListener(*this);
break;
}
case ACTION_ID_CONTEXT_MENU_MORE_COPY:
- {
- //__pFileMove->SetCopy();
- __isCopyOperation = true;
- //Fall through to next case.
- }
case ACTION_ID_CONTEXT_MENU_MORE_MOVE:
{
- if(actionId == ACTION_ID_CONTEXT_MENU_MORE_MOVE)
+ if (actionId == ACTION_ID_CONTEXT_MENU_MORE_MOVE)
{
__isCopyOperation = false;
}
+ else if (actionId == ACTION_ID_CONTEXT_MENU_MORE_COPY)
+ {
+ __isCopyOperation = true;
+ }
RefreshFolderList();
if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
{
__pPresentationModel = FileListPresentationModel::GetInstance();
__pPresentationModel->ClearThumbnailRequests();
- __pPresentationModel->AddContentEventListener(this);
-
__pPopUp = new (std::nothrow) SlideShowPopUp();
if (__pPopUp != null)
{
AppLogDebug("ENTER");
- __pPresentationModel->RemoveContentEventListener(this);
if (__pContextMenuMore != null)
{
delete __pContextMenuMore;
return pContentInfo;
}
-
-IList* FileListPresentationModel::GetContentIdListN(const IList& contentInfoList)
+IList* FileListPresentationModel::GetContentIdListAtIndexN(const IList& indexList)
{
IList* pContentIdList = new (std::nothrow) ArrayList(SingleObjectDeleter);
- int loopCount = contentInfoList.GetCount();
+ int loopCount = indexList.GetCount();
for (int i = 0; i < loopCount; ++i)
{
- const Integer* pIndex = static_cast<const Integer*>(contentInfoList.GetAt(i));
+ const Integer* pIndex = static_cast<const Integer*>(indexList.GetAt(i));
if ((pIndex != null) && (pIndex->ToInt())>=0 && __pContentInfoList->GetCount() > pIndex->ToInt())
{
Directory::Create(__moveToDir, true);
}
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
- return __pPresentationModel->GetContentIdListN(*__pMoveIndexList);
+ return __pPresentationModel->GetContentIdListAtIndexN(*__pMoveIndexList);
}
else
{