Fixed jira issue and fixed prevent issue
authorMyunkyu <mk70.kang@partner.samsung.com>
Sat, 13 Apr 2013 12:20:00 +0000 (21:20 +0900)
committerMyunkyu <mk70.kang@partner.samsung.com>
Sat, 13 Apr 2013 12:20:00 +0000 (21:20 +0900)
Change-Id: I44ba628a85035abaa31e56db3994a6b9a3f9d166

14 files changed:
inc/MpCommonUtil.h
inc/MpMusicPlayerForm.h
src/MpAllListEditorPanel.cpp
src/MpArtistListEditorPanel.cpp
src/MpCommonUtil.cpp
src/MpContentEditPanel.cpp
src/MpContentListForm.cpp
src/MpFolderContentListForm.cpp
src/MpFolderListPresentationModel.cpp
src/MpMusicPlayerForm.cpp
src/MpPlaylistContentListForm.cpp
src/MpPlaylistListEditorPanel.cpp
src/MpSettingForm.cpp
src/MpUserPlaylistContentListForm.cpp

index e97e427..ff41b45 100644 (file)
@@ -99,7 +99,7 @@ public:
        static Tizen::Ui::Controls::Popup* CreateContentDeletePopup(Tizen::Ui::IActionEventListener& listener, int deleteActionId, int cancelActionId);
        static Tizen::Ui::Controls::Panel* CreateFlickMenuN(Tizen::Ui::IActionEventListener& listener, FlickMenuStyle menuStyle);
        static Tizen::Ui::Controls::TableViewContextItem* CreateTableViewContextItemN(Tizen::Ui::IActionEventListener& listener, int itemWidth, FlickMenuStyle menuStyle);
-       static Tizen::Base::String GetStringItemSelectd(int itemCount);
+       static Tizen::Base::String GetStringItemSelected(int itemCount);
 
        static Tizen::Ui::Controls::Footer* CreateContentListFooter(const Tizen::Ui::Controls::Form& form);
        static Tizen::Ui::Controls::Footer* CreatePlaylistEditFooter(const Tizen::Ui::Controls::Form& form);
index 1a6e1ca..6bc0658 100644 (file)
@@ -211,6 +211,7 @@ private:
        int __transactionID;
        unsigned int __playerScreenState;
        bool __isAnimationPerformed;
+       bool __isRunByAppControl;
 
        Tizen::Base::Runtime::Timer* __pAnimationFinishedTimer;
        Tizen::Base::Runtime::Timer* __pContentPlayTimer;
