# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1286969699 -10800 # Node ID c9b63fff5abf92f06217a29d5cf6085ff1e53d10 # Parent 41fba8bcf7b72078516f5b93296aa776fa654598 Revision: 201039 Kit: 201041 diff -r 41fba8bcf7b7 -r c9b63fff5abf voicerecorder/AppSrc/CVRAppUI.cpp --- a/voicerecorder/AppSrc/CVRAppUI.cpp Wed Sep 15 12:15:47 2010 +0300 +++ b/voicerecorder/AppSrc/CVRAppUI.cpp Wed Oct 13 14:34:59 2010 +0300 @@ -161,8 +161,52 @@ // for multiple drives #else + TInt memoDrive = VRUtils::MemoDriveL(); + if (VRUtils::DriveValid(memoDrive)) + { + VRUtils::SetMemoDriveL((TDriveNumber) memoDrive); + } + else + { + TInt defaultDrive = VRUtils::DefaultMemoDriveL(); //eMMC + if (defaultDrive == memoDrive) + { + SetDriveL(); + } + else + { + if (VRUtils::DriveValid(defaultDrive)) + { + VRUtils::SetMemoDriveL((TDriveNumber) defaultDrive); + } + else + { + SetDriveL(); + } + } + } + if (CVRUSBStateHanlder::IsUsbActive()) + { + ShowDialogForWaitUSBPluggingOutL(); + Exit(); + } + + /***** check if memory is below min value, if yes, close app*****/ + RFs& fs(CEikonEnv::Static()->FsSession()); + if (SysUtil::DiskSpaceBelowCriticalLevelL(&fs, 0, + VRUtils::MemoDriveL())) + { + HBufC* errorText = StringLoader::LoadLC( + R_VR_MEMORY_LOW_STOP_WARNING); + CAknErrorNote* dlg = new (ELeave) CAknErrorNote(ETrue); + dlg->ExecuteLD(*errorText); + CleanupStack::PopAndDestroy(errorText); + Exit(); + } + // check memory size end #endif + } CVRRecView* view = CVRRecView::NewLC(R_VR_RECORDER_VIEW, @@ -184,6 +228,70 @@ } // --------------------------------------------------------------------------- +// Make user insert the SD card, and choose SD card as the memo storage +// --------------------------------------------------------------------------- +// +void CVRAppUi::SetDriveL() + { + TInt driveRemovableMassStorage = VRUtils::GetRemovableMassStorageL(); + if ( VRUtils::DriveValid( (TDriveNumber) driveRemovableMassStorage ) ) + { + VRUtils::SetMemoDriveL( (TDriveNumber) driveRemovableMassStorage ); + } + else + { + if (CVRUSBStateHanlder::IsUsbActive()) + { + ShowDialogForWaitUSBPluggingOutL(); + Exit(); + + } + while ( !VRUtils::DriveValid( (TDriveNumber) driveRemovableMassStorage ) ) + { + if (!ShowDialogForWaitStorageCardL()) + { + Exit(); + } + } + // Come to here when driveRemovableMassStorage is valid + VRUtils::SetMemoDriveL( (TDriveNumber) driveRemovableMassStorage ); + } + } + +// --------------------------------------------------------------------------- +// This method show a dialog to warn user to insert the SD card. +// --------------------------------------------------------------------------- +// +TBool CVRAppUi::ShowDialogForWaitStorageCardL() + { + HBufC* text = StringLoader::LoadLC( R_QTN_CCOR_INSERT_MMC ); + CAknQueryDialog* dlg = CAknQueryDialog::NewL(); + TInt result( dlg->ExecuteLD( R_INSERT_F_CARD_DIALOG, *text ) ); + CleanupStack::PopAndDestroy( text ); + + if ( result ) + { + return ETrue; + } + + return EFalse; + } + + +TBool CVRAppUi::ShowDialogForWaitUSBPluggingOutL() +{ + HBufC* text = StringLoader::LoadLC(R_QTN_USB_MODE_NOTE_MODE); + CAknQueryDialog* dlg = CAknQueryDialog::NewL(); + TInt result(dlg->ExecuteLD(R_INSERT_F_USB_PLUG_IN_DIALOG, *text)); + CleanupStack::PopAndDestroy(text); + if (result) + { + return ETrue; + } + return EFalse; +} + +// --------------------------------------------------------------------------- // CVRAppUi::HandleCommandL // // --------------------------------------------------------------------------- diff -r 41fba8bcf7b7 -r c9b63fff5abf voicerecorder/AppSrc/CVRAppUi.h --- a/voicerecorder/AppSrc/CVRAppUi.h Wed Sep 15 12:15:47 2010 +0300 +++ b/voicerecorder/AppSrc/CVRAppUi.h Wed Oct 13 14:34:59 2010 +0300 @@ -118,6 +118,24 @@ */ MVRSelectionProvider* SelectionProviderL(); + + /** + * This method show a dialog to warn user to insert the SD card. + * @return if user insert the SD card or not + */ + static TBool ShowDialogForWaitStorageCardL(); + + /** + * This method show a dialog to warn user to plug the usb cable. + * @return if user plug the usb cable or not + */ + static TBool ShowDialogForWaitUSBPluggingOutL(); + + /** + * Make user insert the SD card, and choose SD card as the memo storage + */ + void SetDriveL(); + private: // data /** * CActiveScheduler wrapper object. Owned. diff -r 41fba8bcf7b7 -r c9b63fff5abf voicerecorder/AppSrc/CVRSettingsDialogMMCSupported.cpp --- a/voicerecorder/AppSrc/CVRSettingsDialogMMCSupported.cpp Wed Sep 15 12:15:47 2010 +0300 +++ b/voicerecorder/AppSrc/CVRSettingsDialogMMCSupported.cpp Wed Oct 13 14:34:59 2010 +0300 @@ -36,15 +36,8 @@ #include #include #include -#include #endif -// ListBox item index -enum TListItemIndex - { - EListItemQualityIndex = 0, - ElistItemMemoStoreIndex, - }; // --------------------------------------------------------------------------- // CVRSettingsDialog::~CVRSettingsDialog // @@ -138,6 +131,7 @@ CAknSettingItem* settingItem; HBufC* itemTitle; + TInt id( 0 ); if ( VRUtils::FeatureEnabled( EVRFeatureShowQualitySetting ) ) { // Add quality setting @@ -151,7 +145,7 @@ CleanupStack::PushL( settingItem ); itemTitle = iCoeEnv->AllocReadResourceLC( R_QTN_VOREC_SET_QUALITY ); - settingItem->ConstructL( EFalse, EListItemQualityIndex, *itemTitle, NULL, + settingItem->ConstructL( EFalse, id, *itemTitle, NULL, R_VR_SETTINGS_DEFAULT_SPEAKER_PAGE, EAknCtPopupField, NULL, R_VR_SETTINGS_QUALITY_TEXTS ); CleanupStack::PopAndDestroy(); // itemTitle @@ -159,6 +153,7 @@ // Add quality item to the settings array iSettingItemArray.AppendL( settingItem ); CleanupStack::Pop(); // settingItem + id++; } if ( VRUtils::MultipleMassStorageAvailable() ) @@ -178,16 +173,21 @@ CleanupStack::Pop(); // settingItem #else //multiple drives - settingItem = new( ELeave ) CAknMemorySelectionSettingItemMultiDrive(0, iDrive ); - CleanupStack::PushL( settingItem ); - TInt includedMedias = AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage | - AknCommonDialogsDynMem::EMemoryTypeMMCExternal; - static_cast< CAknMemorySelectionSettingItemMultiDrive *> ( settingItem )->SetIncludedMediasL( includedMedias ); - // Set memo store item's title - settingItem->ConstructL( EFalse, ElistItemMemoStoreIndex, *itemTitle, NULL, 0, EAknSetListBox ); - // Add memo store item to the settings array - iSettingItemArray.AppendL( settingItem ); - CleanupStack::Pop(); // settingItem + + CAknMemorySelectionDialogMultiDrive* dlg = CAknMemorySelectionDialogMultiDrive::NewL( + ECFDDialogTypeNormal, + R_VOREC_MEMORY_SELECTION_DIALOG, // Default resource Id + EFalse, + AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage | + AknCommonDialogsDynMem::EMemoryTypeMMCExternal); + + CleanupStack::PushL( dlg ); + TBool value = dlg->ExecuteL( iDrive ); + CleanupStack::PopAndDestroy( dlg ); + if (value) + { + VRUtils::SetMemoDriveL( iDrive ); + } #endif @@ -226,17 +226,8 @@ case EEventEditingStarted: // From ProcessCommand->ECmdChange { TInt index( aListBox->CurrentItemIndex() ); - TInt driveDefaultMassStorage = VRUtils::DefaultMemoDriveL(); - TInt driveRemovableMassStorage = VRUtils::GetRemovableMassStorageL(); - if ( index >=0 ) // index is -1 if there are no items in the list { - if(index == ElistItemMemoStoreIndex && - !VRUtils::DriveValid(driveDefaultMassStorage) && - !VRUtils::DriveValid(driveRemovableMassStorage) ) - { - break; - } iSettingItemArray.At( index )->EditItemL( aEventType == EEventEditingStarted ); aListBox->DrawItem( index ); @@ -344,10 +335,7 @@ iDrive = (TDriveNumber)defaultDrive; } } - if(iDrive == defaultDrive || iDrive == VRUtils::GetRemovableMassStorageL()) - { VRUtils::SetMemoDriveL( iDrive ); - } #endif if ( VRUtils::FeatureEnabled( EVRFeatureShowQualitySetting ) ) diff -r 41fba8bcf7b7 -r c9b63fff5abf voicerecorder/RecViewInc/CVRRecView.h --- a/voicerecorder/RecViewInc/CVRRecView.h Wed Sep 15 12:15:47 2010 +0300 +++ b/voicerecorder/RecViewInc/CVRRecView.h Wed Oct 13 14:34:59 2010 +0300 @@ -41,11 +41,6 @@ class CVRRecViewActivationContainer; class CVRRecViewModel; -enum TDialogTypeID { - EDialogForWaitStorageCard = 0, - EDialogForWaitUSBPluggingOut - }; - // CLASS DEFINITION /** * CVRRecView is an CAknView inherited view class that implements @@ -106,47 +101,6 @@ */ TCallBack iCallback; }; - - /* - * One shot class for note pop-up - */ - NONSHARABLE_CLASS( CVRRecViewDialogActivator ) - : public CAsyncOneShot - { - public: // constructor and destructor - CVRRecViewDialogActivator( CVRRecViewModel* aModel); - ~CVRRecViewDialogActivator(); - - public: // new method - void SetDialogType(TDialogTypeID aType); - - void SetViewContexts(TVRRecViewContexts aContext); - - private: // Functions from base classes - - /** - * From CActive. - */ - void RunL(); - void DoCancel(); - - private: // Data: - - /* - * State machine model, not owned - */ - CVRRecViewModel* iModel; - - /* - * The type of dialog - */ - TDialogTypeID iType; - - /* - * Context that is used to activate model - */ - TVRRecViewContexts iContext; - }; public: // Constructors and destructor @@ -331,22 +285,6 @@ * the actual UI container and deletes the empty one. */ void ActivateContainerL(); - - /* - * Check the current state of drives - */ - void CheckDriveState(); - - /** - * This method show a dialog to warn user to insert the SD card. - * @return if user insert the SD card or not - */ - static TBool ShowDialogForWaitStorageCardL(); - - /** - * Make user insert the SD card, and choose SD card as the memo storage - */ - void SetDriveL(); public: virtual TInt HandleUsbPlugInL(); @@ -383,18 +321,8 @@ * asynchronically. Owned. */ CVRRecViewModelActivator* iModelActivator; - - /** - * One shot object that is used to pop up the note - */ - CVRRecViewDialogActivator* iDialogActivator; /** - * The type of dialog - */ - TDialogTypeID iDialogType; - - /** * The command that passed to Handlecommand * */ @@ -406,16 +334,6 @@ CVRUSBStateHanlder* iUSBStateHandler; - /* - * Context that is used to activate model - */ - TVRRecViewContexts iContext; - - /** - * Own: Indicates USB connection dialog is open or not. - * If value is ETrue, don't try to open it again. - */ - TBool iUSBConnectedDialogOpen; }; #endif // __CVRRECVIEW_H__ diff -r 41fba8bcf7b7 -r c9b63fff5abf voicerecorder/RecViewSrc/CVRMdaRecorder.cpp --- a/voicerecorder/RecViewSrc/CVRMdaRecorder.cpp Wed Sep 15 12:15:47 2010 +0300 +++ b/voicerecorder/RecViewSrc/CVRMdaRecorder.cpp Wed Oct 13 14:34:59 2010 +0300 @@ -922,8 +922,7 @@ iTonePlayer->PlayTone( EAvkonSIDVoiceRecordingStopTone ); iTonePlayer->PrepareTone( EAvkonSIDVoiceRecordingStartTone ); - if( ( iAudioRecorder->State() == CMdaAudioRecorderUtility::EOpen ) || - reallyStopping ) + if( reallyStopping ) { // Set lower preference to ensure other sounds will // be played correctly diff -r 41fba8bcf7b7 -r c9b63fff5abf voicerecorder/RecViewSrc/CVRRecView.cpp --- a/voicerecorder/RecViewSrc/CVRRecView.cpp Wed Sep 15 12:15:47 2010 +0300 +++ b/voicerecorder/RecViewSrc/CVRRecView.cpp Wed Oct 13 14:34:59 2010 +0300 @@ -43,8 +43,6 @@ #include #include #include -#include -#include #include "voicerecorder.hrh" #include "CVRRecView.h" @@ -118,13 +116,10 @@ // void CVRRecView::CVRRecViewModelActivator::RunL() { - if(iModel->GetIsDriveReady()) - { - // Activate model in correct context - iModel->SetMemoNameNewL( iContext == EContextRecordNewForRemote); - iModel->EnterContextL( iContext ); - iModel->ActivateL(); - } + // Activate model in correct context + iModel->SetMemoNameNewL( iContext == EContextRecordNewForRemote); + iModel->EnterContextL( iContext ); + iModel->ActivateL(); // Notify recview iCallback.CallBack(); @@ -155,101 +150,6 @@ { } -// --------------------------------------------------------------------------- -// CVRRecView::CVRRecViewDialogActivator::CVRRecViewDialogActivator -// -// --------------------------------------------------------------------------- -// -CVRRecView::CVRRecViewDialogActivator::CVRRecViewDialogActivator( CVRRecViewModel* aModel) -:CAsyncOneShot(EPriorityNormal), iModel(aModel) - { - - } - -// --------------------------------------------------------------------------- -// CVRRecView::CVRRecViewDialogActivator::~CVRRecViewDialogActivator -// -// --------------------------------------------------------------------------- -// -CVRRecView::CVRRecViewDialogActivator::~CVRRecViewDialogActivator() - { - Cancel(); - } - -// --------------------------------------------------------------------------- -// CVRRecView::CVRRecViewDialogActivator::~CVRRecViewDialogActivator -// -// --------------------------------------------------------------------------- -// -void CVRRecView::CVRRecViewDialogActivator::SetDialogType(TDialogTypeID aType) - { - iType = aType; - } - -// --------------------------------------------------------------------------- -// CVRRecView::CVRRecViewDialogActivator::SetViewContexts -// -// --------------------------------------------------------------------------- -// -void CVRRecView::CVRRecViewDialogActivator::SetViewContexts(TVRRecViewContexts aContext) - { - iContext = aContext; - } - -// --------------------------------------------------------------------------- -// CVRRecView::CVRRecViewDialogActivator::DoCancel -// -// --------------------------------------------------------------------------- -// -void CVRRecView::CVRRecViewDialogActivator::DoCancel() - { - } - -// --------------------------------------------------------------------------- -// CVRRecView::CVRRecViewNoteActivator::RunL -// -// --------------------------------------------------------------------------- -// -void CVRRecView::CVRRecViewDialogActivator::RunL() - { - if(iType == EDialogForWaitStorageCard) - { - TInt driveRemovableMassStorage = VRUtils::GetRemovableMassStorageL(); - while ( !VRUtils::DriveValid( (TDriveNumber) driveRemovableMassStorage ) ) - { - if (!ShowDialogForWaitStorageCardL()) - { - iModel->SendExitEvent(); - } - } - // Come to here when driveRemovableMassStorage is valid - VRUtils::SetMemoDriveL( (TDriveNumber) driveRemovableMassStorage ); - - /***** check if memory is below min value, if yes, close app*****/ - RFs& fs(CEikonEnv::Static()->FsSession()); - if (SysUtil::DiskSpaceBelowCriticalLevelL(&fs, 0, VRUtils::MemoDriveL())) - { - HBufC* errorText = StringLoader::LoadLC( - R_VR_MEMORY_LOW_STOP_WARNING); - CAknErrorNote* dlg = new (ELeave) CAknErrorNote(ETrue); - dlg->ExecuteLD(*errorText); - CleanupStack::PopAndDestroy(errorText); - iModel->SendExitEvent(); - } - // check memory size end - - // To activate view model - iModel->SetMemoNameNewL( iContext == EContextRecordNewForRemote); - iModel->SetIsDriveReady(ETrue); - iModel->EnterContextL( iContext ); - iModel->ActivateL(); - } - else if(iType == EDialogForWaitUSBPluggingOut) - { - ShowDialogForWaitUSBPluggingOutL(); - iModel->SendExitEvent(); - } - } // --------------------------------------------------------------------------- // CVRRecView::NewLC @@ -286,7 +186,6 @@ delete iContainer; delete iActivationContainer; - delete iDialogActivator; delete iModel; delete iSendUi; delete iModelActivator; @@ -827,15 +726,11 @@ appUi->AddToViewStackL( *this, iActivationContainer ); iActivationContainer->ActivateL(); - iDialogActivator = new( ELeave ) CVRRecViewDialogActivator(iModel); - CheckDriveState(); - // Activate model in correct context asynchronically. // iContainer will be activated trough callback after model activation TCallBack cb(ActivationCallBack, this); - iContext = static_cast (aCustomMessageId.iUid); - iDialogActivator->SetViewContexts(iContext); - iModelActivator->Activate(iContext , cb); + iModelActivator->Activate( + static_cast (aCustomMessageId.iUid), cb); // Construct the real container iContainer = new (ELeave) CVRRecViewContainer; @@ -844,108 +739,6 @@ iContainer->SetVolumeChangeObserver(iModel); } -// --------------------------------------------------------------------------- -// CVRRecView::CheckDriveState -// -// --------------------------------------------------------------------------- -// -void CVRRecView::CheckDriveState() - { - TInt memoDrive = VRUtils::MemoDriveL(); - if (VRUtils::DriveValid(memoDrive)) - { - VRUtils::SetMemoDriveL((TDriveNumber) memoDrive); - } - else - { - TInt defaultDrive = VRUtils::DefaultMemoDriveL(); //eMMC - if (defaultDrive == memoDrive) - { - SetDriveL(); - } - else - { - if (VRUtils::DriveValid(defaultDrive)) - { - VRUtils::SetMemoDriveL((TDriveNumber) defaultDrive); - } - else - { - SetDriveL(); - } - } - } - - - if (iModel->GetIsDriveReady() && CVRUSBStateHanlder::IsUsbActive()) - { - iModel->SetIsDriveReady(EFalse); - iDialogActivator->SetDialogType(EDialogForWaitUSBPluggingOut); - iDialogActivator->Call(); - } - - - if(iModel->GetIsDriveReady()) - { - /***** check if memory is below min value, if yes, close app*****/ - RFs& fs(CEikonEnv::Static()->FsSession()); - if (SysUtil::DiskSpaceBelowCriticalLevelL(&fs, 0, VRUtils::MemoDriveL())) - { - HBufC* errorText = StringLoader::LoadLC( - R_VR_MEMORY_LOW_STOP_WARNING); - CAknErrorNote* dlg = new (ELeave) CAknErrorNote(ETrue); - dlg->ExecuteLD(*errorText); - CleanupStack::PopAndDestroy(errorText); - iModel->SendExitEvent(); - } - // check memory size end - } - } - -// --------------------------------------------------------------------------- -// Make user insert the SD card, and choose SD card as the memo storage -// --------------------------------------------------------------------------- -// -void CVRRecView::SetDriveL() - { - TInt driveRemovableMassStorage = VRUtils::GetRemovableMassStorageL(); - if ( VRUtils::DriveValid( (TDriveNumber) driveRemovableMassStorage ) ) - { - VRUtils::SetMemoDriveL( (TDriveNumber) driveRemovableMassStorage ); - } - else - { - iModel->SetIsDriveReady(EFalse); - if (CVRUSBStateHanlder::IsUsbActive()) - { - iDialogActivator->SetDialogType(EDialogForWaitUSBPluggingOut); - iDialogActivator->Call(); - } - else - { - iDialogActivator->SetDialogType(EDialogForWaitStorageCard); - iDialogActivator->Call(); - } - } - } - -// --------------------------------------------------------------------------- -// This method show a dialog to warn user to insert the SD card. -// --------------------------------------------------------------------------- -// -TBool CVRRecView::ShowDialogForWaitStorageCardL() - { - HBufC* text = StringLoader::LoadLC( R_QTN_CCOR_INSERT_MMC ); - CAknQueryDialog* dlg = CAknQueryDialog::NewL(); - TInt result( dlg->ExecuteLD( R_INSERT_F_CARD_DIALOG, *text ) ); - CleanupStack::PopAndDestroy( text ); - - if ( result ) - { - return ETrue; - } - return EFalse; - } // --------------------------------------------------------------------------- // CVRRecView::SetFileHandle @@ -1054,18 +847,8 @@ == iModel->VisualStateId() || EStateIdleRecordEmbedded == iModel->VisualStateId()) { - if ( !iUSBConnectedDialogOpen ) - { - iUSBConnectedDialogOpen = ETrue; - TRAPD( err, ShowDialogForWaitUSBPluggingOutL() ); - iUSBConnectedDialogOpen = EFalse; - User::LeaveIfError( err ); - AppUi()->Exit(); - } - else - { - return KErrNone; - } + ShowDialogForWaitUSBPluggingOutL(); + AppUi()->Exit(); } HandleCommandL(ECmdUSBChange); @@ -1084,11 +867,6 @@ HandleCommandL(ECmdUSBChange); - - if(!VRUtils::DriveValid(VRUtils::MemoDriveL())) - { - iModel->SendExitEvent(); - } return KErrNone; } diff -r 41fba8bcf7b7 -r c9b63fff5abf voicerecorder/RecViewSrc/CVRRecViewModel.cpp --- a/voicerecorder/RecViewSrc/CVRRecViewModel.cpp Wed Sep 15 12:15:47 2010 +0300 +++ b/voicerecorder/RecViewSrc/CVRRecViewModel.cpp Wed Oct 13 14:34:59 2010 +0300 @@ -84,8 +84,7 @@ iLabelSets( 2 ), iPreviousCallState( EPSCTsyCallStateNone ), iCanHandleCommands( ETrue ), - iCBAEnabled( ETrue ), - iIsDriveReady( ETrue ) + iCBAEnabled( ETrue ) { } @@ -805,7 +804,7 @@ // TInt CVRRecViewModel::ButtonState( TInt aButtonId ) const { - if(CVRUSBStateHanlder::IsUsbActive() || !iIsDriveReady) + if(CVRUSBStateHanlder::IsUsbActive()) { return EDimmed; } @@ -2433,44 +2432,14 @@ ( !CVRUSBStateHanlder::IsUsbActive() ) ) { //exit for mmc dismount - SendExitEvent(); + TWsEvent event; + event.SetType( EAknSoftkeyExit ); + event.SetTimeNow(); + event.SetHandle( CCoeEnv::Static()->WsSession().WsHandle() ); + CCoeEnv::Static()->WsSession().SendEventToWindowGroup( CEikonEnv::Static()->RootWin().Identifier(), event ); + return; } - } - -// --------------------------------------------------------------------------- -// CVRRecViewModel::SendExitEvent -// -// --------------------------------------------------------------------------- -// -void CVRRecViewModel::SendExitEvent() - { - TWsEvent event; - event.SetType( EAknSoftkeyExit ); - event.SetTimeNow(); - event.SetHandle( CCoeEnv::Static()->WsSession().WsHandle() ); - CCoeEnv::Static()->WsSession().SendEventToWindowGroup( CEikonEnv::Static()->RootWin().Identifier(), event ); - return; - } - -// --------------------------------------------------------------------------- -// CVRRecViewModel::SetIsDriveReady -// -// --------------------------------------------------------------------------- -// -void CVRRecViewModel::SetIsDriveReady(TBool aIsDriveReady) - { - iIsDriveReady = aIsDriveReady; - } - -// --------------------------------------------------------------------------- -// CVRRecViewModel::GetIsDriveReady -// -// --------------------------------------------------------------------------- -// -TBool CVRRecViewModel::GetIsDriveReady() - { - return iIsDriveReady; - } + } // End of file diff -r 41fba8bcf7b7 -r c9b63fff5abf voicerecorder/RecViewSrc/CVRRecViewModel.h --- a/voicerecorder/RecViewSrc/CVRRecViewModel.h Wed Sep 15 12:15:47 2010 +0300 +++ b/voicerecorder/RecViewSrc/CVRRecViewModel.h Wed Oct 13 14:34:59 2010 +0300 @@ -432,23 +432,7 @@ */ TVRQuality Quality() const; - /** - * Send exit event to UI - */ - void SendExitEvent(); - - /** - * Set the value of iIsDriveReady. - * @param The new value of iIsDriveReady. - */ - void SetIsDriveReady(TBool aIsDriveReady); - - /** - * Get the value of iIsDriveReady. - * @return The value of iIsDriveReady. - */ - TBool GetIsDriveReady(); - + private: // new methods /** @@ -751,11 +735,6 @@ * causes no action. */ TBool iCBAEnabled; - - /** - * To judge whether the current drive is ready for recording - */ - TBool iIsDriveReady; }; #endif // __CVRRECVIEWMODEL_H__ diff -r 41fba8bcf7b7 -r c9b63fff5abf voicerecorder/UtilsSrc/VRUtils.cpp --- a/voicerecorder/UtilsSrc/VRUtils.cpp Wed Sep 15 12:15:47 2010 +0300 +++ b/voicerecorder/UtilsSrc/VRUtils.cpp Wed Oct 13 14:34:59 2010 +0300 @@ -1087,7 +1087,8 @@ TInt removableStorageErr = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, driveRemovableMassStorage ); if ( (defaultStorageErr) || (removableStorageErr) || - ( driveDefaultMassStorage == driveRemovableMassStorage ) ) + ( driveDefaultMassStorage == driveRemovableMassStorage ) || + !DriveValid(driveDefaultMassStorage) || !DriveValid(driveRemovableMassStorage) ) { flag = EFalse; } return flag; diff -r 41fba8bcf7b7 -r c9b63fff5abf voicerecorder/gsplugin/src/CVRGSPluginContainer.cpp --- a/voicerecorder/gsplugin/src/CVRGSPluginContainer.cpp Wed Sep 15 12:15:47 2010 +0300 +++ b/voicerecorder/gsplugin/src/CVRGSPluginContainer.cpp Wed Oct 13 14:34:59 2010 +0300 @@ -45,13 +45,6 @@ const TUid KVRAppUID = { KVoiceRecorderAppUID3 }; -// ListBox item index -enum TListItemIndex - { - EListItemQualityIndex = 0, - ElistItemMemoStoreIndex, - }; - // ========================= MEMBER FUNCTIONS ================================ // --------------------------------------------------------------------------- @@ -165,6 +158,7 @@ { CAknSettingItem* settingItem; HBufC* itemTitle; + TInt id( 0 ); // Add quality setting if ( VRUtils::FeatureEnabled( EVRFeatureShowQualitySetting ) ) @@ -180,7 +174,7 @@ CleanupStack::PushL( settingItem ); itemTitle = iCoeEnv->AllocReadResourceLC( R_QTN_VOREC_SET_QUALITY ); - settingItem->ConstructL( EFalse, EListItemQualityIndex, *itemTitle, NULL, + settingItem->ConstructL( EFalse, id, *itemTitle, NULL, R_VR_SETTINGS_DEFAULT_SPEAKER_PAGE, EAknCtPopupField, NULL, R_VR_SETTINGS_QUALITY_TEXTS ); @@ -190,8 +184,9 @@ // Add quality item to the settings array iSettingItemArray->AppendL( settingItem ); CleanupStack::Pop(); // settingItem + id++; } - if ( VRUtils::MultipleMassStorageAvailable() ) + if ( VRUtils::MultipleMassStorageAvailable() ) { // Add memo store setting // Create the memo store item @@ -216,7 +211,7 @@ settingItem->ConstructL( EFalse, id, *itemTitle, NULL, R_VOREC_MEMORY_SELECTION_DIALOG, EAknCtPopupSettingList ); #else - settingItem->ConstructL( EFalse, ElistItemMemoStoreIndex, *itemTitle, NULL, 0, EAknCtPopupSettingList ); + settingItem->ConstructL( EFalse, id, *itemTitle, NULL, 0, EAknCtPopupSettingList ); #endif CleanupStack::PopAndDestroy(); // itemTitle @@ -224,6 +219,7 @@ // Add memo store item to the settings array iSettingItemArray->AppendL( settingItem ); CleanupStack::Pop(); // settingItem + id++; } } @@ -272,17 +268,9 @@ void CVRGSPluginContainer::HandleListBoxSelectionL( TInt aCommand ) { TInt index( iListBox->CurrentItemIndex() ); - TInt driveDefaultMassStorage = VRUtils::DefaultMemoDriveL(); - TInt driveRemovableMassStorage = VRUtils::GetRemovableMassStorageL(); - + if ( index >=0 ) // index is -1 if there are no items in the list { - if(index == ElistItemMemoStoreIndex && - !VRUtils::DriveValid(driveDefaultMassStorage) && - !VRUtils::DriveValid(driveRemovableMassStorage) ) - { - return; - } // Open edit dialog if EAknCmdOpen, invert the value otherwise iSettingItemArray->At( index )->EditItemL( aCommand == EAknCmdOpen ); iListBox->DrawItem( index ); @@ -351,10 +339,7 @@ iDrive = (TDriveNumber)defaultDrive; } } - if(iDrive == defaultDrive || iDrive == VRUtils::GetRemovableMassStorageL()) - { VRUtils::SetMemoDriveL( iDrive ); - } #endif // Save quality setting