mpxmusicplayer/app/src/mpxappui.cpp
changeset 2 b70d77332e66
parent 0 ff3acec5bc43
child 4 beaa16f65879
equal deleted inserted replaced
1:8118492f1bdf 2:b70d77332e66
  1999         }
  1999         }
  2000     else if ( op == EMcMsgDiskRemoved )
  2000     else if ( op == EMcMsgDiskRemoved )
  2001         {
  2001         {
  2002         if ( !IsEmbedded() )
  2002         if ( !IsEmbedded() )
  2003             {
  2003             {
       
  2004             TBool usbDiskRemovalEvent(EFalse);
       
  2005             if ( (op == EMcMsgDiskRemoved) && iIsUsbOnGoing )
       
  2006                 {
       
  2007                 usbDiskRemovalEvent = ETrue;
       
  2008                 }
       
  2009             else
       
  2010                 {
       
  2011                 MPX_DEBUG1( "CMPXAppUi::HandleBroadcastMessageL. MMC ejected and the application needs to close." );
       
  2012                 RunAppShutter();
       
  2013 				return;
       
  2014                 }
       
  2015 
  2004             CMPXCollectionPath* cPath = iCollectionUtility->Collection().PathL ( );
  2016             CMPXCollectionPath* cPath = iCollectionUtility->Collection().PathL ( );
  2005             CleanupStack::PushL ( cPath );
  2017             CleanupStack::PushL ( cPath );
  2006             TBool usbDiskRemovalEvent(EFalse);
       
  2007             if ( (op == EMcMsgDiskRemoved) && iIsUsbOnGoing )
       
  2008                 {
       
  2009                 usbDiskRemovalEvent = ETrue;
       
  2010                 }
       
  2011 
       
  2012             if ( cPath->Levels ( )> 1 && !iFormattingOnGoing && !usbDiskRemovalEvent &&
  2018             if ( cPath->Levels ( )> 1 && !iFormattingOnGoing && !usbDiskRemovalEvent &&
  2013                  iCurrentViewType.iUid != KMPXPluginTypePlaybackUid )
  2019                  iCurrentViewType.iUid != KMPXPluginTypePlaybackUid )
  2014                 {
  2020                 {
  2015 
  2021 
  2016                     cPath->Back ( );
  2022                     cPath->Back ( );
  3629 				TInt err( KErrNone );
  3635 				TInt err( KErrNone );
  3630 				while( IsDisplayingDialog() && err == KErrNone )
  3636 				while( IsDisplayingDialog() && err == KErrNone )
  3631 					{
  3637 					{
  3632 					TRAP( err, iCoeEnv->SimulateKeyEventL(key,EEventKey); )
  3638 					TRAP( err, iCoeEnv->SimulateKeyEventL(key,EEventKey); )
  3633 					}
  3639 					}
  3634 
  3640                 }
  3635 				// Options/Exit selected, close also the MM suite
  3641 
  3636                 if( aCommand == EAknCmdExit )
  3642             TBool needToExit( EFalse );
  3637                     {
       
  3638                     LaunchMmViewL( KMmMessage );
       
  3639                     }
       
  3640 				}
       
  3641 
       
  3642             if ( iSaveMode != EMPXSaveModeIdle )
  3643             if ( iSaveMode != EMPXSaveModeIdle )
  3643                 {
  3644                 {
  3644                 iCancelFileMan = ETrue;
  3645                 iCancelFileMan = ETrue;
  3645                 }
  3646                 }
  3646             else
  3647             else
  3654                     {
  3655                     {
  3655                     MMPXPlayerManager& manager = iPlaybackUtility->PlayerManager();
  3656                     MMPXPlayerManager& manager = iPlaybackUtility->PlayerManager();
  3656                     TRAP_IGNORE( manager.ClearSelectPlayersL() );
  3657                     TRAP_IGNORE( manager.ClearSelectPlayersL() );
  3657                     iPlaybackUtility->CommandL( EPbCmdClose );
  3658                     iPlaybackUtility->CommandL( EPbCmdClose );
  3658                     }
  3659                     }
  3659 
  3660                 needToExit = ETrue;
       
  3661                 }
       
  3662 
       
  3663             if( aCommand == EAknCmdExit )
       
  3664                 {
       
  3665                 // Options/Exit selected, close also the MM suite
       
  3666                 LaunchMmViewL( KMmMessage );
       
  3667                 }
       
  3668             if( needToExit )
       
  3669                 {
  3660                 Exit();
  3670                 Exit();
  3661                 }
  3671                 }
  3662             break;
  3672             break;
  3663             }
  3673             }
  3664         case EAknCmdHelp:
  3674         case EAknCmdHelp: