AlbumListPresentationModel* __pPresentationModel;
FileListPresentationModel* __pFilePresentationModel;
Tizen::Base::Collection::IList* __pMoveIndexList;
+ FileActionMode __fileActionMode;
FileMoveTimer* __pFileMove;
ProgressAnimation* __pProgressAnim;
SlideShowPopUp* __pPopUp;
FileListPresentationModel* __pPresentationModel;
FileMoveTimer* __pFileMove;
+ bool __isCopyOperation;
};
#endif /* _GL_FILE_LIST_EDITOR_FORM_H_ */
const ThumbnailInfo& thumbmailInfo);
result DeleteContentFile(const Tizen::Content::ContentId& contentId);
result MoveToContentFile(const Tizen::Content::ContentId& contentId,
- const Tizen::Base::String& destDirectory);
+ const Tizen::Base::String& destDirectory, const bool isCopyOperation);
Tizen::Graphics::Bitmap* GetShadedBackgroundBitmapN(Tizen::Graphics::Bitmap& bgBitmap,
const Tizen::Graphics::Bitmap& orgBitmap, const Tizen::Graphics::Rectangle& orgBitmapPosition);
Tizen::Base::Collection::IList* GetContentInfoListInDirectoryListN(
class FileListPresentationModel;
+/* FileMoveTimer class is used for Move and Copy operations*/
class FileMoveTimer
: public GlTimerBase
{
public :
FileMoveTimer(Tizen::Base::String& , Tizen::Base::Collection::IList* , FileListPresentationModel*,
- IFileOpInvalidateListener*);
+ IFileOpInvalidateListener*, bool __isCopyOperation = false);
~FileMoveTimer(void);
+ void SetCopy();
+ void ClearCopy();
+
private:
//From GlTimerBase
Tizen::Base::Collection::IList * TimerStart(void);
Tizen::Base::Collection::IList* __pMoveIndexList;
Tizen::Base::String __moveToDir;
FileListPresentationModel* __pPresentationModel;
+ bool __isCopyOperation;
};
//From ITimerEventListener
void OnTimerExpired(Timer& timer);
+ void SetActionMode(enum FileActionMode actionId);
+
protected:
virtual Tizen::Base::Collection::IList * TimerStart(void) = 0;
virtual result TimerExpired(const ContentId&) = 0;
ACTION_ID_CONTEXT_MENU_MORE_SLIDE_SHOW = 306,
ACTION_ID_CONTEXT_MENU_SHARE_MESSAGE = 307,
ACTION_ID_CONTEXT_MENU_SHARE_EMAIL = 308,
+ ACTION_ID_CONTEXT_MENU_MORE_COPY = 309,
ACTION_ID_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START = 401,
ACTION_ID_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM = 600,
ACTION_ID_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START = 601,
{
FILE_DELETE_ACTION,
FILE_MOVE_ACTION,
- FILE_RENAME_ACTION
+ FILE_RENAME_ACTION,
+ FILE_COPY_ACTION
};
enum FileActionCancelRes
static const unsigned int CUSTOM_COLOR_SETTINGS_LISTITEM_RADIO_BACKGROUND = Tizen::Graphics::Color32<220, 218, 211>::Value;
static const unsigned int CUSTOM_COLOR_SETTINGS_GROUPTITLE = Tizen::Graphics::Color32<59, 115, 182>::Value;
static const int ALBUM_FIRST_ELEMENT = 0;
-
+static const int ALBUM_SECOND_ELEMENT = 1;
#endif /* _GL_TYPES_H_ */
pSelectedIndex->Construct();
//Adding the Action Type
pSelectedIndex->Add(new (std::nothrow) Integer(ALBUM_RENAME));
+ pSelectedIndex->Add(new (std::nothrow) Integer(FILE_MOVE_ACTION));
pSelectedIndex->Add(new (std::nothrow) Integer(index));
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pSelectedIndex);
, __pPresentationModel(null)
, __pFilePresentationModel(null)
, __pMoveIndexList(null)
+ , __fileActionMode(FILE_MOVE_ACTION)
, __pFileMove(null)
, __pProgressAnim(null)
{
delete __pFileMove;
GetMoveFileIndexList(path, __pMoveIndexList, __pFilePresentationModel);
__pFileMove = new FileMoveTimer(path, __pMoveIndexList, __pFilePresentationModel, this);
- __pFilePresentationModel->SetUpdateProgressStatus(true);
+ if(__fileActionMode == FILE_COPY_ACTION)
+ {
+ AppLogDebug("Rash: Setting to Copy in AlbumNameEditor");
+ __pFileMove->SetCopy();
+ }
+ else
+ {
+ __pFileMove->ClearCopy();
+ }
result r = __pFileMove->StartTimer();
if (IsFailed(r))
{
AppLogDebug("MoveToContentFileList content in progress");
__overlayMsg = true;
+ __fileActionMode = FILE_MOVE_ACTION;
}
}
pArgs->RemoveAt(ALBUM_FIRST_ELEMENT, true);
}
+ if (pArgs != null)
+ {
+ Integer* operationTypePtr = static_cast<Integer*>(pArgs->GetAt(ALBUM_FIRST_ELEMENT));
+ if (operationTypePtr->ToInt() == FILE_MOVE_ACTION)
+ {
+ AppLogDebug("Rash: FILE_MOVE_ACTION");
+ __fileActionMode = FILE_MOVE_ACTION;
+ }
+ else if (operationTypePtr->ToInt() == FILE_COPY_ACTION)
+ {
+ AppLogDebug("Rash: FILE_COPY_ACTION");
+ __fileActionMode = FILE_COPY_ACTION;
+ }
+ pArgs->RemoveAt(ALBUM_FIRST_ELEMENT, true);
+ }
+
if (previousSceneId == IDSCN_ALBUM_LIST_EDITOR)
{
if (pArgs != null)
, __pContentDirectoryNameList(null)
, __pPresentationModel(null)
, __pFileMove(null)
+ ,__isCopyOperation(false)
{
AppLogDebug("ENTER");
__overlayMsg = false;
__pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MOVE"),
ACTION_ID_CONTEXT_MENU_MORE_MOVE);
+ __pContextMenuMore->AddItem((L"Copy"),
+ ACTION_ID_CONTEXT_MENU_MORE_COPY);
if (checkedCount > 1)
{
{
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)
+ {
+ __isCopyOperation = false;
+ }
RefreshFolderList();
if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
{
AllListEditorPanel* pListEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
IList* pList = pListEditorPanel->GetItemCheckedIndexListN();
pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
+ if(__isCopyOperation)
+ {
+ pList->InsertAt(new (std::nothrow) Integer(FILE_COPY_ACTION), ALBUM_SECOND_ELEMENT);
+ }
+ else
+ {
+ pList->InsertAt(new (std::nothrow) Integer(FILE_MOVE_ACTION), ALBUM_SECOND_ELEMENT);
+ }
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
}
break;
(pSceneManager->GetCurrentScene()->GetPanel());
IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
+ if(__isCopyOperation)
+ {
+ pList->InsertAt(new (std::nothrow) Integer(FILE_COPY_ACTION), ALBUM_SECOND_ELEMENT);
+ }
+ else
+ {
+ pList->InsertAt(new (std::nothrow) Integer(FILE_MOVE_ACTION), ALBUM_SECOND_ELEMENT);
+ }
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
}
break;
IList* pItemIndexList = pEditorPanel->GetItemCheckedIndexListN();
GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel);
__pFileMove = new FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
- __pPresentationModel->SetUpdateProgressStatus(true);
+ if(__isCopyOperation)
+ {
+ AppLogDebug("Rash: Setting to Copy in FileListEditorForm");
+ __pFileMove->SetCopy();
+ }
+
result r = __pFileMove->StartTimer();
if (IsFailed(r))
{
delete __pFileMove;
__pFileMove = null;
+ __isCopyOperation = false;
}
else
{
IList* pItemIndexList = pSelectionPanel->GetItemCheckedIndexListN();
GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel);
__pFileMove = new FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
- __pPresentationModel->SetUpdateProgressStatus(true);
+ if(__isCopyOperation)
+ {
+ AppLogDebug("Rash: Setting to Copy in FileListEditorForm");
+ __pFileMove->SetCopy();
+ }
result r = __pFileMove->StartTimer();
if (IsFailed(r))
{
delete __pFileMove;
__pFileMove = null;
+ __isCopyOperation = false;
}
else
{
}
result
-FileListPresentationModel::MoveToContentFile(const ContentId& contentId, const String& destDirectory)
+FileListPresentationModel::MoveToContentFile(const ContentId& contentId, const String& destDirectory, const bool isCopyOperation)
{
AppLogDebug("ENTER");
if (contentId.ToString().IsEmpty() == true || destDirectory.IsEmpty() == true)
__pContentManager->CreateContent(contentInfo);
r = GetLastResult();
TryCatch(!IsFailed(r),,"CreateContent::the value is %s",GetErrorMessage(r));
- r = __pContentManager->DeleteContent(contentId);
- TryCatch(!IsFailed(r),,"DeleteContent::the value is %s",GetErrorMessage(r));
+ if (!isCopyOperation)
+ {
+ r = __pContentManager->DeleteContent(contentId);
+ TryCatch(!IsFailed(r),,"DeleteContent::the value is %s",GetErrorMessage(r));
+ }
}
}
}
__pContentManager->CreateContent(contentInfo);
r = GetLastResult();
TryCatch(!IsFailed(r),,"CreateContent::the value is %s",GetErrorMessage(r));
- r = __pContentManager->DeleteContent(contentId);
- TryCatch(!IsFailed(r),,"DeleteContent::the value is %s",GetErrorMessage(r));
+ if (!isCopyOperation)
+ {
+ r = __pContentManager->DeleteContent(contentId);
+ TryCatch(!IsFailed(r),,"DeleteContent::the value is %s",GetErrorMessage(r));
+ }
}
}
}
FileMoveTimer::FileMoveTimer(String& destDirectory, IList* list
, FileListPresentationModel* presentationModel
- , IFileOpInvalidateListener* pInvalidate)
+ , IFileOpInvalidateListener* pInvalidate
+ , bool isCopyOperation)
: GlTimerBase(pInvalidate, FILE_MOVE_ACTION)
, __pMoveIndexList(list)
,__moveToDir(destDirectory)
AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
return null;
}
+ if(__isCopyOperation)
+ {
+ SetActionMode(FILE_COPY_ACTION);
+ }
if (__pMoveIndexList->GetCount() > 0)
{
if (File::IsFileExist(__moveToDir) == false)
result FileMoveTimer::TimerExpired(const ContentId& contentId)
{
AppLogDebug("ENTER");
- return __pPresentationModel->MoveToContentFile(contentId, __moveToDir);
+ return __pPresentationModel->MoveToContentFile(contentId, __moveToDir, __isCopyOperation);
}
void FileMoveTimer::TimerCancel(int, enum FileActionCancelRes res)
AppLogDebug("EXIt");
}
+void FileMoveTimer::SetCopy()
+{
+ __isCopyOperation = true;
+}
+
+void FileMoveTimer::ClearCopy()
+{
+ __isCopyOperation = false;
+}
case FILE_DELETE_ACTION:
__pFileProgressingHeaderLabel->SetText(L"Deleting...");
break;
+ case FILE_COPY_ACTION:
+ __pFileProgressingHeaderLabel->SetText(L"Copying...");
+ break;
default:
break;
}
TimerComplete(__moveToCount, res);
AppLogDebug("EXIT");
}
+
+void GlTimerBase::SetActionMode(enum FileActionMode actionId)
+{
+ __actionId = actionId;
+}