From 3205067268d672f710066094af690aeca069a99a Mon Sep 17 00:00:00 2001 From: chitta ranjan Date: Mon, 13 May 2013 17:16:35 +0900 Subject: [PATCH] Nabi issue fix for .ico image Change-Id: I2a6250a045422e022cf23b23ede83ed9b484d1fd Signed-off-by: chitta ranjan --- src/IvImageCropForm.cpp | 19 +++++++++++++++++- src/IvImageViewerForm.cpp | 49 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 66 insertions(+), 2 deletions(-) diff --git a/src/IvImageCropForm.cpp b/src/IvImageCropForm.cpp index 7fb4c90..1c2a5f1 100644 --- a/src/IvImageCropForm.cpp +++ b/src/IvImageCropForm.cpp @@ -147,6 +147,7 @@ void ImageCropForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs) { AppLogDebug("ENTER pArgs(%x)", pArgs); + if (pArgs != null) { __sourceFilePath = *(static_cast(pArgs->GetAt(0))); @@ -210,6 +211,7 @@ void ImageCropForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId) { AppLogDebug("ENTER"); + __pPresentationModel->RemoveFileUpdateListener(*this); AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); } @@ -260,6 +262,20 @@ ImageCropForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) case IDA_BUTTON_SAVE: { + ImageBuffer imageBuffer; + result r = imageBuffer.Construct(__sourceFilePath); + + if (r != E_SUCCESS) + { + MessageBox messageBox; + messageBox.Construct(L"", ResourceManager::GetString(L"IDS_COM_BODY_UNSUPPORTED_FILE_TYPE"), MSGBOX_STYLE_NONE, 3000); + int modalResult = 0; + messageBox.ShowAndWait(modalResult); + UiApp* pApp = UiApp::GetInstance(); + pApp->Terminate(); + return; + } + if (File::IsFileExist(__sourceFilePath)) { ImageViewerApp* pApp = dynamic_cast(UiApp::GetInstance()); @@ -995,7 +1011,8 @@ ImageCropForm::SetValue(void) __pCanvas->SetForegroundColor(CROP_BOX_RECTANGLE_COLOR); } -void ImageCropForm::OnFormFileEventOccuered(const int index, const unsigned long eventId) +void +ImageCropForm::OnFormFileEventOccuered(const int index, const unsigned long eventId) { AppLogDebug(" ENTER"); UiApp::GetInstance()->Terminate(); diff --git a/src/IvImageViewerForm.cpp b/src/IvImageViewerForm.cpp index ccef395..3f44086 100644 --- a/src/IvImageViewerForm.cpp +++ b/src/IvImageViewerForm.cpp @@ -228,7 +228,6 @@ ImageViewerForm::OnInitializing(void) AddControl(__pPopUp); } - if (__initializeDisplayModeCurrent == APPCONTROL_MODE_NORMAL || __initializeDisplayModeCurrent == APPCONTROL_MODE_MESSAGE || __initializeDisplayModeCurrent == APPCONTROL_MODE_EMAIL) @@ -1565,6 +1564,20 @@ ImageViewerForm::OnActionPerformed(const Control& source, int actionId) case IDA_CONTEXTMENU_HOME: { String filePath = __pPresentationModel->GetFilePathAt(__pGallery->GetCurrentItemIndex()); + ImageBuffer imageBuffer; + result r = imageBuffer.Construct(filePath); + + if (r != E_SUCCESS) + { + MessageBox messageBox; + messageBox.Construct(L"", ResourceManager::GetString(L"IDS_COM_BODY_UNSUPPORTED_FILE_TYPE"), MSGBOX_STYLE_NONE, 3000); + int modalResult = 0; + messageBox.ShowAndWait(modalResult); + UiApp* pApp = UiApp::GetInstance(); + pApp->Terminate(); + return; + } + if (File::IsFileExist(filePath)) { String cropMode = APPCONTROL_DATA_FIT_TO_SCREEN; @@ -1590,6 +1603,20 @@ ImageViewerForm::OnActionPerformed(const Control& source, int actionId) case IDA_CONTEXTMENU_LOCK: { String filePath = __pPresentationModel->GetFilePathAt(__pGallery->GetCurrentItemIndex()); + ImageBuffer imageBuffer; + result r = imageBuffer.Construct(filePath); + + if (r != E_SUCCESS) + { + MessageBox messageBox; + messageBox.Construct(L"", ResourceManager::GetString(L"IDS_COM_BODY_UNSUPPORTED_FILE_TYPE"), MSGBOX_STYLE_NONE, 3000); + int modalResult = 0; + messageBox.ShowAndWait(modalResult); + UiApp* pApp = UiApp::GetInstance(); + pApp->Terminate(); + return; + } + if (File::IsFileExist(filePath)) { String cropMode = APPCONTROL_DATA_FIT_TO_SCREEN; @@ -1621,6 +1648,12 @@ ImageViewerForm::OnActionPerformed(const Control& source, int actionId) result r = imagebuffer.Construct(filePath); if (r != E_SUCCESS) { + MessageBox messageBox; + messageBox.Construct(L"", ResourceManager::GetString(L"IDS_COM_BODY_UNSUPPORTED_FILE_TYPE"), MSGBOX_STYLE_NONE, 3000); + int modalResult = 0; + messageBox.ShowAndWait(modalResult); + UiApp* pApp = UiApp::GetInstance(); + pApp->Terminate(); return; } int imageWidth = imagebuffer.GetWidth(); @@ -1651,6 +1684,20 @@ ImageViewerForm::OnActionPerformed(const Control& source, int actionId) case IDA_CONTEXTMENU_HOME_AND_LOCK: { String filePath = __pPresentationModel->GetFilePathAt(__pGallery->GetCurrentItemIndex()); + ImageBuffer imageBuffer; + result r = imageBuffer.Construct(filePath); + + if (r != E_SUCCESS) + { + MessageBox messageBox; + messageBox.Construct(L"", ResourceManager::GetString(L"IDS_COM_BODY_UNSUPPORTED_FILE_TYPE"), MSGBOX_STYLE_NONE, 3000); + int modalResult = 0; + messageBox.ShowAndWait(modalResult); + UiApp* pApp = UiApp::GetInstance(); + pApp->Terminate(); + return; + } + if (File::IsFileExist(filePath)) { String cropMode = APPCONTROL_DATA_FIT_TO_SCREEN; -- 2.7.4