int count = 1;
int index = 0;
String destFilePath;
+ ImageViewerApp* pApp = dynamic_cast<ImageViewerApp*>(UiApp::GetInstance());
+
if (__sourceFilePath.IsEmpty() == false)
{
- __sourceFilePath.Reverse();
- __sourceFilePath.IndexOf(FILE_EXT_SEPARATOR, 0, index);
- __sourceFilePath.Reverse();
- __sourceFilePath.Insert(FILE_NAME_SEPARATOR, __sourceFilePath.GetLength() - index - 1);
- destFilePath.Append(__sourceFilePath);
- destFilePath.Insert(count, destFilePath.GetLength() - index - 1);
- while (File::IsFileExist(destFilePath) == true)
+ if (pApp->GetAppControlOperationId() == APPCONTROL_OPERATION_ID_IMAGE_CROP)
+ {
+ destFilePath.Append(App::GetInstance()->GetAppDataPath());
+ destFilePath.Append(__pPresentationModel->GetFileName(__sourceFilePath));
+ destFilePath.Reverse();
+ destFilePath.IndexOf(FILE_EXT_SEPARATOR, 0, index);
+ destFilePath.Reverse();
+ destFilePath.Insert(FILE_NAME_SEPARATOR, destFilePath.GetLength() - index - 1);
+ destFilePath.Insert(count, destFilePath.GetLength() - index - 1);
+
+ while (File::IsFileExist(destFilePath) == true)
+ {
+ count++;
+ destFilePath.Clear();
+ destFilePath.Append(App::GetInstance()->GetAppDataPath());
+ destFilePath.Append(__pPresentationModel->GetFileName(__sourceFilePath));
+ destFilePath.Insert(FILE_NAME_SEPARATOR, destFilePath.GetLength() - index - 1);
+ destFilePath.Insert(count, destFilePath.GetLength() - index - 1);
+ }
+
+ }
+ else
{
- count++;
- destFilePath.Clear();
+ __sourceFilePath.Reverse();
+ __sourceFilePath.IndexOf(FILE_EXT_SEPARATOR, 0, index);
+ __sourceFilePath.Reverse();
+ __sourceFilePath.Insert(FILE_NAME_SEPARATOR, __sourceFilePath.GetLength() - index - 1);
destFilePath.Append(__sourceFilePath);
destFilePath.Insert(count, destFilePath.GetLength() - index - 1);
+ while (File::IsFileExist(destFilePath) == true)
+ {
+ count++;
+ destFilePath.Clear();
+ destFilePath.Append(__sourceFilePath);
+ destFilePath.Insert(count, destFilePath.GetLength() - index - 1);
+ }
+
}
+
pCropBuffer = __imageBuffer.CropN(((__cropBox.x - __imageBox.x) * __imageWidth) / __imageBox.width, ((__cropBox.y - __imageBox.y) * __imageHeight) / __imageBox.height,
(__cropBox.width * __imageWidth) / __imageBox.width, (__cropBox.height * __imageHeight) / __imageBox.height);
pCropBuffer->EncodeToFile(destFilePath, __imageFormat, true, 100);
}
ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
pList->Add(new (std::nothrow) String(destFilePath));
- ImageViewerApp* pApp = dynamic_cast<ImageViewerApp*>(UiApp::GetInstance());
if (pApp->GetAppControlOperationId() == APPCONTROL_OPERATION_ID_IMAGE_CROP)
{
__pContextMenuMore->Show();
}
break;
+
case IDA_CONTEXTMENU_SET_AS:
+ {
InitializeContextMenuSetAs();
-
__pContextMenuSetAs->SetShowState(true);
__pContextMenuSetAs->Show();
- break;
+ }
+ break;
+
case IDA_FOOTER_BUTTON_SHARE:
+ {
InitializeContextMenuShare();
-
__pContextMenuShare->SetShowState(true);
__pContextMenuShare->Show();
- break;
+ }
+ break;
+
case IDA_FOOTER_BUTTON_DELETE:
+ {
__pDeletePopup->SetShowState(true);
__pDeletePopup->Show();
- break;
+ }
+ break;
+
case IDA_FOOTER_BUTTON_SLIDE:
{
if (__pPopUp != null)
__pPopUp->SetShowState(true);
__pPopUp->Show();
}
-
- break;
}
+ break;
+
case IDA_FOOTER_BUTTON_CROP:
{
String filePath;
ContentManager::ScanFile(filePath);
}
break;
+
case IDA_FOOTER_BUTTON_ROTATE_LEFT:
{
int currentIndex = __pGallery->GetCurrentItemIndex();
ContentManager::ScanFile(filePath);
}
break;
+
case IDA_FOOTER_BUTTON_DETAILS:
{
ShowPanelDetail(__isDetail);
- break;
}
+ break;
+
case IDA_FOOTER_BUTTON_BACK:
+ {
ImageViewerForm::OnFormBackRequested(*this);
- break;
+ }
+ break;
+
case IDA_FOOTER_BUTTON_DOWNLOAD:
+ {
DownloadFile();
- break;
+ }
+ break;
+
case IDA_FOOTER_BUTTON_SAVE:
- break;
+ break;
+
case IDA_PANEL_HEADER_DETAILS_RENAME:
{
ArrayList* pSelectedIndex = new (std::nothrow) ArrayList(SingleObjectDeleter);
pSelectedIndex->Construct();
pSelectedIndex->Add(new (std::nothrow) Integer(__pGallery->GetCurrentItemIndex()));
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_NAME_EDITOR), pSelectedIndex);
- break;
}
+ break;
+
case IDA_CONTEXTMENU_HOME:
{
String filePath = __pPresentationModel->GetFilePathAt(__pGallery->GetCurrentItemIndex());
pList->Add(new (std::nothrow) String(cropMode));
pList->Add(new (std::nothrow) Integer(SET_AT_TYPE_HOME_SCREEN_WALLPAPER));
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_CROP), pList);
- break;
}
+ break;
+
case IDA_CONTEXTMENU_LOCK:
{
String filePath = __pPresentationModel->GetFilePathAt(__pGallery->GetCurrentItemIndex());
pList->Add(new (std::nothrow) String(cropMode));
pList->Add(new (std::nothrow) Integer(SET_AT_TYPE_LOCK_SCREEN_WALLPAPER));
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_CROP), pList);
- break;
}
+ break;
+
case IDA_CONTEXTMENU_CALLER:
{
HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
__pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_CONTACTS,
APPCONTROL_OPERATION_ID_SOCIAL_PICK, null, null, pDataList, this);
- break;
}
+ break;
case IDA_CONTEXTMENU_HOME_AND_LOCK:
{
pList->Add(new (std::nothrow) String(cropMode));
pList->Add(new (std::nothrow) Integer(SET_AT_TYPE_HOME_AND_LOCK_SCREEN_WALLPAPER));
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_CROP), pList);
- break;
}
+ break;
case IDA_CONTEXTMENU_EMAIL:
{
OnRequestEmailAction();
- break;
}
+ break;
+
case IDA_CONTEXTMENU_MESSAGE:
{
OnRequestMessagesAction();
- break;
}
+ break;
+
case IDA_CONTEXTMENU_COPY:
{
int currentIndex = __pGallery->GetCurrentItemIndex();
item.Construct(CLIPBOARD_DATA_TYPE_IMAGE, filePath);
Clipboard* pClipboard = Clipboard::GetInstance();
pClipboard->CopyItem(item);
- break;
}
+ break;
+
case IDA_DELETE_POPUP_DEL:
{
__pDeletePopup->SetShowState(false);
{
ShowPanelDetail(false);
}
- break;
}
+ break;
+
case IDA_DELETE_POPUP_CANCEL:
{
__pDeletePopup->SetShowState(false);
__pDeletePopup->Show();
- break;
}
+ break;
+
case IDA_CONTORL_BUTTON_PLAY:
+ {
CallVideoPlayer();
- break;
+ }
+ break;
+
default:
break;
}
__pGallery->UpdateGallery();
__pGallery->SetCurrentItemIndex(count);
__pPresentationModel->RequestImage(filePath);
- ShowPanelDetail(__isDetail);
+ ShowPanelDetail(false);
}
if (__pGallery->GetCurrentItemIndex() < 0)