mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgcontainer.cpp
changeset 4 beaa16f65879
parent 2 b70d77332e66
child 5 2a40e88564c8
equal deleted inserted replaced
3:3f752ecfeea4 4:beaa16f65879
   730                 }
   730                 }
   731 			SetDetailIconShuffleL();
   731 			SetDetailIconShuffleL();
   732             }
   732             }
   733         else if ( aType == KEikDynamicLayoutVariantSwitch )
   733         else if ( aType == KEikDynamicLayoutVariantSwitch )
   734             {
   734             {
       
   735             if ( iCurrentViewType == EMPXViewCoverFlow )
       
   736                 {
       
   737                 if ( iDialog ) 
       
   738                     {
       
   739                     iDialog->CancelPopup();
       
   740                     iDialog = NULL;
       
   741                     }                
       
   742                 }
   735             if( iCurrentViewType == EMPXViewTBone )
   743             if( iCurrentViewType == EMPXViewTBone )
   736                 {
   744                 {
   737 				iCollectionUtility->Collection().BackL();
   745 				iCollectionUtility->Collection().BackL();
   738                 }
   746                 }
   739             else
   747             else
  1477 
  1485 
  1478     // TODO. Define here in which views we need to have buffering enabled in the list
  1486     // TODO. Define here in which views we need to have buffering enabled in the list
  1479     if( iContext == EContextGroupAlbum ||
  1487     if( iContext == EContextGroupAlbum ||
  1480         iContext == EContextGroupArtist ||
  1488         iContext == EContextGroupArtist ||
  1481         iContext == EContextGroupSong ||
  1489         iContext == EContextGroupSong ||
       
  1490         iContext == EContextItemPlaylist ||
  1482         iContext == EContextGroupGenre )
  1491         iContext == EContextGroupGenre )
  1483         {
  1492         {
  1484         iListWidget->EnableScrollBufferL(*this, KMPXListBufferSize, KMPXListBufferSize/4);
  1493         iListWidget->EnableScrollBufferL(*this, KMPXListBufferSize, KMPXListBufferSize/4);
  1485         }
  1494         }
  1486     else
  1495     else
  4169 void CMPXCollectionViewHgContainer::ShowAlbumSongsDialogL( const CMPXMedia& aResults )
  4178 void CMPXCollectionViewHgContainer::ShowAlbumSongsDialogL( const CMPXMedia& aResults )
  4170     {
  4179     {
  4171     CAknSinglePopupMenuStyleListBox* listBox = new ( ELeave ) CAknSinglePopupMenuStyleListBox;
  4180     CAknSinglePopupMenuStyleListBox* listBox = new ( ELeave ) CAknSinglePopupMenuStyleListBox;
  4172     CleanupStack::PushL( listBox );
  4181     CleanupStack::PushL( listBox );
  4173 
  4182 
  4174     CAknPopupList* dialog = CAknPopupList::NewL(listBox, R_MPX_COLLECTION_ALBUMSONGS_LIST_CBA,
  4183     iDialog = CAknPopupList::NewL(listBox, R_MPX_COLLECTION_ALBUMSONGS_LIST_CBA,
  4175             AknPopupLayouts::EDynMenuWindow );
  4184             AknPopupLayouts::EDynMenuWindow );
  4176 
  4185 
  4177 	CleanupStack::PushL( dialog );
  4186 	CleanupStack::PushL( iDialog );
  4178 
  4187 
  4179     listBox->ConstructL( dialog,
  4188     listBox->ConstructL( iDialog,
  4180             EAknListBoxSelectionList | EAknListBoxScrollBarSizeExcluded  );
  4189             EAknListBoxSelectionList | EAknListBoxScrollBarSizeExcluded  );
  4181 	CleanupStack::Pop( dialog );
  4190 	
  4182 
  4191 
  4183     listBox->CreateScrollBarFrameL( ETrue );
  4192     listBox->CreateScrollBarFrameL( ETrue );
  4184     listBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff,
  4193     listBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff,
  4185             CEikScrollBarFrame::EAuto );
  4194             CEikScrollBarFrame::EAuto );
  4186 
  4195 
  4188     if ( iSelectedMediaInAlbumView && iSelectedMediaInAlbumView->IsSupported( KMPXMediaMusicAlbum ) )
  4197     if ( iSelectedMediaInAlbumView && iSelectedMediaInAlbumView->IsSupported( KMPXMediaMusicAlbum ) )
  4189         {
  4198         {
  4190         const TDesC& album = iSelectedMediaInAlbumView->ValueText( KMPXMediaMusicAlbum );
  4199         const TDesC& album = iSelectedMediaInAlbumView->ValueText( KMPXMediaMusicAlbum );
  4191             if ( album.Compare( KNullDesC ) != 0 )
  4200             if ( album.Compare( KNullDesC ) != 0 )
  4192             {
  4201             {
  4193             dialog->SetTitleL( album );
  4202             iDialog->SetTitleL( album );
  4194             }
  4203             }
  4195         }
  4204         }
  4196 
  4205 
  4197     CMPXMediaArray* songArray(const_cast<CMPXMediaArray*>( aResults.Value<CMPXMediaArray>(
  4206     CMPXMediaArray* songArray(const_cast<CMPXMediaArray*>( aResults.Value<CMPXMediaArray>(
  4198             KMPXMediaArrayContents ) ) );
  4207             KMPXMediaArrayContents ) ) );
  4225         }
  4234         }
  4226 
  4235 
  4227     CTextListBoxModel* model = listBox->Model();
  4236     CTextListBoxModel* model = listBox->Model();
  4228     model->SetItemTextArray( songList );
  4237     model->SetItemTextArray( songList );
  4229     model->SetOwnershipType( ELbmOwnsItemArray );
  4238     model->SetOwnershipType( ELbmOwnsItemArray );
  4230     TBool play = dialog->ExecuteLD();
  4239     TBool play = iDialog->ExecuteLD();
  4231     TInt index = listBox->CurrentItemIndex();
  4240     CleanupStack::Pop( iDialog );
  4232     if( play )
  4241     if( play )
  4233         {
  4242         {
       
  4243         TInt index = listBox->CurrentItemIndex();
  4234         // If item in list was opened, we only play the selected one.
  4244         // If item in list was opened, we only play the selected one.
  4235         SaveSelectedAlbumItemL(iSelectedAlbumIndex);
  4245         SaveSelectedAlbumItemL(iSelectedAlbumIndex);
  4236         // Open the selected song of album
  4246         // Open the selected song of album
  4237         UpdatePathAndOpenL(index);
  4247         UpdatePathAndOpenL(index);
  4238         }
  4248         }