Nabi issue fix for .ico image
authorchitta ranjan <chitta.rs@samsung.com>
Mon, 13 May 2013 08:16:35 +0000 (17:16 +0900)
committerchitta ranjan <chitta.rs@samsung.com>
Mon, 13 May 2013 08:16:35 +0000 (17:16 +0900)
Change-Id: I2a6250a045422e022cf23b23ede83ed9b484d1fd
Signed-off-by: chitta ranjan <chitta.rs@samsung.com>
src/IvImageCropForm.cpp
src/IvImageViewerForm.cpp

index 7fb4c90..1c2a5f1 100644 (file)
@@ -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<String*>(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<ImageViewerApp*>(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();
index ccef395..3f44086 100644 (file)
@@ -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;