Change delete string
[apps/osp/ImageViewer.git] / src / IvImageViewerForm.cpp
index 543393b..3dcd141 100644 (file)
@@ -578,7 +578,8 @@ ImageViewerForm::CreateGallery(void)
        case SLIDE_SHOW_TRANSITION_EFFECT_ZOOM:
                __pGallery->SetSlideShowAnimation(Controls::GALLERY_ANIMATION_ZOOM);
                break;
-       case SLIDE_SHOW_TRANSITION_EFFECT_SLIDE:
+       case SLIDE_SHOW_TRANSITION_EFFECT_PAGE:
+               __pGallery->SetSlideShowAnimation(Controls::GALLERY_ANIMATION_PAGE);
                break;
        }
 
@@ -718,7 +719,7 @@ ImageViewerForm::InitializePopup(void)
 
                Label* pLabel = new (std::nothrow) Label();
                pLabel->Construct(Rectangle(0, 0, popupClientBounds.width, H_DELETE_LABEL),
-                               ResourceManager::GetString(L"IDS_COM_BODY_DELETE") + L"?");
+                               ResourceManager::GetString(L"IDS_COM_POP_DELETE_Q"));
 
                Button* pDeleteButton = new (std::nothrow) Button();
                pDeleteButton->Construct(
@@ -872,7 +873,6 @@ ImageViewerForm::SetDetailInfo(void)
 
        Rectangle clientRect = GetClientAreaBounds();
        __pScrollPanel->SetBounds(0,__pLabel->GetHeight(), clientRect.width, clientRect.height - __pLabel->GetHeight());
-
        int currentIndex = __pGallery->GetCurrentItemIndex();
        String strFilePath = __pPresentationModel->GetFilePathAt(currentIndex);
 
@@ -986,7 +986,23 @@ ImageViewerForm::SetDetailInfo(void)
        for (int i = 0; i < DETAIL_COUNT_MAX; ++i)
        {
                __pDetail_FileInfo_Value_Label[i]->SetText(strResult[i]);
-               __pDetail_FileInfo_Value_Label[i]->RequestRedraw();
+
+               if (i == DETAIL_COUNT_MAX - 1)
+               {
+                       __pDetail_FileInfo_Value_Label[i]->SetBounds(
+                                       Rectangle(X_DETAIL_FILEINFO_LABEL,
+                                                       GAP_H_DETAIL_TEXT * (i + 1) + H_DETAIL_MAIN_TEXT + (H_DETAIL_MAIN_TEXT * i) + H_DETAIL_SUB_TEXT * (i + 1),
+                                                       clientRect.width - GAP_W_END_OF_LABEL, H_DETAIL_FILEINFO_VALUE_LABEL * 3));
+               }
+               else
+               {
+                       __pDetail_FileInfo_Value_Label[i]->SetBounds(
+                                       Rectangle(X_DETAIL_FILEINFO_LABEL,
+                                                       GAP_H_DETAIL_TEXT * (i + 1) + H_DETAIL_MAIN_TEXT + (H_DETAIL_MAIN_TEXT * i) + H_DETAIL_SUB_TEXT * (i + 1),
+                                                       clientRect.width - GAP_W_END_OF_LABEL, H_DETAIL_FILEINFO_VALUE_LABEL));
+               }
+
+               __pDetail_FileInfo_Value_Label[i]->Invalidate(true);
        }
 
        if (__initializeDisplayModeCurrent == APPCONTROL_MODE_WEB_LINK)
@@ -1101,7 +1117,7 @@ ImageViewerForm::CreateItem(int index)
 
        int curIndex = index;
 
-       if(__shuffle == true && __pShuffledList != null)
+       if (__shuffle == true && __pShuffledList != null)
        {
                curIndex = __pShuffledList[index];
        }
@@ -1424,9 +1440,26 @@ ImageViewerForm::OnActionPerformed(const Control& source, int actionId)
        case ACTION_ID_FOOTER_BUTTON_CROP:
        {
                String filePath;
+               filePath = __pPresentationModel->GetFilePathAt(__pGallery->GetCurrentItemIndex());
+               ImageBuffer imagebuffer;
+               result r = imagebuffer.Construct(filePath);
+               if (r != E_SUCCESS)
+               {
+                       return;
+               }
+               int imageWidth = imagebuffer.GetWidth();
+               int imageHeight = imagebuffer.GetHeight();
+               if (imageWidth <= (CROP_RECTANGLE_HEIGHT * 3) || imageHeight <= (CROP_RECTANGLE_HEIGHT * 3))
+               {
+                       MessageBox messageBox;
+                       String messageText = ResourceManager::GetString(L"IDS_IMGE_POP_IMAGE_IS_TOO_SMALL");
+                       messageBox.Construct(L"", messageText, MSGBOX_STYLE_OK, 3000);
+                       int modalResult = 0;
+                   messageBox.ShowAndWait(modalResult);
+                   return;
+               }
                String cropMode = L"auto";
                ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
-               filePath = __pPresentationModel->GetFilePathAt(__pGallery->GetCurrentItemIndex());
                pList->Add(new (std::nothrow) String(filePath));
                pList->Add(new (std::nothrow) String(cropMode));
                pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_CROP), pList);
@@ -1811,8 +1844,7 @@ ImageViewerForm::OnTimerExpired(Timer &timer)
                 __pSettingPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
                                                        ENTRY_NAME_IMAGE_VIEWER_SHUFFLE_VALUE, shuffleValue);
 
-               
-               if(shuffleValue != 0)
+               if (shuffleValue != 0)
                {
                        __shuffelStartIndex = __pGallery->GetCurrentItemIndex();
                        CreateShuffledList(__pPresentationModel->GetFileCount());
@@ -1824,7 +1856,7 @@ ImageViewerForm::OnTimerExpired(Timer &timer)
                        __shuffle = false;
                }
 
-               if( repeatValue == 0)
+               if ( repeatValue == 0)
                {
                        __pGallery->StartSlideShow(false);
                }
@@ -2143,7 +2175,7 @@ ImageViewerForm::GetQuickThumbnailN(String& filePath)
                {
                        Canvas mainCanvas;
                        mainCanvas.Construct(DUMMY_IMAGE_RECTANGLE);
-                       mainCanvas.FillRectangle(Color::GetColor(COLOR_ID_WHITE), DUMMY_IMAGE_RECTANGLE);
+                       mainCanvas.FillRectangle(Color::GetColor(COLOR_ID_BLACK), DUMMY_IMAGE_RECTANGLE);
                        pBitmap = new (std::nothrow) Bitmap();
                        pBitmap->Construct(mainCanvas, DUMMY_IMAGE_RECTANGLE);
                }
@@ -2219,9 +2251,8 @@ ImageViewerForm::OnSlideSettingPopUpItemSelected(int index)
        if (index == 0)   // start slide show
        {
        int repeatValue = 0;
-
                int interval = 0 ;
-
+               int transitioneffect = 0;
 
                if (__pPresentationModel->GetFileCount() > 1)
                {
@@ -2247,6 +2278,22 @@ ImageViewerForm::OnSlideSettingPopUpItemSelected(int index)
                        __pSettingPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
                                        ENTRY_NAME_IMAGE_VIEWER_SHUFFLE_VALUE, shuffleValue);
 
+                        __pSettingPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
+                                   ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_TRANSITION_EFFECT, transitioneffect);
+
+                        if (transitioneffect == 1)
+                        {
+                                __pGallery->SetSlideShowAnimation(GALLERY_ANIMATION_DISSOLVE);
+                        }
+                        else if (transitioneffect == 2)
+                        {
+                                __pGallery->SetSlideShowAnimation(GALLERY_ANIMATION_ZOOM);
+                        }
+                        else
+                        {
+                                __pGallery->SetSlideShowAnimation(GALLERY_ANIMATION_PAGE);
+                        }
+
                        if (shuffleValue != 0)
                        {
                                __shuffelStartIndex = __pGallery->GetCurrentItemIndex();