virtual void TimerComplete(int, enum FileActionCompleteRes res);
result ScanDirectories(void);
virtual int GetDirScanCount() const;
+ void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state);
private :
Tizen::Base::Collection::IList* __pMoveIndexList;
private:
virtual Tizen::Base::Collection::IList * TimerStart(void);
virtual result TimerExpired(const Tizen::Base::Object* contentId);
- virtual void TimerCancel(int, enum FileActionCancelRes res) {}
- virtual void TimerComplete(int, enum FileActionCompleteRes res) {}
virtual result ScanDirectories(void);
virtual int GetDirScanCount() const;
+ void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state);
+ virtual void TimerCancel(int, enum FileActionCancelRes res);
+ virtual void TimerComplete(int, enum FileActionCompleteRes res);
private :
Tizen::Base::Collection::IList* __pUpdateIndexList;
#define _GL_TIMER_BASE_H_
#include <FUi.h>
+#include <FSystem.h>
#include "GlFileOpInvalidateListener.h"
#include "GlTimerScanDirListener.h"
+#include "GlTypes.h"
class GlProgressBar;
, public Tizen::Base::Runtime::ITimerEventListener
, public ITimerScanDirListener
, public Tizen::Ui::IPropagatedKeyEventListener
+ , public Tizen::System::IDeviceEventListener
{
public:
virtual result ScanDirectories(void) = 0;
virtual int GetDirScanCount() const = 0;
int GetMovedCount() const;
+ virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state) = 0;
private:
void OnOpComplete(enum FileActionCompleteRes);
, __isScanProgress(false)
{
AppLogDebug("ENTER");
+ _pProgressAnim = null;
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
_pProgressAnim = new (std::nothrow) ProgressAnimation;
_pProgressAnim->Construct(rect);
AddControl(_pProgressAnim);
+ SetControlAlwaysOnTop(*_pProgressAnim,true);
_pProgressAnim->SetShowState(true);
GetFooter()->SetEnabled(false);
_pProgressAnim->AnimationStart();
__pEditorFolderIconList->SetItemChecked(index, true);
__pEditorFolderIconList->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
}
+
+ if (_pProgressAnim != null)
+ {
+ _pProgressAnim->ChangeOrientation(Form::GetBounds());
+ _pProgressAnim->Invalidate(true);
+ }
}
AlbumListPresentationModel::OnDeviceStateChanged(DeviceType deviceType, const Tizen::Base::String& state)
{
AppLogDebug("ENTER");
- IFormContentUpdateEventListener* pInterface = null;
- IEnumerator* pEventEnum = __pContentEventListener->GetEnumeratorN();
- while (pEventEnum->MoveNext() == E_SUCCESS)
+ if (deviceType == DEVICE_TYPE_STORAGE_CARD && state == DEVICE_STORAGE_CARD_UNMOUNTED)
{
- pInterface = static_cast<IFormContentUpdateEventListener*>(pEventEnum->GetCurrent());
- pInterface->OnContentUpdated();
+ IFormContentUpdateEventListener* pInterface = null;
+ IEnumerator* pEventEnum = __pContentEventListener->GetEnumeratorN();
+ while (pEventEnum->MoveNext() == E_SUCCESS)
+ {
+ pInterface = static_cast<IFormContentUpdateEventListener*>(pEventEnum->GetCurrent());
+ pInterface->OnContentUpdated();
+ }
+ delete pEventEnum;
}
- delete pEventEnum;
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
byteCountForInput = __pNameEditField->GetText();
r = utf8.GetByteCount(byteCountForInput, inputLength);
- if (inputLength >= tempLength)
+ if ( inputLength == tempLength )
+ {
+ String msg = ResourceManager::GetString(L"IDS_COM_POP_MAXIMUM_NUMBER_OF_CHARACTERS_REACHED");
+ CreateMessage(msg);
+ __pNameEditField->ShowKeypad();
+ return;
+ }
+ else if (inputLength > tempLength)
{
String maxCharacterString;
String currentInputCharacter;
}
delete __pFileMove;
- GetMoveFileIndexList(path, __pMoveIndexList, __pFilePresentationModel);
__pFileMove = new (std::nothrow) FileMoveTimer(path, __pMoveIndexList, __pFilePresentationModel, this);
if (__fileActionMode == FILE_ACTION_COPY)
{
{
delete __pFileMove;
IList* pItemIndexList = pEditorPanel->GetItemCheckedIndexListN();
- GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel , __isCopyOperation);
__pFileMove = new (std::nothrow) FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
if (__isCopyOperation)
{
- AppLogDebug("Rash: Setting to Copy in FileListEditorForm");
__pFileMove->SetCopy();
}
{
delete __pFileMove;
IList* pItemIndexList = pSelectionPanel->GetItemCheckedIndexListN();
- GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel , __isCopyOperation);
__pFileMove = new (std::nothrow) FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
if (__isCopyOperation)
{
- AppLogDebug("Rash: Setting to Copy in FileListEditorForm");
__pFileMove->SetCopy();
}
result r = __pFileMove->StartTimer();
return E_SUCCESS;
}
- if (File::IsFileExist(destPath) == true)
+ while (File::IsFileExist(destPath) == true)
{
- File::Remove(destPath);
+ int index = 0;
+ r = destPath.IndexOf(FILE_EXT_SEPARATOR, 0, index);
+ if (!IsFailed(r))
+ {
+ if (index < 0)
+ {
+ return E_FAILURE;
+ }
+ else
+ {
+ destPath.Insert(Math::Rand()%10, index);
+ }
+ }
+ else
+ {
+ return E_FAILURE;
+ }
}
r = File::Copy(filePath, destPath, false);
using namespace Tizen::Base::Utility;
using namespace Tizen::Content;
using namespace Tizen::Io;
+using namespace Tizen::System;
using namespace Tizen::Ui;
using namespace Tizen::Ui::Controls;
using namespace Tizen::Ui::Scenes;
, __scanDirMap(SingleObjectDeleter)
, __pContentManager(null)
{
+ AppLogDebug("ENTER");
__scanDirMap.Construct();
+ DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
+ AppLogDebug("EXIT");
}
FileMoveTimer::~FileMoveTimer(void)
{
AppLogDebug("ENTER");
+ DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
ScanDirectories();
delete __pMoveIndexList;
delete __pContentManager;
}
if (File::IsFileExist(__moveToDir) == false)
{
- Directory::Create(__moveToDir, true);
+ result r = Directory::Create(__moveToDir, true);
+ AppLog("The directory create result is 2(%s)", GetErrorMessage(r));
+
+ if ( r == E_STORAGE_FULL)
+ {
+ return null;
+ }
+
}
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
IList* pCntIdList = __pPresentationModel->GetContentIdListAtIndexN(*__pMoveIndexList);
FileMoveTimer::TimerCancel(int, enum FileActionCancelRes res)
{
AppLogDebug("ENTER");
+ DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
if (res == CANCEL_USER || (res == CANCEL_SYS_ERROR && GetMovedCount() > 0) )
{
String albumName = __pPresentationModel->ConvertToAlbumName(__moveToDir);
FileMoveTimer::TimerComplete(int, enum FileActionCompleteRes res)
{
AppLogDebug("ENTER");
+ DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
String albumName = __pPresentationModel->ConvertToAlbumName(__moveToDir);
if (albumName != EMPTY_SPACE)
{
__isCopyOperation = false;
}
+
+
+void
+FileMoveTimer::OnDeviceStateChanged(DeviceType deviceType, const Tizen::Base::String& state)
+{
+ AppLogDebug("ENTER");
+ if (deviceType == DEVICE_TYPE_STORAGE_CARD && state == DEVICE_STORAGE_CARD_UNMOUNTED)
+ {
+ String sdcPath = Environment::GetExternalStoragePath();
+ IMapEnumerator* pMapEnum = __scanDirMap.GetMapEnumeratorN();
+ String* pKey = null;
+ while (pMapEnum->MoveNext() == E_SUCCESS)
+ {
+ pKey = static_cast< String* > (pMapEnum->GetKey());
+ if (pKey->StartsWith(sdcPath, 0))
+ {
+ __scanDirMap.Remove(*pKey);
+ }
+ }
+ delete pMapEnum;
+ }
+ AppLogDebug("EXIT");
+}
using namespace Tizen::Base::Utility;
using namespace Tizen::Content;
using namespace Tizen::Io;
+using namespace Tizen::System;
using namespace Tizen::Ui;
using namespace Tizen::Ui::Controls;
using namespace Tizen::Ui::Scenes;
, __pContentManager(null)
{
__scanDirMap.Construct();
+ DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
}
FileUpdateTimer::~FileUpdateTimer(void)
{
+ AppLogDebug("ENTER");
+ DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
ScanDirectories();
delete __pUpdateIndexList;
delete __pContentManager;
+ AppLogDebug("EXIT");
}
IList *
FileUpdateTimer::TimerStart(void)
{
+ AppLogDebug("ENTER");
__pContentManager = new (std::nothrow) ContentManager();
__pContentManager->Construct();
IList* pCntIdList = __pFileUpdateManager->GetContentIdListAtIndexN(*__pUpdateIndexList);
+ AppLogDebug("EXIT");
return pCntIdList;
}
result
FileUpdateTimer::TimerExpired(const Object* contentId)
{
-
+ AppLogDebug("ENTER");
if (_actionId == FILE_ACTION_DELETE)
{
const ContentId* cntId = static_cast<const ContentId*>(contentId);
}
else
{
- return r;
+ r = E_FAILURE;
}
}
return r;
}
+ AppLogDebug("EXIT");
}
result
return __scanDirMap.GetCount();
}
+void
+FileUpdateTimer::OnDeviceStateChanged(DeviceType deviceType, const Tizen::Base::String& state)
+{
+ AppLogDebug("ENTER");
+ if (deviceType == DEVICE_TYPE_STORAGE_CARD && state == DEVICE_STORAGE_CARD_UNMOUNTED &&
+ _actionId == FILE_ACTION_DELETE)
+ {
+ String sdcPath = Environment::GetExternalStoragePath();
+ IMapEnumerator* pMapEnum = __scanDirMap.GetMapEnumeratorN();
+ String* pKey = null;
+ while (pMapEnum->MoveNext() == E_SUCCESS)
+ {
+ pKey = static_cast< String* > (pMapEnum->GetKey());
+ if (pKey->StartsWith(sdcPath, 0))
+ {
+ __scanDirMap.Remove(*pKey);
+ }
+ }
+ delete pMapEnum;
+ }
+ AppLogDebug("EXIT");
+}
+
+void
+FileUpdateTimer::TimerCancel(int, enum FileActionCancelRes res)
+{
+ DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
+}
+void
+FileUpdateTimer::TimerComplete(int, enum FileActionCompleteRes res)
+{
+ DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
+}
__pMoveProBar->HideFileProgressingPopup();
delete __pMoveProBar;
}
- AppLogDebug("ENTER");
+ AppLogDebug("EXIT");
}
bool
__moveTimer.Cancel();
__pMoveProBar->HideFileProgressingPopup();
int scanCount = GetDirScanCount();
- if ( (scanCount > 0 && _actionId != FILE_ACTION_MOVE ) ||
- (scanCount > 1 && _actionId == FILE_ACTION_MOVE ))
+ if (scanCount > 0)
{
AlbumListPresentationModel::GetInstance()->AddTimerScanListener(this, scanCount);
ScanDirectories();
__timerRes = CANCEL_SYS;
__pMoveProBar->HideFileProgressingPopup();
int scanCount = GetDirScanCount();
- if ( (scanCount > 0 && _actionId != FILE_ACTION_MOVE ) ||
- (scanCount > 1 && _actionId == FILE_ACTION_MOVE ))
+ if ( scanCount > 0)
{
AlbumListPresentationModel::GetInstance()->AddTimerScanListener(this, scanCount);
ScanDirectories();
__moveTimer.Cancel();
__pMoveProBar->HideFileProgressingPopup();
int scanCount = GetDirScanCount();
- if (scanCount == 0 && _actionId == FILE_ACTION_ROTATE)
+ if (scanCount == 0)
{
__moveToCount = 0;
__isStarted = false;
OnOpComplete(COMPLETE_SUCCESS);
return;
}
- if ((scanCount > 0 && _actionId != FILE_ACTION_MOVE ) ||
- (scanCount > 1 && _actionId == FILE_ACTION_MOVE ))
- {
- AlbumListPresentationModel::GetInstance()->AddTimerScanListener(this, scanCount);
- ScanDirectories();
- __pInvalidate->OnScanDirStart();
- FileListPresentationModel::GetInstance()->ShowAnimation();
- AlbumListPresentationModel::GetInstance()->ShowAnimation();
- }
+ AlbumListPresentationModel::GetInstance()->AddTimerScanListener(this, scanCount);
+ ScanDirectories();
+ __pInvalidate->OnScanDirStart();
+ FileListPresentationModel::GetInstance()->ShowAnimation();
+ AlbumListPresentationModel::GetInstance()->ShowAnimation();
__isStarted = false;
__timerRes = TIMER_COMPLETE;
__moveToCount = 0;
__isStarted = false;
int scanCount = GetDirScanCount();
- if ((scanCount > 0 && _actionId != FILE_ACTION_MOVE ) ||
- (scanCount > 1 && _actionId == FILE_ACTION_MOVE ))
+ if (scanCount > 0)
{
AlbumListPresentationModel::GetInstance()->AddTimerScanListener(this, scanCount);
ScanDirectories();