/** Function : ExecuteActionL Description : Entry point for the this test action in the test framework @internalTechnology @param : none @return : void @pre none @post none */ void CMtfTestActionLoadPopSettings::ExecuteActionL() { TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionLoadPopSettings); TPopAccount accountId = ObtainValueParameterL<TPopAccount>( TestCase(),ActionParameters().Parameter(0) ); TInt shouldFail = ObtainValueParameterL<TInt>( TestCase(),ActionParameters().Parameter(1) ); CEmailAccounts* accounts = CEmailAccounts::NewLC(); CImIAPPreferences* smtpIapPref = CImIAPPreferences::NewLC(); CImSmtpSettings* smtpSet = new(ELeave) CImSmtpSettings(); CleanupStack::PushL(smtpSet); CImIAPPreferences* popIapPref = CImIAPPreferences::NewLC(); CImPop3Settings* popSet = new(ELeave) CImPop3Settings(); CleanupStack::PushL(popSet); // this will leave if an attempt is made to access non existent settings TRAPD( error, LoadSettingsL(*accounts, accountId, *popSet, *popIapPref, *smtpSet, *smtpIapPref) ); if( error != KErrNone ) { if( shouldFail == 1 && error == KErrNotFound ) { TestCase().INFO_PRINTF1(_L("LoadPOPSettingsL Failed as expected ") ); } else { TestCase().ERR_PRINTF2(_L("LoadPOPSettingsL Failed leave with code %d"), error ); TestCase().SetTestStepResult(EFail); } CleanupStack::PopAndDestroy( 5, accounts ); } else { // params loaded ok so we can store them StoreParameterL<CImPop3Settings>(TestCase(), *popSet , ActionParameters().Parameter(2) ); CleanupStack::Pop(popSet); StoreParameterL<CImIAPPreferences>(TestCase(), *popIapPref , ActionParameters().Parameter(3) ); CleanupStack::Pop(popIapPref); StoreParameterL<CImSmtpSettings>(TestCase(), *smtpSet , ActionParameters().Parameter(4) ); CleanupStack::Pop(smtpSet); StoreParameterL<CImIAPPreferences>(TestCase(), *smtpIapPref , ActionParameters().Parameter(5) ); CleanupStack::Pop(smtpIapPref); CleanupStack::PopAndDestroy(accounts); if( shouldFail == 1 ) { // have managed to load settings ok when we should not have TestCase().ERR_PRINTF1(_L("CMtfTestActionLoadPopSettings loaded settings ok when we should not have") ); TestCase().SetTestStepResult(EFail); } } TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionLoadPopSettings); TestCase().ActionCompletedL(*this); }
/** Function : ExecuteActionL Description : Entry point for the this test action in the test framework @internalTechnology @param : none @return : void @pre none @post none */ void CMtfTestActionGetPopAccountSettings::ExecuteActionL() { TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionGetPopAccountSettings); TPopAccount accountId = ObtainValueParameterL<TPopAccount>( TestCase(),ActionParameters().Parameter(0) ); CEmailAccounts* accounts = CEmailAccounts::NewLC(); CImIAPPreferences* smtpIapPref =CImIAPPreferences::NewLC(); CImSmtpSettings* smtpSet = new (ELeave) CImSmtpSettings; CleanupStack::PushL(smtpSet); CImIAPPreferences* popIapPref = CImIAPPreferences::NewLC(); CImPop3Settings* popSet = new (ELeave) CImPop3Settings; CleanupStack::PushL(popSet); TRAPD( error, LoadSettingsL(*accounts, accountId, *popSet, *popIapPref, *smtpSet, *smtpIapPref) ); if( error != KErrNone ) { TestCase().INFO_PRINTF2(_L("CMtfTestActionGetPopAccountSettings LoadPOPSettingsL Failed leave with code %d"), error ); TestCase().SetTestStepResult(EFail); } StoreParameterL<CImPop3Settings>(TestCase(), *popSet , ActionParameters().Parameter(1) ); CleanupStack::Pop(popSet); StoreParameterL<CImIAPPreferences>(TestCase(), *popIapPref , ActionParameters().Parameter(2) ); CleanupStack::Pop(popIapPref); StoreParameterL<CImSmtpSettings>(TestCase(), *smtpSet , ActionParameters().Parameter(3) ); CleanupStack::Pop(smtpSet); StoreParameterL<CImIAPPreferences>(TestCase(), *smtpIapPref , ActionParameters().Parameter(4) ); CleanupStack::Pop(smtpIapPref); CleanupStack::PopAndDestroy(accounts); TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionGetPopAccountSettings); TestCase().ActionCompletedL(*this); }
// ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- void CIpsSosAOImapAgent::StartSyncL() { FUNC_LOG; if ( iOngoingOp ) { User::Leave( KErrNotReady ); } LoadSettingsL( ); if ( !IsConnected() ) { NM_COMMENT("CIpsSosAOImapAgent: starting sync"); TPckg<MMsvImapConnectionObserver*> parameter(this); // connect and synchronise starts background sync or idle CMsvEntrySelection* sel = new ( ELeave ) CMsvEntrySelection(); CleanupStack::PushL( sel ); sel->AppendL( iServiceId ); iImapClientMtm->SwitchCurrentEntryL( iServiceId ); iOngoingOp = iImapClientMtm->InvokeAsyncFunctionL( KIMAP4MTMConnectAndSyncCompleteAfterFullSync, *sel, parameter, iStatus); CleanupStack::PopAndDestroy( sel ); SetActive(); iState = EStateConnectAndSync; } else { NM_COMMENT("CIpsSosAOImapAgent: already connected do not sync"); // do not do anything if we are connected, especially do never // try to sync if sync is is already started (ex. from ips plugin) // that cause problems with imap flags etc. iError = KErrCancel; iState = EStateCompleted; SetActiveAndCompleteThis(); } }
void CSetupGisWeatherSettingItemList::InputUrl() { HBufC* mess = StringLoader::LoadLC(R_STR_TITLE_URL); CAknTextQueryDialog* Dialog =CAknTextQueryDialog::NewL(iSettings.Edit3(),CAknQueryDialog::ENoTone); Dialog->PrepareLC(R_ASK_NAME_DIALOG); Dialog->SetPromptL(*mess); Dialog->RunLD(); LoadSettingsL(); }
void CSTPreferences::ConstructL() { #ifdef LOG_TO_FILE iLog = LOGMGR->GetLoggerL(TUid::Uid(SYMTORRENT_ENGINE_UID)); #endif iSTorrents = new (ELeave) CDesCArrayFlat(5); ResetSettingsL(); LoadSettingsL(); }
/** * Edit the setting item identified by the given id and store * the changes into the store. * @param aIndex the index of the setting item in SettingItemArray() * @param aCalledFromMenu true: a menu item invoked editing, thus * always show the edit page and interactively edit the item; * false: change the item in place if possible, else show the edit page */ void CSetupGisWeatherSettingItemList::EditItemL ( TInt aIndex, TBool aCalledFromMenu ) { CAknSettingItem* item = ( *SettingItemArray() )[aIndex]; switch ( item->Identifier() ) { } switch(aIndex) { case 5: iSettings.SelectApp(); LoadSettingsL(); break; case 6: iSettings.SelectAP(); LoadSettingsL(); break; case 7: InputUrl(); LoadSettingsL(); break; default: CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu ); break; } //TResourceReader read; //asfawefiCoeEnv->CreateResourceReaderLC(read,R_SETTING_LIST_SETTING_TIME); TBool storeValue = ETrue; switch ( item->Identifier() ) { } if ( storeValue ) { item->StoreL(); SaveSettingValuesL(); } }
void CBuddycloudEditPlaceList::LoadL() { GetEditedPlace(); LoadSettingsL(); }
/* ----------------------------------------------------------------------------- ---------------------------------------------------------------------------- */ void CAknSettingsListListbox::SelectCommandSCL(TInt aSC) { CAknSinglePopupMenuStyleListBox * list = new(ELeave) CAknSinglePopupMenuStyleListBox; CleanupStack::PushL(list); CAknPopupList* popupList = CAknPopupList::NewL(list, R_AVKON_SOFTKEYS_SELECT_BACK); CleanupStack::PushL(popupList); list->ConstructL(popupList, CEikListBox::ELeftDownInViewRect); list->CreateScrollBarFrameL(ETrue); list->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto); CDesCArrayFlat* SelectArrray = new(ELeave)CDesCArrayFlat(20); CleanupStack::PushL(SelectArrray); TBuf<60> Hjelpper; StringLoader::Load(Hjelpper,R_MNU_COPY); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_CUT); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_PASTE); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_DELETE); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_RENAME); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_PROPERTIES); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_ATTRIBUTES); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_SHOWNAME); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_SEND); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_NEWFILE); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_NEWFOLDER); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_SETTINGS); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_SHOWSC); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_SETSC); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_SETSEARCHON); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_REFRESH); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_MARKALL); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_UNMARKALL); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_OPEN); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_OPENWITH); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_PASTESHOW); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_CLEARPASTE); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_SEARCHFLES); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_PAGEUP); SelectArrray->AppendL(Hjelpper); StringLoader::Load(Hjelpper,R_MNU_PAGEDOWN); SelectArrray->AppendL(Hjelpper); CleanupStack::Pop();//SelectArrray list->Model()->SetItemTextArray(SelectArrray); list->Model()->SetOwnershipType(ELbmOwnsItemArray); StringLoader::Load(Hjelpper,R_MNU_SELCOMMAND); popupList->SetTitleL(Hjelpper); if (popupList->ExecuteLD()) { TInt Selected = list->CurrentItemIndex(); TInt SelCommand(-1); TBuf<30> SelComBuf; switch(Selected) { case 0: SelCommand = EEditCopy; StringLoader::Load(SelComBuf,R_MNU_COPY); break; case 1: SelCommand = EEditCut; StringLoader::Load(SelComBuf,R_MNU_CUT); break; case 2: SelCommand = EEditPaste; StringLoader::Load(SelComBuf,R_MNU_PASTE); break; case 3: SelCommand = EFileDelete; StringLoader::Load(SelComBuf,R_MNU_DELETE); break; case 4: SelCommand = EFileRename; StringLoader::Load(SelComBuf,R_MNU_RENAME); break; case 5: SelCommand = EFileDetails; StringLoader::Load(SelComBuf,R_MNU_PROPERTIES); break; case 6: SelCommand = EFileAttributes; StringLoader::Load(SelComBuf,R_MNU_ATTRIBUTES); break; case 7: SelCommand = EFileShowName; StringLoader::Load(SelComBuf,R_MNU_SHOWNAME); break; case 8: SelCommand = ESendFiles; StringLoader::Load(SelComBuf,R_MNU_SEND); break; case 9: SelCommand = EFileNewFile; StringLoader::Load(SelComBuf,R_MNU_NEWFILE); break; case 10: SelCommand = EFileNewFolder; StringLoader::Load(SelComBuf,R_MNU_NEWFOLDER); break; case 11: SelCommand = ESettings; StringLoader::Load(SelComBuf,R_MNU_SETTINGS); break; case 12: SelCommand = EExtrasShowShortCut; StringLoader::Load(SelComBuf,R_MNU_SHOWSC); break; case 13: SelCommand = EExtrasSetShortCut; StringLoader::Load(SelComBuf,R_MNU_SETSC); break; case 14: SelCommand = EExtrasSearchOn; StringLoader::Load(SelComBuf,R_MNU_SETSEARCHON); break; case 15: SelCommand = EExtrasRefresh; StringLoader::Load(SelComBuf,R_MNU_REFRESH); break; case 16: SelCommand = EFolderViewMarkAll; StringLoader::Load(SelComBuf,R_MNU_MARKALL); break; case 17: SelCommand = EFolderViewUnMarkAll; StringLoader::Load(SelComBuf,R_MNU_UNMARKALL); break; case 18: SelCommand = EVBOpenFile; StringLoader::Load(SelComBuf,R_MNU_OPEN); break; case 19: SelCommand = EOpenWithViewer; StringLoader::Load(SelComBuf,R_MNU_OPENWITH); break; case 20: SelCommand = EEditShowPaste; StringLoader::Load(SelComBuf,R_MNU_PASTESHOW); break; case 21: SelCommand = EEditClearPaste; StringLoader::Load(SelComBuf,R_MNU_CLEARPASTE); break; case 22: SelCommand = ESearchFiles; StringLoader::Load(SelComBuf,R_MNU_SEARCHFLES); break; case 23: SelCommand = EMovePageUp; StringLoader::Load(SelComBuf,R_MNU_PAGEUP); break; case 24: SelCommand = EMovePageDown; StringLoader::Load(SelComBuf,R_MNU_PAGEDOWN); break; default: break; } if(SelCommand > 0) { switch(aSC) { case 0: iCommand0 = SelCommand; iCommandTxt0.Copy(SelComBuf); break; case 1: iCommand1 = SelCommand; iCommandTxt1.Copy(SelComBuf); break; case 2: iCommand2 = SelCommand; iCommandTxt2.Copy(SelComBuf); break; case 3: iCommand3 = SelCommand; iCommandTxt3.Copy(SelComBuf); break; case 4: iCommand4 = SelCommand; iCommandTxt4.Copy(SelComBuf); break; case 5: iCommand5 = SelCommand; iCommandTxt5.Copy(SelComBuf); break; case 6: iCommand6 = SelCommand; iCommandTxt6.Copy(SelComBuf); break; case 7: iCommand7 = SelCommand; iCommandTxt7.Copy(SelComBuf); break; case 8: iCommand8 = SelCommand; iCommandTxt8.Copy(SelComBuf); break; case 9: iCommand9 = SelCommand; iCommandTxt9.Copy(SelComBuf); break; default: break; } } LoadSettingsL(); ListBox()->DrawNow(); } CleanupStack::Pop(); // popuplist CleanupStack::PopAndDestroy(1); // list }
void CEggClockAppView::ConstructL( const TRect& aRect ) { #ifdef __S60_50__ m_bLongTap = EFalse; #endif // Create the timers m_pTimer = CPeriodic::NewL(CActive::EPriorityIdle); m_pFlashTimer = CPeriodic::NewL(CActive::EPriorityIdle); // Load icons with numbers _LIT(KEggClockIconsFilename, "\\resource\\apps\\EggClock_numbers_icons.mbm"); m_pDigitIcons = new (ELeave) CAknIconArray(10); for (TInt i(0); i < 10; ++i) { CFbsBitmap* pBitmap(iEikonEnv->CreateBitmapL(KEggClockIconsFilename, EMbmEggclock_numbers_icons0 + i)); CleanupStack::PushL(pBitmap); m_pDigitIcons->AppendL(CGulIcon::NewL(pBitmap, pBitmap)); CleanupStack::Pop(); // pBitmap } // Load icon for colon CFbsBitmap* pColonBitmap(iEikonEnv->CreateBitmapL(KEggClockIconsFilename, EMbmEggclock_numbers_iconsColon)); CleanupStack::PushL(pColonBitmap); m_pColonIcon = CGulIcon::NewL(pColonBitmap, pColonBitmap); CleanupStack::Pop(); // pColonBitmap // Load icons for volume CFbsBitmap* pVolumeBitmap(iEikonEnv->CreateBitmapL(KEggClockIconsFilename, EMbmEggclock_numbers_iconsVolume)); CleanupStack::PushL(pVolumeBitmap); CFbsBitmap* pVolumeBitmapMask(iEikonEnv->CreateBitmapL(KEggClockIconsFilename, EMbmEggclock_numbers_iconsVolume_mask)); CleanupStack::PushL(pVolumeBitmapMask); m_pVolumeIcon = CGulIcon::NewL(pVolumeBitmap, pVolumeBitmapMask); CleanupStack::Pop(); // pVolumeBitmapMask CleanupStack::Pop(); // pVolumeBitmap CFbsBitmap* pVolumeMuteBitmap(iEikonEnv->CreateBitmapL(KEggClockIconsFilename, EMbmEggclock_numbers_iconsVolume_mute)); CleanupStack::PushL(pVolumeMuteBitmap); CFbsBitmap* pVolumeMuteBitmapMask(iEikonEnv->CreateBitmapL(KEggClockIconsFilename, EMbmEggclock_numbers_iconsVolume_mute_mask)); CleanupStack::PushL(pVolumeMuteBitmapMask); m_pVolumeMuteIcon = CGulIcon::NewL(pVolumeMuteBitmap, pVolumeMuteBitmapMask); CleanupStack::Pop(); // pVolumeMuteBitmapMask CleanupStack::Pop(); // m_pVolumeMuteIcon m_pVolumeValueIcons = new (ELeave) CAknIconArray(MAX_VOLUME + 1); for (TInt i(0); i <= MAX_VOLUME; ++i) { CFbsBitmap* pBitmap(iEikonEnv->CreateBitmapL(KEggClockIconsFilename, EMbmEggclock_numbers_iconsVolume_0 + i)); CleanupStack::PushL(pBitmap); m_pVolumeValueIcons->AppendL(CGulIcon::NewL(pBitmap, pBitmap)); CleanupStack::Pop(); // pBitmap } // Load icons for repeat CFbsBitmap* pRepeatOnceBitmap(iEikonEnv->CreateBitmapL(KEggClockIconsFilename, EMbmEggclock_numbers_iconsRepeat_once)); CleanupStack::PushL(pRepeatOnceBitmap); m_pRepeatOnceIcon = CGulIcon::NewL(pRepeatOnceBitmap, pRepeatOnceBitmap); CleanupStack::Pop(); // pRepeatOnceBitmap CFbsBitmap* pRepeatLoopBitmap(iEikonEnv->CreateBitmapL(KEggClockIconsFilename, EMbmEggclock_numbers_iconsRepeat_loop)); CleanupStack::PushL(pRepeatLoopBitmap); m_pRepeatLoopIcon = CGulIcon::NewL(pRepeatLoopBitmap, pRepeatLoopBitmap); CleanupStack::Pop(); // pRepeatLoopBitmap CFbsBitmap* pRepeatEveryXBitmap(iEikonEnv->CreateBitmapL(KEggClockIconsFilename, EMbmEggclock_numbers_iconsRepeat_every_x)); CleanupStack::PushL(pRepeatEveryXBitmap); m_pRepeatEveryXIcon = CGulIcon::NewL(pRepeatEveryXBitmap, pRepeatEveryXBitmap); CleanupStack::Pop(); // pRepeatEveryXBitmap // Load settings LoadSettingsL(); // Initialize player if required if (m_iNotificationFile.Length() > 0) { #ifndef DRM_PLAYER m_pFilePlayer = CMdaAudioPlayerUtility::NewFilePlayerL(m_iNotificationFile, *this, EMdaPriorityNormal, EMdaPriorityPreferenceTime); #else m_pFilePlayer = CDrmPlayerUtility::NewFilePlayerL(m_iNotificationFile, *this, EMdaPriorityNormal, EMdaPriorityPreferenceTime); #endif if (m_pFilePlayer) { m_iAudioState = eAudioIniting; } } // Object to detect volume keys m_pSelector = CRemConInterfaceSelector::NewL(); m_pTarget = CRemConCoreApiTarget::NewL( *m_pSelector, *this ); m_pSelector->OpenTargetL(); // Create a window for this application view and set the size CreateWindowL(); SetRect(aRect); // Skin support m_pSkinBackground = CAknsBasicBackgroundControlContext::NewL(KAknsIIDQsnBgAreaMain, Rect(), EFalse); #ifdef __S60_50__ // In case of touch screen, activate long touch detector if (AknLayoutUtils::PenEnabled()) { m_pLongTapDetector = CAknLongTapDetector::NewL(this); } // Touch feedback m_pTouchFeedback = MTouchFeedback::Instance(); if (m_pTouchFeedback) { m_pTouchFeedback->SetFeedbackEnabledForThisApp(ETrue); } #endif // Activate the control ActivateL(); }