index 0d3a61b..7d5710b 100644 (file)
@@ -73,9 +73,6 @@ void
 AllListEditorPanel::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
 {
        AppLogDebug("ENTER");
-       Form* pForm = dynamic_cast<Form*>(GetParent());
-       AppAssert(pForm);
-       Footer* pFooter = pForm->GetFooter();
        if (__pPresentationModel == null)
        {
                return;
@@ -178,11 +175,7 @@ AllListEditorPanel::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& current
        AppLogDebug("ENTER");
        ContentPanel::OnSceneDeactivated(currentSceneId, nextSceneId);
 
-       Form* pForm = dynamic_cast<Form*>(GetParent());
-       AppAssert(pForm);
-
-       Footer* pFooter = pForm->GetFooter();
-
+       Footer* pFooter = GetFooter();
        pFooter->RemoveAllButtons();
        pFooter->RemoveAllItems();
        pFooter->RemoveActionEventListener(*this);
index 3b92004..d4162ee 100644 (file)
@@ -120,13 +120,14 @@ ArtistListEditorPanel::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previ
                                                Tizen::Base::Collection::IList* pArgs)
 {
        AppLogDebug("ENTER");
+       ContentPanel::OnSceneActivatedN(previousSceneId, currentSceneId, null);
+
        Form* pForm = dynamic_cast<Form*>(GetParent());
-       Footer* pFooter = null;
        AppAssert(pForm);
        pForm->SetFormBackEventListener(this);
        SetEditHeaderStyle();
 
-       pFooter = CommonUtil::CreateBackButtonStyleFooter(*pForm, STYLE_ADDTO_DELETE_ADD);
+       Footer* pFooter = CommonUtil::CreateBackButtonStyleFooter(*pForm, STYLE_ADDTO_DELETE_ADD);
        pFooter->AddActionEventListener(*this);
        pFooter->SetShowState(true);
        CommonUtil::SetFooterItemEnabled(*pFooter, false);
@@ -146,10 +147,9 @@ ArtistListEditorPanel::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& curr
                                                                        const Tizen::Ui::Scenes::SceneId& nextSceneId)
 {
        AppLogDebug("ENTER");
-       Form* pForm = dynamic_cast<Form*>(GetParent());
-       AppAssert(pForm);
+       ContentPanel::OnSceneDeactivated(currentSceneId, nextSceneId);
 
-       Footer* pFooter = pForm->GetFooter();
+       Footer* pFooter = GetFooter();
        pFooter->RemoveAllButtons();
        pFooter->RemoveAllItems();
        pFooter->RemoveActionEventListener(*this);
index b520e58..66f76ac 100644 (file)
@@ -868,17 +868,23 @@ CommonUtil::CreateFlickMenuN(Tizen::Ui::IActionEventListener& listener, FlickMen
 }
 
 Tizen::Base::String
-CommonUtil::GetStringItemSelectd(int itemCount)
+CommonUtil::GetStringItemSelected(int itemCount)
 {
        AppLogDebug("ENTER");
        String StrSelectStr = null;
 
        if (itemCount > INIT_VALUE)
        {
-               String ResSelect = ResourceManager::GetString("IDS_COM_BODY_SELECTED");
-               ResSelect.Append(L"(%d)");
-
-               StrSelectStr.Format(STRING_LENGTH, ResSelect.GetPointer(), itemCount);
+               if (itemCount == 1)
+               {
+                       String ResSelect = ResourceManager::GetString("IDS_VR_POP_1_ITEM_SELECTED");
+                       StrSelectStr.Format(STRING_LENGTH, ResSelect.GetPointer());
+               }
+               else
+               {
+                       String ResSelect = ResourceManager::GetString("IDS_VR_POP_PD_ITEMS_SELECTED");
+                       StrSelectStr.Format(STRING_LENGTH, ResSelect.GetPointer(), itemCount);
+               }
        }
 //     else
 //     {
index f264f46..6735363 100644 (file)
@@ -224,7 +224,7 @@ ContentEditPanel::SetCheckedCountBallonTooltip(unsigned int checkedItemCount)
                return ;\r
        }\r
 \r
-       __pBallonTooltip->SetText(CommonUtil::GetStringItemSelectd(checkedItemCount));\r
+       __pBallonTooltip->SetText(CommonUtil::GetStringItemSelected(checkedItemCount));\r
        if (__pBallonTooltip->GetShowState() == false)\r
        {\r
                SetShowStateBalloonTooltip(true);\r
@@ -304,7 +304,7 @@ ContentEditPanel::OnMusicContentUpdateCompleted(void)
 \r
        if (__pContentTableView != null && IsEmptyContentList() == false)\r
        {\r
-               CommonUtil::SetAllCheckState(false, *__pContentTableView, __pContentTableView->GetItemCount());\r
+               SetItemCheckedAll(false);\r
                __pContentTableView->UpdateTableView();\r
        }\r
        CommonUtil::SetFooterItemEnabled(*GetFooter(), false);\r
@@ -326,7 +326,7 @@ ContentEditPanel::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collect
                Boolean* pIsInitialize = static_cast<Boolean*>(pArgs->GetAt(0));\r
                if (pIsInitialize->Equals(true))\r
                {\r
-                       CommonUtil::SetAllCheckState(false, *__pContentTableView, __pContentTableView->GetItemCount());\r
+                       SetItemCheckedAll(false);\r
                }\r
                pArgs->RemoveAll(true);\r
                delete pArgs;\r
@@ -334,8 +334,6 @@ ContentEditPanel::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collect
 \r
        RemovePlayListPicker();\r
        RemoveSharePicker();\r
-\r
-       CommonUtil::SetFooterItemEnabled(*GetFooter(), false);\r
        AppLogDebug("EXIT");\r
 }\r
 \r
@@ -347,6 +345,7 @@ ContentEditPanel::UpdateContentEditScreenState(void)
        {\r
                SetShowStateContentTableview(false);\r
                SetShowStateNoContent(true);\r
+               SetShowStateBalloonTooltip(false);\r
 \r
                GetHeader()->SetButtonEnabled(BUTTON_POSITION_RIGHT, false);\r
                GetHeader()->Invalidate(true);\r
index 761a972..0bfb1ac 100644 (file)
@@ -448,7 +448,7 @@ ContentListForm::SetCheckedCountBallonTooltip(unsigned int checkedItemCount)
                return;
        }
 
-       __pBallonTooltip->SetText(CommonUtil::GetStringItemSelectd(checkedItemCount));
+       __pBallonTooltip->SetText(CommonUtil::GetStringItemSelected(checkedItemCount));
        if (__pBallonTooltip->GetShowState() == false)
        {
                SetShowStateBalloonTooltip(true);
index d313994..de81232 100644 (file)
@@ -781,7 +781,6 @@ FolderContentListForm::UpdateContentList(void)
        AppLogDebug("ENTER");
        __pPresentationModel->UpdateFolderPathList();
        __pPresentationModel->InitializeContentList(__currentFolderIndex);
-       UpdateTableView();
        AppLogDebug("EXIT");
 }
 
index 7977ff3..66529a7 100644 (file)
@@ -115,6 +115,12 @@ FolderListPresentationModel::GetContentCount(int folderIndex)
        }
        else
        {
+               if (__pFolderPathList == null)
+               {
+                       AppLogDebug("EXIT");
+                       return INIT_VALUE;
+               }
+
                String* pStrPath = static_cast<String*>(__pFolderPathList->GetAt(folderIndex));
                ContentDirectory directory;
                r = directory.Construct(CONTENT_TYPE_AUDIO);
@@ -256,14 +262,6 @@ void
 FolderListPresentationModel::InitializeContentList(int folderIndex)
 {
        AppLogDebug("ENTER");
-       ContentDirectory contentDirectory;
-       result r = contentDirectory.Construct(CONTENT_TYPE_AUDIO);
-       if (IsFailed(r))
-       {
-               AppLogDebug("EXIT(%s)", GetErrorMessage(r));
-               return;
-       }
-
        if (__pContentList != null)
        {
                __pContentList->RemoveAll(true);
@@ -271,6 +269,14 @@ FolderListPresentationModel::InitializeContentList(int folderIndex)
                __pContentList = null;
        }
 
+       ContentDirectory contentDirectory;
+       result r = contentDirectory.Construct(CONTENT_TYPE_AUDIO);
+       if (IsFailed(r) || __pFolderPathList == null)
+       {
+               AppLogDebug("EXIT(%s)", GetErrorMessage(r));
+               return;
+       }
+
        String* pFolderPath = static_cast<String*>(__pFolderPathList->GetAt(folderIndex));
        if (pFolderPath != null)
        {
@@ -433,8 +439,6 @@ result
 FolderListPresentationModel::UpdateFolderPathList(void)
 {
        AppLogDebug("ENTER");
-       result r = E_SUCCESS;
-
        if (__pFolderPathList != null)
        {
                __pFolderPathList->RemoveAll(true);
@@ -442,11 +446,12 @@ FolderListPresentationModel::UpdateFolderPathList(void)
        }
 
        __pFolderPathList = ContentDirectoryPathList();
-       TryCatch(__pFolderPathList != null, r = E_FAILURE, "__pFolderPathList is null");
+       result r = GetLastResult();
+       if (__pFolderPathList == null)
+       {
+               r = E_FAILURE;
+       }
 
        AppLogDebug("EXIT");
        return r;
-
-CATCH:
-       return r;
 }
\ No newline at end of file
index c890183..2a6e8be 100644 (file)
@@ -143,6 +143,7 @@ PlayerForm::PlayerForm(void)
        , __transactionID(ANIMATION_TRANSACTION_STATUS_STOPPED)
        , __playerScreenState(PLAYER_SCREEN_STATE_NORMAL)
        , __isAnimationPerformed(false)
+       , __isRunByAppControl(false)
        , __pAnimationFinishedTimer(null)
        , __pContentPlayTimer(null)
        , __pPreviousSceneId(null)
@@ -404,6 +405,8 @@ PlayerForm::OnTerminating(void)
                __pAlbumArtElements = null;
        }
 
+       __isRunByAppControl =  false;
+
        RemoveContextMenu();
        RemoveSharePicker();
        RemovePlayListPicker();
@@ -1190,9 +1193,14 @@ PlayerForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
                SetContentInfo( __pPlayerPresentationModel->GetCurrentContentIndex());
                OnPlayStateChanged(__pPlayerPresentationModel->GetPlayerState());
                OnPlayTimeChanged(__pPlayerPresentationModel->GetCurrentDuration(), __pPlayerPresentationModel->GetPlayPosition());
+
+               if (GetPlayerScreenState() == PLAYER_SCREEN_STATE_DURING_CALL)
+               {
+                       SetPlayerScreenState(PLAYER_SCREEN_STATE_NORMAL);
+               }
        }
 
-       if (__pContentsListViewPanel->GetShowState() == true)
+       if (__pContentsListViewPanel->IsEnabled() == true && __isRunByAppControl == false)
        {
                TableView* pContentsTableView = static_cast<TableView*>(__pContentsListViewPanel->GetControl(IDC_CONTENTS_TABLEVIEW));
                pContentsTableView->UpdateTableView();
@@ -1611,8 +1619,11 @@ PlayerForm::SetFileNotExistState(bool isFileExist)
        __pMoreContextButton->SetEnabled(isFileExist);
        __pMoreContextButton->Invalidate(true);
 
-       __pContentsViewToggleButton->SetEnabled(isFileExist);
-       __pContentsViewToggleButton->Invalidate(true);
+       if (__isRunByAppControl == false)
+       {
+               __pContentsViewToggleButton->SetEnabled(isFileExist);
+               __pContentsViewToggleButton->Invalidate(true);
+       }
        AppLogDebug("EXIT");
 }
 
@@ -1964,6 +1975,21 @@ PlayerForm::SetPlayerScreenState(unsigned int playerScreenState)
                        __pForwardButton->SetEnabled(true);
                        __pPlayStateSlider->SetEnabled(true);
                        __pMoreContextButton->SetEnabled(true);
+
+                       if (__isRunByAppControl == false)
+                       {
+                               break;
+                       }
+               }
+               // fall through
+       case PLAYER_SCREEN_STATE_APP_CONTROL:
+               {
+                       __pContentsViewToggleButton->SetEnabled(false);
+                       __pContentsViewToggleButton->Invalidate(true);
+                       __pShuffleButton->SetEnabled(false);
+                       __pRepeatButton->SetEnabled(false);
+
+                       __isRunByAppControl = true;
                }
                break;
 
@@ -1982,15 +2008,6 @@ PlayerForm::SetPlayerScreenState(unsigned int playerScreenState)
                        Bitmap* pThumb = ResourceManager::GetBitmapN(L"music_play_grid_thumb_loading.png");
                        static_cast<Label*>(__pContentsAlbumViewPanel->GetControl(IDC_CONTENTS_THUMBNAIL))->SetBackgroundBitmap(*pThumb);
                        delete pThumb;
-//                     static_cast<Label*>(__pContentsAlbumViewPanel->GetControl(IDC_CONTENTS_THUMBNAIL))->RemoveTouchEventListener(*this);
-               }
-               break;
-
-       case PLAYER_SCREEN_STATE_APP_CONTROL:
-               {
-                       __pContentsViewToggleButton->SetEnabled(false);
-                       __pShuffleButton->SetEnabled(false);
-                       __pRepeatButton->SetEnabled(false);
                }
                break;
 
@@ -2002,7 +2019,6 @@ PlayerForm::SetPlayerScreenState(unsigned int playerScreenState)
                        Bitmap* pThumb = ResourceManager::GetBitmapN(L"music_play_grid_thumb_loading.png");
                        static_cast<Label*>(__pContentsAlbumViewPanel->GetControl(IDC_CONTENTS_THUMBNAIL))->SetBackgroundBitmap(*pThumb);
                        delete pThumb;
-//                     static_cast<Label*>(__pContentsAlbumViewPanel->GetControl(IDC_CONTENTS_THUMBNAIL))->RemoveTouchEventListener(*this);
                }
                break;
 
index cf9e4d8..d13fdfb 100644 (file)
@@ -663,8 +663,11 @@ PlaylistContentListForm::RemoveCheckedTableviewItem(bool itemRemove)
                        {
                                __pContentListTableView->SetItemChecked(iCount, false);
                                ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(iCount);
-                               RemoveContentAt(pContentInfo->contentId);
-                               delete pContentInfo;
+                               if (pContentInfo != null)
+                               {
+                                       RemoveContentAt(pContentInfo->contentId);
+                                       delete pContentInfo;
+                               }
                        }
                }
        }
index 833e23e..ce57436 100644 (file)
@@ -419,6 +419,7 @@ PlaylistListEditorPanel::CreateTableViewItem(Tizen::Ui::Controls::TableViewItem&
        delete pBackgroundPressBitmap;
 
        parent.AddControl(*pTableViewItem);
+       parent.SetIndividualSelectionEnabled(pEditButton, true);
        CommonUtil::SetLayoutFitToContainer(parent, *pTableViewItem);
 
        AppLogDebug("EXIT");
index ac5d12d..ac5d139 100644 (file)
@@ -179,6 +179,8 @@ SettingForm::CreateGroupItem(int groupIndex, int itemWidth)
                        if (IsFailed(pGroupTableViewItem->Construct(IDL_SETTING_PLAYLIST_SET_ITEM_PANEL)))
                        {
                                AppLogDebug("Construct(IDL_SETTING_PLAYLIST_SET_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
+                               delete pGroupTableViewItem;
+                               delete pItem;
                                return null;
                        }
                }
@@ -189,6 +191,8 @@ SettingForm::CreateGroupItem(int groupIndex, int itemWidth)
                        if (IsFailed(pGroupTableViewItem->Construct(IDL_SETTING_OFF_SET_ITEM_PANEL)))
                        {
                                AppLogDebug("Construct(IDL_SETTING_PLAYLIST_SET_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
+                               delete pGroupTableViewItem;
+                               delete pItem;
                                return null;
                        }
                        Label* pSubText = static_cast<Label*>(pGroupTableViewItem->GetControl(IDC_LABEL_SUB_TEXT));
index 883f4d8..86d6dfe 100644 (file)
@@ -582,8 +582,11 @@ UserPlaylistContentListForm::RemoveCheckedTableviewItem(bool itemRemove)
                        {
                                __pContentListTableView->SetItemChecked(iCount, false);
                                ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(iCount);
-                               RemoveContentAt(pContentInfo->contentId);
-                               delete pContentInfo;
+                               if (pContentInfo != null)
+                               {
+                                       RemoveContentAt(pContentInfo->contentId);
+                                       delete pContentInfo;
+                               }
                        }
                }
        }