, __modalMsgBoxResult(0)
, __textLength(0)
, __mountState(false)
+ , __isCreateAlbum(false)
+ , __isKeyPadOpen(false)
, __albumNameEditorMode(ALBUM_NAME_EDITOR_MODE_RENAME)
, __pMessageBox(null)
, __pMoveIndexList(null)
, __fileActionMode(FILE_ACTION_MOVE)
, __pFileMove(null)
- , __pProgressAnim(null)
, __pPresentationModel(null)
, __pFilePresentationModel(null)
{
AppLogDebug("ENTER");
_overlayMsg = false;
+ _pProgressAnim = null;
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
AlbumNameEditorForm::~AlbumNameEditorForm(void)
{
AppLogDebug("ENTER");
- DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
delete __pFileMove;
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
SetOrientation(ORIENTATION_AUTOMATIC);
AddOrientationEventListener(*this);
- DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
Header* pHeader = GetHeader();
pHeader->SetStyle(HEADER_STYLE_TITLE);
__pNameEditField->AddTextEventListener(*this);
__pNameEditField->SetColor(EDIT_STATUS_NORMAL, COLOR_NAME_EDIT_FIELD);
__pNameEditField->SetOverlayKeypadCommandButtonVisible(false);
+ __pNameEditField->AddKeypadEventListener(*this);
__pNameEditField->AddActionEventListener(*this);
return E_SUCCESS;
CreateMessage(msg);
currentInput.Replace("/", "");
__pNameEditField->SetText(currentInput);
+
+ if (currentInput == L"")
+ {
+ if (GetFooter() != null)
+ {
+ GetFooter()->SetItemEnabled(0, false);
+ GetFooter()->Invalidate(true);
+ }
+ }
}
- inputLength = byteCount;
- if (inputLength >= tempLength)
+ byteCountForInput = __pNameEditField->GetText();
+ r = utf8.GetByteCount(byteCountForInput, inputLength);
+
+ 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;
CreateMessage(msg);
currentText = __pNameEditField->GetText();
- for (currentCharacter=0; checkByteCount < tempLength; currentCharacter++)
+ for (currentCharacter=0; checkByteCount < tempLength; ++currentCharacter)
{
currentInputCharacter.Clear();
currentInputCharacter = currentText[currentCharacter];
AppLogDebug("result of byte count is %s",GetErrorMessage(r));
checkByteCount = checkByteCount + byteCount;
- if( checkByteCount < tempLength)
+ if (checkByteCount < tempLength)
{
- lengthOfFinalString++;
+ ++lengthOfFinalString;
}
}
{
__pMessageBox->Construct(L"", ResourceManager::GetString(L"IDS_MEDIABR_BODY_UNABLE_TO_RENAME_ALBUM_NAME_ALREADY_IN_USE_ABB"),
MSGBOX_STYLE_NONE, 3000);
+
}
else
{
_overlayMsg = false;
delete __pMessageBox;
__pMessageBox = null;
+ __pNameEditField->SetEnabled(true);
+ __pNameEditField->ShowKeypad();
}
}
else
{
//Add a popup here
- Rectangle clientRect = GetClientAreaBounds();
+ Rectangle clientRect = Form::GetBounds();
Rectangle rect(0, 0, clientRect.width, clientRect.height);
- __pProgressAnim = new (std::nothrow) ProgressAnimation;
- __pProgressAnim->Construct(rect);
- AddControl(__pProgressAnim);
- __pProgressAnim->SetShowState(true);
+ _pProgressAnim = new (std::nothrow) ProgressAnimation;
+ _pProgressAnim->Construct(rect);
+ AddControl(_pProgressAnim);
+ _pProgressAnim->SetShowState(true);
GetFooter()->SetEnabled(false);
- __pProgressAnim->AnimationStart();
- __pProgressAnim->Draw();
+ _pProgressAnim->AnimationStart();
+ _pProgressAnim->Draw();
_overlayMsg = true;
}
}
void
+AlbumNameEditorForm::ShowAnimation()
+{
+ 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;
+}
+
+void
+AlbumNameEditorForm::StopAnimation(void)
+{
+ if (_pProgressAnim)
+ {
+ _pProgressAnim->AnimationStop();
+ _pProgressAnim->SetShowState(false);
+ RemoveControl(_pProgressAnim);
+ GetFooter()->SetEnabled(true);
+ _pProgressAnim = null;
+ _overlayMsg = false;
+ }
+}
+
+void
AlbumNameEditorForm::OnCreateAlbum(void)
{
String path;
- __pNameEditField->HideKeypad();
- __pNameEditField->RequestRedraw();
path.Append(Tizen::System::Environment::GetMediaPath());
path.Append(__nameEditFieldText);
AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
delete __pMoveIndexList;
__pMoveIndexList = null;
- return ;
+ return;
}
if (__pMoveIndexList == null || __pMoveIndexList->GetCount() <= 0)
AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
delete __pMoveIndexList;
__pMoveIndexList = null;
- return ;
+ return;
}
delete __pFileMove;
- GetMoveFileIndexList(path, __pMoveIndexList, __pFilePresentationModel);
__pFileMove = new (std::nothrow) FileMoveTimer(path, __pMoveIndexList, __pFilePresentationModel, this);
if (__fileActionMode == FILE_ACTION_COPY)
{
__pNameEditField->SetText(__nameEditFieldPreText);
__pNameEditField->HideKeypad();
__pNameEditField->Draw();
+
+ String msg = ResourceManager::GetString(L"IDS_COM_BODY_OPERATION_FAILED");
+ CreateMessage(msg);
AppLogDebug("MoveToContentFileList content failed (%s)", GetErrorMessage(r));
SceneManager* pSceneManager = SceneManager::GetInstance();
pSceneManager->GoBackward(BackwardSceneTransition(__callerSceneId));
}
}
-void AlbumNameEditorForm::OnAlbumRenameComplete(void)
+void
+AlbumNameEditorForm::OnAlbumRenameComplete(void)
{
//Hide popup here..
- __pProgressAnim->AnimationStop();
- __pProgressAnim->SetShowState(false);
- RemoveControl(__pProgressAnim);
+ _pProgressAnim->AnimationStop();
+ _pProgressAnim->SetShowState(false);
+ RemoveControl(_pProgressAnim);
_overlayMsg = false;
GetFooter()->SetEnabled(true);
SceneManager* pSceneManager = SceneManager::GetInstance();
case IDA_BUTTON_CREATE_NAME_SAVE:
{
__pNameEditField->SetEnabled(false);
+ __isCreateAlbum = false;
+ GetFooter()->SetItemEnabled(0, false);
if (__albumNameEditorMode == ALBUM_NAME_EDITOR_MODE_CREATE)
{
- OnCreateAlbum();
+ if (__isKeyPadOpen == true )
+ {
+ __pNameEditField->HideKeypad();
+ __isCreateAlbum = true;
+ }
+ else
+ {
+ OnCreateAlbum();
+ }
+
}
else if (__albumNameEditorMode == ALBUM_NAME_EDITOR_MODE_RENAME)
{
String albumName = __pNameEditField->GetText();
- if (__originalText.Equals(albumName , true))
+ if (__originalText.Equals(albumName, true))
{
SceneManager* pSceneManager = SceneManager::GetInstance();
pSceneManager->GoBackward(BackwardSceneTransition());
AlbumNameEditorForm::OnFormBackRequested(Form& source)
{
AppLogDebug("ENTER");
- if (__pProgressAnim != null)
+ if (_pProgressAnim != null)
{
- if (__pProgressAnim->GetShowState())
+ if (_pProgressAnim->GetShowState())
{
return;
}
__pPresentationModel = AlbumListPresentationModel::GetInstance();
__previousSceneId = previousSceneId;
- __pNameEditField->SetEnabled(true);
+ DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
__pPresentationModel->AddContentEventListener(this);
if (pArgs != null)
}
delete pEnum;
delete pArgs;
- pArgs = NULL ;
+ pArgs = NULL;
}
}
const SceneId& nextSceneId)
{
AppLogDebug("ENTER");
+
+ if(__pNameEditField->IsEnabled() == false)
+ {
+ __pNameEditField->SetEnabled(true);
+ }
+
+ __isKeyPadOpen = false;
+
__pPresentationModel->RemoveContentEventListener(*this);
+ DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
+
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
{
AppLogDebug("ENTER");
- if ( __mountState == false )
+ if (__mountState == false)
{
+ if (__pFileMove && __pFileMove->IsStarted())
+ {
+ __pFileMove->Cancel();
+ delete __pFileMove;
+ __pFileMove = null;
+ }
+
SceneManager* pSceneManager = SceneManager::GetInstance();
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
if (deviceType == DEVICE_TYPE_STORAGE_CARD && state == DEVICE_STORAGE_CARD_UNMOUNTED)
{
- if ( __pFileMove && __pFileMove->IsStarted() )
+ if (__pFileMove && __pFileMove->IsStarted())
{
__pFileMove->Cancel();
delete __pFileMove;
void
AlbumNameEditorForm::OnOrientationChanged(const Tizen::Ui::Control &source, Tizen::Ui::OrientationStatus orientationStatus)
{
- if ( __pProgressAnim != NULL)
+ if (_pProgressAnim != null)
+ {
+ _pProgressAnim->ChangeOrientation(Form::GetBounds());
+ _pProgressAnim->Invalidate(true);
+ }
+}
+
+void
+AlbumNameEditorForm::OnKeypadClosed(Tizen::Ui::Control& source)
+{
+ AppLogDebug("ENTER");
+
+ if ( __isCreateAlbum == true)
{
- __pProgressAnim->ChangeOrientation(GetClientAreaBounds());
- __pProgressAnim->Invalidate(true);
+ OnCreateAlbum();
+ __isCreateAlbum = false;
}
+ __isKeyPadOpen = false;
+ AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+}
+
+void
+AlbumNameEditorForm::OnKeypadOpened(Tizen::Ui::Control& source)
+{
+ AppLogDebug("ENTER");
+ __isKeyPadOpen = true;
+ AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}