Modify wallpaper operation and fix N_SE-36828 issue
authorTaeHo Choi <thanks.choi@samsung.com>
Mon, 29 Apr 2013 07:45:53 +0000 (16:45 +0900)
committerTaeHo Choi <thanks.choi@samsung.com>
Mon, 29 Apr 2013 08:37:05 +0000 (17:37 +0900)
Change-Id: I87982bdba60251117709e97cf97c18812cb04091
Signed-off-by: TaeHo Choi <thanks.choi@samsung.com>
src/StNfcForm.cpp
src/StWallpaperAlbumListDetailForm.cpp
src/StWallpaperAlbumListPresentationModel.cpp

index 7b4fcb9..2d33b02 100644 (file)
@@ -430,13 +430,8 @@ NfcForm::OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableVie
                                __pTableView->SetItemChecked(groupIndex, itemIndex, !__pTableView->IsItemChecked(groupIndex, itemIndex));
                                return;
                        }
-                       result r = E_FAILURE;
                        __isNfcBusy = true;
-                       r = ToggleNfcActivateStatus(status);
-                       if (IsFailed(r))
-                       {
-                               AppLogDebug("ToggleWifiActivateStatus is Fail");
-                       }
+                       ToggleNfcActivateStatus(status);
 
                        __pTableView->UpdateTableView();
                }
@@ -569,14 +564,17 @@ NfcForm::ToggleNfcActivateStatus(Tizen::Ui::Controls::TableViewItemStatus itemSt
                AppLogDebug("__pNfcPresentationModelInstance is null");
                return E_FAILURE;
        }
+       result r = E_SUCCESS;
 
        switch (itemStatus)
        {
        case TABLE_VIEW_ITEM_STATUS_CHECKED:
                {
-                       if (!__pNfcPresentationModelInstance->IsNfcActivated())
+                       r = __pNfcPresentationModelInstance->ActivateNfc();
+                       if (IsFailed(r))
                        {
-                               __pNfcPresentationModelInstance->ActivateNfc();
+                               AppLogDebug("Nfc active is failed %s", GetErrorMessage(r));
+                               __isNfcBusy = false;
                        }
 
                        if (__isPredefinedItem)
@@ -588,9 +586,11 @@ NfcForm::ToggleNfcActivateStatus(Tizen::Ui::Controls::TableViewItemStatus itemSt
 
        case TABLE_VIEW_ITEM_STATUS_UNCHECKED:
                {
-                       if (__pNfcPresentationModelInstance->IsNfcActivated())
+                       r = __pNfcPresentationModelInstance->DeactivateNfc();
+                       if (IsFailed(r))
                        {
-                               __pNfcPresentationModelInstance->DeactivateNfc();
+                               AppLogDebug("Nfc deactive is failed %s", GetErrorMessage(r));
+                               __isNfcBusy = false;
                        }
 
                        if (__isPredefinedItem)
index 704d275..9535806 100644 (file)
@@ -281,7 +281,6 @@ WallpaperAlbumListDetailForm::OnIconListViewItemStateChanged(IconListView& view,
        AppLogDebug("ENTER");
        if (status == ICON_LIST_VIEW_ITEM_SELECTED)
        {
-#if 0
                IList* pContentIdList = __pPresentationModel->GetContentIdList();
                __pContentId = static_cast<ContentId*>(pContentIdList->GetAt(index));
                HashMap extraData;
@@ -308,18 +307,6 @@ WallpaperAlbumListDetailForm::OnIconListViewItemStateChanged(IconListView& view,
                        pAc->Start(&uri, null, &extraData, this);
                        delete pAc;
                }
-#else
-               SceneManager* pSceneManager = SceneManager::GetInstance();
-
-               IList* pContentIdList = __pPresentationModel->GetContentIdList();
-               ContentId* pContentId = static_cast<ContentId*>(pContentIdList->GetAt(index));
-
-               ArrayList* aList = new (std::nothrow) ArrayList(SingleObjectDeleter);
-               aList->Construct();
-               aList->Add(pContentId);
-
-               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_WALLPAPER_IMAGE_SELECT, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), aList);
-#endif
        }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
@@ -469,26 +456,6 @@ WallpaperAlbumListDetailForm::OnAppControlCompleteResponseReceived(const AppId&
                                                {
                                                        for (int i = 0; i < pValueList->GetCount(); i++)
                                                        {
-                                                               if (__pContentId == null)
-                                                               {
-                                                                       delete pEnum;
-                                                                       return;
-                                                               }
-                                                               ContentManager pContentManager;
-                                                               pContentManager.Construct();
-                                                               ImageContentInfo* pImageContentInfo = static_cast<ImageContentInfo*>(pContentManager.GetContentInfoN(*__pContentId));
-
-                                                               if (pImageContentInfo == null)
-                                                               {
-                                                                       MessageBox messageBox;
-                                                                       int result = E_SUCCESS;
-
-                                                                       messageBox.Construct(ResourceManager::GetString(L"IDS_EMAIL_POP_ALERT"), ResourceManager::GetString(L"IDS_COM_POP_FAILED"), MSGBOX_STYLE_NONE, MESSAGEBOX_DISPLAY_TIME_2_SEC);
-                                                                       messageBox.ShowAndWait(result);
-
-                                                                       break;
-                                                               }
-
                                                                String dstPath = Application::GetInstance()->GetAppDataPath();
                                                                String srcPath = *dynamic_cast<String*>(pValueList->GetAt(i));
                                                                String srcFileExtention = File::GetFileExtension(srcPath);
@@ -530,12 +497,11 @@ WallpaperAlbumListDetailForm::OnAppControlCompleteResponseReceived(const AppId&
                                                                                if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN, dstPath) != E_SUCCESS)
                                                                                {
                                                                                        AppLogDebug("Wallpapaer Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
-                                                                                       return;
                                                                                }
+
                                                                                if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN_LOCK, dstPath) != E_SUCCESS)
                                                                                {
                                                                                        AppLogDebug("Wallpapaer Lock Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
-                                                                                       return;
                                                                                }
                                                                        }
                                                                        break;
index d0bd6eb..97face6 100644 (file)
@@ -199,8 +199,21 @@ WallpaperAlbumListPresentationModel::DrawPartialImage(Canvas& canvas, AlbumInfo*
                AppLogDebug("pContentInfo is null");
                return;
        }
+       Bitmap* pBitmap2 = pContentInfo->GetThumbnailN();
        Bitmap* pBitmap1 = ResourceManager::GetApplicationBitmapN(pContentInfo->GetContentPath());
-       if (pBitmap1 != null)
+       if (pBitmap2 != null)
+       {
+               Rectangle rectFirst(ICON_CAP+FOLDER_CAP, ICON_CAP,
+                               ICON_CAP * DOUBLE_NUMBER + ICON_SIZE * TRIPLE_NUMBER,
+                               ICON_CAP * DOUBLE_NUMBER + ICON_SIZE * TRIPLE_NUMBER);
+               r = canvas.DrawBitmap(rectFirst, *pBitmap2);
+               if (pBitmap1 != null)
+               {
+                       delete pBitmap1;
+               }
+               delete pBitmap2;
+       }
+       else if (pBitmap1 != null)
        {
                Rectangle rectFirst(ICON_CAP+FOLDER_CAP, ICON_CAP,
                                ICON_CAP * DOUBLE_NUMBER + ICON_SIZE * TRIPLE_NUMBER,
@@ -347,7 +360,32 @@ WallpaperAlbumListPresentationModel::CreateDetailMergeBitmapN(int index)
                return null;
        }
        Bitmap* pBitmap = ResourceManager::GetApplicationBitmapN(pContentInfo->GetContentPath());
-       if (pBitmap != null)
+       Bitmap* pBitmap2 = pContentInfo->GetThumbnailN();
+       if (pBitmap2 != null)
+       {
+               int itemRectLineSize = 0;
+
+               Rectangle canvasRect = canvas.GetBounds();
+               if (__pCurrentFolderContentsIdList->GetCount() < FOLDER_BITMAP_MAX)
+               {
+                       itemRectLineSize = MAX_UNDER_FILE_SIZE;
+               }
+               else
+               {
+                       itemRectLineSize = MAX_OVER_FILE_SIZE;
+               }
+               Rectangle rectFirst(ICON_CAP + FOLDER_CAP, ICON_CAP,
+                               ICON_CAP * DOUBLE_NUMBER + ICON_SIZE * TRIPLE_NUMBER,
+                               ICON_CAP * DOUBLE_NUMBER + ICON_SIZE * TRIPLE_NUMBER);
+               canvas.FillRectangle(COLOR_BG_GROUP_ITEM_DEFAULT, canvasRect);
+               r = canvas.DrawBitmap(rectFirst, *pBitmap2);
+               if (pBitmap != null)
+               {
+                       delete pBitmap;
+               }
+               delete pBitmap2;
+       }
+       else if (pBitmap != null)
        {
                int itemRectLineSize = 0;