From 0be7bf7e3e0fe49186784fdf594f838661f6c258 Mon Sep 17 00:00:00 2001 From: Myunkyu Date: Sat, 13 Apr 2013 21:20:00 +0900 Subject: [PATCH] Fixed jira issue and fixed prevent issue Change-Id: I44ba628a85035abaa31e56db3994a6b9a3f9d166 --- inc/MpCommonUtil.h | 2 +- inc/MpMusicPlayerForm.h | 1 + src/MpAllListEditorPanel.cpp | 9 +------- src/MpArtistListEditorPanel.cpp | 10 ++++----- src/MpCommonUtil.cpp | 16 ++++++++----- src/MpContentEditPanel.cpp | 9 ++++---- src/MpContentListForm.cpp | 2 +- src/MpFolderContentListForm.cpp | 1 - src/MpFolderListPresentationModel.cpp | 33 +++++++++++++++------------ src/MpMusicPlayerForm.cpp | 42 ++++++++++++++++++++++++----------- src/MpPlaylistContentListForm.cpp | 7 ++++-- src/MpPlaylistListEditorPanel.cpp | 1 + src/MpSettingForm.cpp | 4 ++++ src/MpUserPlaylistContentListForm.cpp | 7 ++++-- 14 files changed, 87 insertions(+), 57 deletions(-) diff --git a/inc/MpCommonUtil.h b/inc/MpCommonUtil.h index e97e427..ff41b45 100644 --- a/inc/MpCommonUtil.h +++ b/inc/MpCommonUtil.h @@ -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); diff --git a/inc/MpMusicPlayerForm.h b/inc/MpMusicPlayerForm.h index 1a6e1ca..6bc0658 100644 --- a/inc/MpMusicPlayerForm.h +++ b/inc/MpMusicPlayerForm.h @@ -211,6 +211,7 @@ private: int __transactionID; unsigned int __playerScreenState; bool __isAnimationPerformed; + bool __isRunByAppControl; Tizen::Base::Runtime::Timer* __pAnimationFinishedTimer; Tizen::Base::Runtime::Timer* __pContentPlayTimer; diff --git a/src/MpAllListEditorPanel.cpp b/src/MpAllListEditorPanel.cpp index 0d3a61b..7d5710b 100644 --- a/src/MpAllListEditorPanel.cpp +++ b/src/MpAllListEditorPanel.cpp @@ -73,9 +73,6 @@ void AllListEditorPanel::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) { AppLogDebug("ENTER"); - Form* pForm = dynamic_cast(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(GetParent()); - AppAssert(pForm); - - Footer* pFooter = pForm->GetFooter(); - + Footer* pFooter = GetFooter(); pFooter->RemoveAllButtons(); pFooter->RemoveAllItems(); pFooter->RemoveActionEventListener(*this); diff --git a/src/MpArtistListEditorPanel.cpp b/src/MpArtistListEditorPanel.cpp index 3b92004..d4162ee 100644 --- a/src/MpArtistListEditorPanel.cpp +++ b/src/MpArtistListEditorPanel.cpp @@ -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(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(GetParent()); - AppAssert(pForm); + ContentPanel::OnSceneDeactivated(currentSceneId, nextSceneId); - Footer* pFooter = pForm->GetFooter(); + Footer* pFooter = GetFooter(); pFooter->RemoveAllButtons(); pFooter->RemoveAllItems(); pFooter->RemoveActionEventListener(*this); diff --git a/src/MpCommonUtil.cpp b/src/MpCommonUtil.cpp index b520e58..66f76ac 100644 --- a/src/MpCommonUtil.cpp +++ b/src/MpCommonUtil.cpp @@ -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 // { diff --git a/src/MpContentEditPanel.cpp b/src/MpContentEditPanel.cpp index f264f46..6735363 100644 --- a/src/MpContentEditPanel.cpp +++ b/src/MpContentEditPanel.cpp @@ -224,7 +224,7 @@ ContentEditPanel::SetCheckedCountBallonTooltip(unsigned int checkedItemCount) return ; } - __pBallonTooltip->SetText(CommonUtil::GetStringItemSelectd(checkedItemCount)); + __pBallonTooltip->SetText(CommonUtil::GetStringItemSelected(checkedItemCount)); if (__pBallonTooltip->GetShowState() == false) { SetShowStateBalloonTooltip(true); @@ -304,7 +304,7 @@ ContentEditPanel::OnMusicContentUpdateCompleted(void) if (__pContentTableView != null && IsEmptyContentList() == false) { - CommonUtil::SetAllCheckState(false, *__pContentTableView, __pContentTableView->GetItemCount()); + SetItemCheckedAll(false); __pContentTableView->UpdateTableView(); } CommonUtil::SetFooterItemEnabled(*GetFooter(), false); @@ -326,7 +326,7 @@ ContentEditPanel::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collect Boolean* pIsInitialize = static_cast(pArgs->GetAt(0)); if (pIsInitialize->Equals(true)) { - CommonUtil::SetAllCheckState(false, *__pContentTableView, __pContentTableView->GetItemCount()); + SetItemCheckedAll(false); } pArgs->RemoveAll(true); delete pArgs; @@ -334,8 +334,6 @@ ContentEditPanel::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collect RemovePlayListPicker(); RemoveSharePicker(); - - CommonUtil::SetFooterItemEnabled(*GetFooter(), false); AppLogDebug("EXIT"); } @@ -347,6 +345,7 @@ ContentEditPanel::UpdateContentEditScreenState(void) { SetShowStateContentTableview(false); SetShowStateNoContent(true); + SetShowStateBalloonTooltip(false); GetHeader()->SetButtonEnabled(BUTTON_POSITION_RIGHT, false); GetHeader()->Invalidate(true); diff --git a/src/MpContentListForm.cpp b/src/MpContentListForm.cpp index 761a972..0bfb1ac 100644 --- a/src/MpContentListForm.cpp +++ b/src/MpContentListForm.cpp @@ -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); diff --git a/src/MpFolderContentListForm.cpp b/src/MpFolderContentListForm.cpp index d313994..de81232 100644 --- a/src/MpFolderContentListForm.cpp +++ b/src/MpFolderContentListForm.cpp @@ -781,7 +781,6 @@ FolderContentListForm::UpdateContentList(void) AppLogDebug("ENTER"); __pPresentationModel->UpdateFolderPathList(); __pPresentationModel->InitializeContentList(__currentFolderIndex); - UpdateTableView(); AppLogDebug("EXIT"); } diff --git a/src/MpFolderListPresentationModel.cpp b/src/MpFolderListPresentationModel.cpp index 7977ff3..66529a7 100644 --- a/src/MpFolderListPresentationModel.cpp +++ b/src/MpFolderListPresentationModel.cpp @@ -115,6 +115,12 @@ FolderListPresentationModel::GetContentCount(int folderIndex) } else { + if (__pFolderPathList == null) + { + AppLogDebug("EXIT"); + return INIT_VALUE; + } + String* pStrPath = static_cast(__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(__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 diff --git a/src/MpMusicPlayerForm.cpp b/src/MpMusicPlayerForm.cpp index c890183..2a6e8be 100644 --- a/src/MpMusicPlayerForm.cpp +++ b/src/MpMusicPlayerForm.cpp @@ -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(__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(__pContentsAlbumViewPanel->GetControl(IDC_CONTENTS_THUMBNAIL))->SetBackgroundBitmap(*pThumb); delete pThumb; -// static_cast(__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(__pContentsAlbumViewPanel->GetControl(IDC_CONTENTS_THUMBNAIL))->SetBackgroundBitmap(*pThumb); delete pThumb; -// static_cast(__pContentsAlbumViewPanel->GetControl(IDC_CONTENTS_THUMBNAIL))->RemoveTouchEventListener(*this); } break; diff --git a/src/MpPlaylistContentListForm.cpp b/src/MpPlaylistContentListForm.cpp index cf9e4d8..d13fdfb 100644 --- a/src/MpPlaylistContentListForm.cpp +++ b/src/MpPlaylistContentListForm.cpp @@ -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; + } } } } diff --git a/src/MpPlaylistListEditorPanel.cpp b/src/MpPlaylistListEditorPanel.cpp index 833e23e..ce57436 100644 --- a/src/MpPlaylistListEditorPanel.cpp +++ b/src/MpPlaylistListEditorPanel.cpp @@ -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"); diff --git a/src/MpSettingForm.cpp b/src/MpSettingForm.cpp index ac5d12d..ac5d139 100644 --- a/src/MpSettingForm.cpp +++ b/src/MpSettingForm.cpp @@ -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(pGroupTableViewItem->GetControl(IDC_LABEL_SUB_TEXT)); diff --git a/src/MpUserPlaylistContentListForm.cpp b/src/MpUserPlaylistContentListForm.cpp index 883f4d8..86d6dfe 100644 --- a/src/MpUserPlaylistContentListForm.cpp +++ b/src/MpUserPlaylistContentListForm.cpp @@ -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; + } } } } -- 2.7.4