mpxplugins/viewplugins/views/podcastview/src/mpxpodcastcollectionviewimp.cpp
branchRCL_3
changeset 14 c54d95799c80
parent 11 943ff5625028
child 15 a1247965635c
equal deleted inserted replaced
13:c8156a91d13c 14:c54d95799c80
   123 const TInt KMPXLastDirectoryLevel( 2 );
   123 const TInt KMPXLastDirectoryLevel( 2 );
   124 //#endif //__UPNP_FRAMEWORK_2_0_
   124 //#endif //__UPNP_FRAMEWORK_2_0_
   125 // MACROS
   125 // MACROS
   126 _LIT(KMPXCollDetailsItemsFormat, "%S\t%S");
   126 _LIT(KMPXCollDetailsItemsFormat, "%S\t%S");
   127 
   127 
   128 const TInt KProgressBarMaxValue = 100; // Max Value for the Progress Info bar
       
   129 #ifdef __ENABLE_PODCAST_IN_MUSIC_MENU
   128 #ifdef __ENABLE_PODCAST_IN_MUSIC_MENU
   130 #define KMusicCollectionUid 0x101FFC3A
   129 #define KMusicCollectionUid 0x101FFC3A
   131 #endif
   130 #endif
   132 
   131 
   133 // ======== MEMBER FUNCTIONS ========
   132 // ======== MEMBER FUNCTIONS ========
   371         CleanupStack::Pop(confirmationDlg);
   370         CleanupStack::Pop(confirmationDlg);
   372         CleanupStack::PopAndDestroy(promptTxt);
   371         CleanupStack::PopAndDestroy(promptTxt);
   373         if (confirmationDlg->ExecuteLD(R_MPX_CUI_DELETE_CONFIRMATION_QUERY))
   372         if (confirmationDlg->ExecuteLD(R_MPX_CUI_DELETE_CONFIRMATION_QUERY))
   374             {
   373             {
   375             HandleCommandL( EMPXCmdIgnoreExternalCommand );
   374             HandleCommandL( EMPXCmdIgnoreExternalCommand );
   376             StartProgressNoteL();
   375             StartDeleteWaitNoteL();
   377             TPtr buf = waitNoteText->Des();
   376             TPtr buf = waitNoteText->Des();
   378 			UpdateProcessL(0, buf);
   377 			UpdateProcessL(buf);
   379             iCollectionUiHelper->DeleteL(*path, this);
   378             iCollectionUiHelper->DeleteL(*path, this);
   380             iIsDeleting = ETrue;
   379             iIsDeleting = ETrue;
   381 
   380 
   382           }
   381           }
   383         CleanupStack::PopAndDestroy(waitNoteText);
   382         CleanupStack::PopAndDestroy(waitNoteText);
   882         }
   881         }
   883     return ret;
   882     return ret;
   884     }
   883     }
   885 
   884 
   886 // ---------------------------------------------------------------------------
   885 // ---------------------------------------------------------------------------
   887 // Start a Progress note
   886 // Start a delete wait note
   888 // ---------------------------------------------------------------------------
   887 // ---------------------------------------------------------------------------
   889 //
   888 //
   890 void CMPXPodcastCollectionViewImp::StartProgressNoteL()	
   889 void CMPXPodcastCollectionViewImp::StartDeleteWaitNoteL()	
   891 	{
   890 	{
   892 	iProgressDialog = new (ELeave) CAknProgressDialog(
   891     iWaitDialog = new (ELeave) CAknWaitDialog(
   893 		(REINTERPRET_CAST(CEikDialog**, &iProgressDialog)),
   892 		(REINTERPRET_CAST(CEikDialog**, &iWaitDialog)),
   894 		ETrue);
   893 		ETrue);
   895 	iProgressDialog->PrepareLC(R_MPX_PROGRESS_NOTE);
   894     iWaitDialog->PrepareLC(R_MPX_DELETE_WAIT_NOTE);
   896 	iProgressInfo = iProgressDialog->GetProgressInfoL();
   895     iWaitDialog->SetCallback(this);
   897     iProgressDialog->SetCallback(this);
   896     iWaitDialog->RunLD();
   898     iProgressDialog->RunLD();
       
   899 	iProgressInfo->SetFinalValue(KProgressBarMaxValue);	
       
   900 	}
   897 	}
   901  
   898  
   902 // ---------------------------------------------------------------------------
   899 // ---------------------------------------------------------------------------
   903 // Update the Progress note
   900 // Update the delete wait note
   904 // ---------------------------------------------------------------------------
   901 // ---------------------------------------------------------------------------
   905 //
   902 //
   906 void CMPXPodcastCollectionViewImp::UpdateProcessL(TInt aProgress,const TDesC& aProgressText)
   903 void CMPXPodcastCollectionViewImp::UpdateProcessL(const TDesC& aDeleteNoteText)
   907 	{
   904 	{
   908 	if(iProgressDialog)
   905 	if(iWaitDialog)
   909 		{
   906 		{
   910 		iProgressDialog->SetTextL(aProgressText);
   907         iWaitDialog->SetTextL(aDeleteNoteText);	
   911 		iProgressInfo->SetAndDraw(aProgress);	
       
   912     	}
   908     	}
   913 	}
   909 	}
   914 
   910 
   915 // -----------------------------------------------------------------------------
   911 // -----------------------------------------------------------------------------
   916 // Change the button group
   912 // Change the button group
  2409                 if (iCommonUiHelper)
  2405                 if (iCommonUiHelper)
  2410                     {
  2406                     {
  2411                     iCommonUiHelper->DismissWaitNoteL();
  2407                     iCommonUiHelper->DismissWaitNoteL();
  2412                     HandleCommandL( EMPXCmdHandleExternalCommand );
  2408                     HandleCommandL( EMPXCmdHandleExternalCommand );
  2413                     }
  2409                     }
  2414                 if (iProgressDialog)
  2410                 if (iWaitDialog)
  2415 					{
  2411 					{
  2416 					iProgressDialog->ProcessFinishedL();
  2412                     iWaitDialog->ProcessFinishedL();
  2417 					}
  2413 					}
  2418                 if (iIsDeleting)
  2414                 if (iIsDeleting)
  2419                     {
  2415                     {
  2420                     iCollectionUiHelper->Cancel();
  2416                     iCollectionUiHelper->Cancel();
  2421                     iIsDeleting = EFalse;
  2417                     iIsDeleting = EFalse;
  2799 
  2795 
  2800     if (iIsDeleting)
  2796     if (iIsDeleting)
  2801         {
  2797         {
  2802         // nothing else to delete
  2798         // nothing else to delete
  2803         iIsDeleting = EFalse;
  2799         iIsDeleting = EFalse;
  2804         if (iProgressDialog)
  2800         if (iWaitDialog)
  2805 			{
  2801 			{
  2806 			iProgressDialog->ProcessFinishedL();
  2802             iWaitDialog->ProcessFinishedL();
  2807 			}
  2803 			}
  2808         HandleCommandL( EMPXCmdHandleExternalCommand );
  2804         HandleCommandL( EMPXCmdHandleExternalCommand );
  2809         }
  2805         }
  2810     MPX_PERF_CHECKPT("Collection View opened");
  2806     MPX_PERF_CHECKPT("Collection View opened");
  2811     }
  2807     }
  2936             {
  2932             {
  2937             // do not dismiss the wait note until HandleOpenL is called,
  2933             // do not dismiss the wait note until HandleOpenL is called,
  2938             if(aErr == KErrInUse)
  2934             if(aErr == KErrInUse)
  2939                 {
  2935                 {
  2940                 iIsDeleting = EFalse;
  2936                 iIsDeleting = EFalse;
  2941 				if (iProgressDialog)
  2937 				if (iWaitDialog)
  2942 					{
  2938 					{
  2943 					iProgressDialog->ProcessFinishedL();
  2939                     iWaitDialog->ProcessFinishedL();
  2944 					}
  2940 					}
  2945                 HandleCommandL( EMPXCmdHandleExternalCommand );
  2941                 HandleCommandL( EMPXCmdHandleExternalCommand );
  2946                 aErr = KErrNone; //handled here
  2942                 aErr = KErrNone; //handled here
  2947                 HBufC* text(NULL);
  2943                 HBufC* text(NULL);
  2948                 if(iContainer->Common()->CurrentSelectionIndicesL()->Count() == 0)
  2944                 if(iContainer->Common()->CurrentSelectionIndicesL()->Count() == 0)
  2964             else if (aErr != KErrNone)
  2960             else if (aErr != KErrNone)
  2965                 {
  2961                 {
  2966                 iIsDeleting = EFalse;
  2962                 iIsDeleting = EFalse;
  2967                 if(!iIsWaitNoteCanceled)
  2963                 if(!iIsWaitNoteCanceled)
  2968                     {
  2964                     {
  2969                     if (iProgressDialog)
  2965                     if (iWaitDialog)
  2970                     	{
  2966                     	{
  2971 						iProgressDialog->ProcessFinishedL();
  2967                         iWaitDialog->ProcessFinishedL();
  2972 						}
  2968 						}
  2973                     HandleCommandL( EMPXCmdHandleExternalCommand );
  2969                     HandleCommandL( EMPXCmdHandleExternalCommand );
  2974                     iIsWaitNoteCanceled = EFalse;
  2970                     iIsWaitNoteCanceled = EFalse;
  2975                     }
  2971                     }
  2976 
  2972 
  2980 
  2976 
  2981             iContainer->Common()->ClearLbxSelection();
  2977             iContainer->Common()->ClearLbxSelection();
  2982 
  2978 
  2983              // reopen collection
  2979              // reopen collection
  2984             iCollectionUtility->Collection().OpenL();
  2980             iCollectionUtility->Collection().OpenL();
  2985             break;
       
  2986             }
       
  2987         case EDeleteStatusOp:
       
  2988             {
       
  2989             if ( aArgument )
       
  2990                 {
       
  2991                 CMPXMedia* media = (CMPXMedia*)aArgument;
       
  2992                 CleanupStack::PushL( media );
       
  2993                 if ( media->IsSupported( KMPXMediaGeneralCount ) )
       
  2994                     {
       
  2995                     TInt deletePercent = media->ValueTObjectL<TInt>( KMPXMediaGeneralCount );
       
  2996                     MPX_DEBUG2( "CMPXCollectionViewImp::HandleOperationCompleteL % Files Deleted: %d", deletePercent );
       
  2997                     // update WaitNote dialog.
       
  2998                     HBufC* string = StringLoader::LoadLC(R_MPX_QTN_NMP_DEL_BATCH_SONGS_WAIT_NOTE, deletePercent);
       
  2999                     TPtr buf = string->Des();
       
  3000 
       
  3001                     UpdateProcessL(deletePercent, buf);
       
  3002                     CleanupStack::PopAndDestroy( string );
       
  3003                     }
       
  3004                 CleanupStack::PopAndDestroy( media );
       
  3005                 aArgument = NULL;
       
  3006                 }
       
  3007             break;
  2981             break;
  3008             }
  2982             }
  3009         case ERenameOp: // fall through
  2983         case ERenameOp: // fall through
  3010         case ESetOp:
  2984         case ESetOp:
  3011         case EAddOp:
  2985         case EAddOp: