TBool ShowConfirmationQueryL( const TDesC& aText ) { CAknQueryDialog* dlg = CAknQueryDialog::NewL(); dlg->SetPromptL( aText ); TInt retCode( dlg->ExecuteLD( R_CONFIRMATION_QUERY ) ); return retCode; }
// ---------------------------------------------------------------------------- // CAknExQueryContainer::ShowConfirmationQueryL() // Display of Confirmation Query. // ---------------------------------------------------------------------------- // void CAknExQueryContainer::ShowConfirmationQueryL( const TInt aResourceId, const TInt aTextResourceId, const TBool aPromptFlag, const TBool aToneFlag, const TBool aHeaderTextAndImageFlag, const CAknQueryDialog::TTone aTone ) { iDisplayDialog = ETrue; SetTextToLabelL( R_AKNEXQUERY_OPERATE_MESSAGE ); CAknQueryDialog* dlg; if ( aHeaderTextAndImageFlag ) { dlg = CAknQueryDialog::NewL( aTone ); dlg->PrepareLC( aResourceId ); TBuf<KAknExQueryTextBufLength> prompt; iCoeEnv->ReadResource( prompt, R_AKNEXQUERY_NUMQUERY_WITHHEAD_HEAD ); dlg->QueryHeading()->SetTextL( prompt ); SetIconL( dlg, EMbmAknexqueryAnchor_id, EMbmAknexqueryAnchor_id_mask ); dlg->RunLD(); } else { if ( !aTextResourceId ) { dlg = CAknQueryDialog::NewL( aTone ); } else { TBuf<KAknExQueryTextBufLength> prompt; iCoeEnv->ReadResource( prompt, aTextResourceId ); if ( aPromptFlag ) { dlg = CAknQueryDialog::NewL( aTone ); CleanupStack::PushL( dlg ); dlg->SetPromptL( prompt ); CleanupStack::Pop(); } else if ( aToneFlag ) { dlg = new ( ELeave ) CAknQueryDialog( prompt, aTone ); } else { dlg = new ( ELeave ) CAknQueryDialog( prompt ); } } ShowResultMessageL( dlg->ExecuteLD( aResourceId ) ); } iDisplayDialog = EFalse; }
TBool ShowConfirmationQueryL( const TInt& aTextResourceId ) { HBufC* prompt = StringLoader::LoadLC( aTextResourceId ); CAknQueryDialog* dlg = CAknQueryDialog::NewL(); dlg->SetPromptL( *prompt ); TInt retCode( dlg->ExecuteLD( R_CONFIRMATION_QUERY ) ); CleanupStack::PopAndDestroy(); //prompt return retCode; }
/* ----------------------------------------------------------------------------- RFile GetAttachmentFileL(TMsvAttachmentId aId) ---------------------------------------------------------------------------- */ void CMailBoxContainer::CopyFileL(const TDesC& aFolderName) { TFileName fileName,FullFilName; if(iSession && iSelectionBox && iListArray) { TInt CurrItmIndex = iSelCopyItemIndex; iSelCopyItemIndex = -1; if(CurrItmIndex < 0 || CurrItmIndex >= iIDArray->Count()) { CurrItmIndex = iSelectionBox->CurrentItemIndex(); } TMsvSelectionOrdering sort; sort.SetShowInvisibleEntries(ETrue); sort.SetSorting(EMsvSortByDate); // Take a handle to the folder entry CMsvEntry* parentEntry = CMsvEntry::NewL(*iSession,iCurrentMailBox,sort); CleanupStack::PushL(parentEntry); // A selection of all BT entries CMsvEntrySelection* entries = parentEntry->ChildrenL();//ChildrenWithMtmL(KUidMsgTypeBt); CleanupStack::PushL(entries); //Process all entries if(CurrItmIndex >= 0 && CurrItmIndex < iIDArray->Count()) { //Get entry CMsvEntry* btEntry = iSession->GetEntryL(iIDArray->At(CurrItmIndex).iEnt); CleanupStack::PushL(btEntry); //Then get entrys child CMsvEntrySelection* btChildren = btEntry->ChildrenL(); CleanupStack::PushL(btChildren); btEntry->SetEntryL(iIDArray->At(CurrItmIndex).iMsg); if (btEntry->HasStoreL()) { CMsvStore* store = btEntry->ReadStoreL(); CleanupStack::PushL(store); MMsvAttachmentManager& attMngr = store->AttachmentManagerL(); CMsvAttachment* attachment = attMngr.GetAttachmentInfoL(iIDArray->At(CurrItmIndex).iAtt); if(attachment) { fileName.Copy(attachment->AttachmentName()); delete attachment; attachment = NULL; TBool OkToSave(EFalse),SkipMe(EFalse); do { FullFilName.Zero(); StringLoader::Load(FullFilName,R_SH_STR_FILENAME); CAknTextQueryDialog* Dialog = CAknTextQueryDialog::NewL(fileName,CAknQueryDialog::ENoTone); Dialog->PrepareLC(R_ASK_NAME_DIALOG); Dialog->SetPromptL(FullFilName); if(Dialog->RunLD()) { FullFilName.Copy(aFolderName); FullFilName.Append(fileName); if(BaflUtils::FileExists(CEikonEnv::Static()->FsSession(),FullFilName)) { HBufC* TmpText = StringLoader::LoadLC(R_SH_STR_FILOVERRT); CAknQueryDialog* dlg = CAknQueryDialog::NewL(); if(dlg->ExecuteLD(R_QUERY,*TmpText)) { TInt Err = CEikonEnv::Static()->FsSession().Delete(FullFilName); if(Err == KErrNone) { OkToSave = ETrue; } else { iUtils.GetFileUtils().ShowFileErrorNoteL(FullFilName,Err); } } CleanupStack::PopAndDestroy(TmpText); } else { OkToSave = ETrue; } } else { SkipMe = ETrue; } }while(!SkipMe && !OkToSave); if(OkToSave) { delete iRFileCopier; iRFileCopier = NULL; iRFileCopier = CRFileCopier::NewL(*this,CEikonEnv::Static()->FsSession(),ETrue); RFile SourceFil(attMngr.GetAttachmentFileL(iIDArray->At(CurrItmIndex).iAtt)); iRFileCopier->StartCopyL(SourceFil,FullFilName); SourceFil.Close(); } } CleanupStack::PopAndDestroy(store); } CleanupStack::PopAndDestroy(2); } CleanupStack::PopAndDestroy(2); } }
void CCrashContainer::HandleCommandL(TInt aCommand) { switch (aCommand) { case EAppHelpBack: { delete iMyHelpContainer; iMyHelpContainer = NULL; } SetMenuL(); DrawNow(); break; case EAppHelp: { delete iMyHelpContainer; iMyHelpContainer = NULL; iMyHelpContainer = CMyHelpContainer::NewL(); } SetMenuL(); DrawNow(); break; case EItemInfo: if(iSelectionBox) { TInt CurrInd = iSelectionBox->CurrentItemIndex(); if(CurrInd >= 0 && CurrInd <= iArray.Count()) { if(iArray[CurrInd]) { HBufC* Informmm = HBufC::NewLC(3000); TPtr Pointter(Informmm->Des()); GetInfoBufferL(*iArray[CurrInd],Pointter); TPtr NewPointter(Informmm->Des()); CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(NewPointter); dlg->PrepareLC(R_ABOUT_HEADING_PANE); dlg->SetHeaderTextL(KCrashApplicationName); dlg->RunLD(); CleanupStack::PopAndDestroy(Informmm); } } } break; case ESetMeOn: { iServerIsOn = ETrue; RExampleServerClient CrashClient; CrashClient.Connect(); CrashClient.Close(); ChangeIconAndNameL(); } break; case ESetMeOff: { iServerIsOn = EFalse; RExampleServerClient CrashClient; CrashClient.Connect(); CrashClient.ShutServerDownNow(); CrashClient.Close(); ChangeIconAndNameL(); } break; case EClearMe: { CAknQueryDialog* dlg = CAknQueryDialog::NewL(); if(dlg->ExecuteLD(R_QUERY,_L("Clear list"))) { RExampleServerClient CrashClient; CrashClient.Connect(); CrashClient.ClearItemList(); if(!iServerIsOn) { CrashClient.ShutServerDownNow(); } CrashClient.Close(); DisplayListBoxL(); DisplayListBoxL(); } } DrawNow(); break; case EHideKill0: { iHideKill0 = ETrue; DisplayListBoxL(); DisplayListBoxL(); } DrawNow(); break; case EShowKill0: { iHideKill0 = EFalse; DisplayListBoxL(); DisplayListBoxL(); } DrawNow(); break; case EResetMe: { DisplayListBoxL(); } break; case EAbout: { HBufC* Abbout = KCrashAbbout().AllocLC(); TPtr Pointter(Abbout->Des()); CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(Pointter); dlg->PrepareLC(R_ABOUT_HEADING_PANE); dlg->SetHeaderTextL(KCrashApplicationName); dlg->RunLD(); CleanupStack::PopAndDestroy(Abbout); } break; case EBacktoYTasks: if(iTasksHandlerExit) { if(!iServerIsOn) { CAknQueryDialog* dlg = CAknQueryDialog::NewL(); if(dlg->ExecuteLD(R_QUERY,_L("Set Crash monitor on"))) { RExampleServerClient CrashClient; CrashClient.Connect(); CrashClient.Close(); } } iTasksHandlerExit->HandlerExitL(this); } break; default: break; }; }
/* ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- */ void CMgAppUi::TimerExpired() { if(iOkToContinue) { if(KAppIsTrial){ TBuf<255> trialBuff; TBool isFirstTime(EFalse); TInt hoursLeft(0); if(CTrialHandler::IsNowOkL(isFirstTime,hoursLeft)){ CTrialHandler::SetDateNowL(); trialBuff.Copy(_L("You have ")); trialBuff.AppendNum(hoursLeft); trialBuff.Append(_L("hours left on your Trial.")); ShowNoteL(trialBuff); }else{ trialBuff.Copy(KtxTrialSMSMessage1); trialBuff.Append(KtxtApplicationName); trialBuff.Append(KtxTrialSMSMessage2); trialBuff.Append(KtxTrialOviLink); CAknQueryDialog* dlg = CAknQueryDialog::NewL(); if(dlg->ExecuteLD(R_QUERY,trialBuff)) { OpenOviSiteL(KtxTrialOviLink); } } } if(iMySplashScreen) { RemoveFromStack(iMySplashScreen); } if(iMainContainer) { RemoveFromStack(iMainContainer); } delete iMainContainer; iMainContainer = NULL; if(StatusPane()->CurrentLayoutResId() != R_AVKON_STATUS_PANE_LAYOUT_USUAL) { StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL); } StatusPane()->DrawNow(); iMainContainer = new(ELeave)CMainContainer(Cba()); iMainContainer->SetMopParent(this); AddToStackL(iMainContainer); iMainContainer->ConstructL(); delete iMySplashScreen; iMySplashScreen = NULL; } else { HandleCommandL(EQuickExit); } }
// ---------------------------------------------------- // CSymellaAppUi::HandleCommandL(TInt aCommand) // ?implementation_description // ---------------------------------------------------- // void CSymellaAppUi::HandleCommandL(TInt aCommand) { switch ( aCommand ) { case ESymellaCmdConnect: { CTR->ConnectL(); } break; case ESymellaCmdSelectGenre: { TInt index = 0; CAknListQueryDialog* queryDialog = new(ELeave) CAknListQueryDialog(&index); if(queryDialog->ExecuteLD(R_SYMELLA_GENRE_SELECTION_LIST)) { CTR->SetGenre(index); } } break; case ESymellaCmdResetHostCache: { // ask to quit CAknQueryDialog* query = CAknQueryDialog::NewL(); CleanupStack::PushL(query); _LIT(KPrompt, "Are you sure you want to reset the hostcache?"); query->SetPromptL(KPrompt); CleanupStack::Pop(); // query if (query->ExecuteLD(R_GENERAL_QUERY)) { CTR->HostCache().Reset(); } } break; case ESymellaCmdDisconnect: { CTR->DisconnectL(); } break; case ESymellaCmdConnectInfo: { HBufC* info = CTR->CreateConnectInfoL(); CleanupStack::PushL(info); /*CAknNoteDialog* note = new (ELeave) CAknNoteDialog; CleanupStack::PushL(note); note->SetTextL(*info); CleanupStack::Pop(); note->PrepareLC(R_CONNECTION_INFO_NOTE); note->RunLD();*/ CAknMessageQueryDialog* dlg = new (ELeave)CAknMessageQueryDialog(); dlg->PrepareLC( R_MESSAGE_QUERY ); dlg->SetMessageTextL(info->Des()); dlg->QueryHeading()->SetTextL(_L("Connect info")); dlg->RunLD(); CleanupStack::PopAndDestroy(); //info } break; case ESymellaCmdAbout: { TBuf<30> time; TBuf<50> date; date.Copy(_L8(__DATE__)); time.Copy(_L8(__TIME__)); _LIT(KBuild, "Built on "); HBufC* info = HBufC::NewLC(TPtrC(KAbout).Length() + 64 /*+ TPtrC(KEngineVersion).Length() */+ TPtrC(KBuild).Length() + date.Length() + 4); TPtr des = info->Des(); des.Append(_L("Version ")); des.Append(SYMELLA_VERSION_LIT); des.Append(KAbout); //des.Append(KEngineVersion); des.Append(KBuild); des.Append(date); CAknMessageQueryDialog* dlg = new (ELeave)CAknMessageQueryDialog(); CleanupStack::PushL(dlg); dlg->PrepareLC( R_MESSAGE_QUERY ); dlg->SetMessageTextL(des); dlg->QueryHeading()->SetTextL(_L("Symella S60")); CleanupStack::Pop(); //dlg dlg->RunLD(); CleanupStack::PopAndDestroy(); //info } break; case ESymellaCmdAddNode: { // Create dialog to allow user to view/edit connection details TBuf<100> hostName; //hostName.Copy(_L("")); hostName.Copy(_L("192.168.0.100")); TInt port = 6346; CAknMultiLineDataQueryDialog* dialog = CAknMultiLineDataQueryDialog::NewL(hostName, port); // Display and execute dialog, and act according to return value if (dialog->ExecuteLD(R_ADD_NODE_DIALOG)) { TInetAddr addr; if (addr.Input(hostName) == KErrNone) { addr.SetPort(port); CTR->HostCache().AddUltrapeerL(addr); } } } break; case EAknCmdExit: case EEikCmdExit: { PREFERENCES->SaveWebCachesL(); LOG->WriteLineL(_L("Saving hostcache...")); CTR->HostCache().SaveHostCacheL(); LOG->WriteLineL(_L("Symella terminating")); Exit(); } break; case EAknSoftkeyBack: case EAknSoftkeyExit: { // ask to quit CAknQueryDialog* query = CAknQueryDialog::NewL(); CleanupStack::PushL(query); _LIT(KPrompt, "Quit Symella?"); query->SetPromptL(KPrompt); CleanupStack::Pop(); // query if (query->ExecuteLD(R_GENERAL_QUERY)) { // ((CSymellaSearchView*)View(TUid::Uid(1)))->CloseFindBoxL(); PREFERENCES->SaveWebCachesL(); LOG->WriteLineL(_L("Saving hostcache...")); CTR->HostCache().SaveHostCacheL(); LOG->WriteLineL(_L("Symella terminating")); Exit(); } } break; case ESymellaCmdSearch: { TBuf<256> query; query.Copy(CTR->SearchString()); CAknTextQueryDialog* dlg = new (ELeave) CAknTextQueryDialog(query, CAknQueryDialog::ENoTone); dlg->SetPredictiveTextInputPermitted(ETrue); if (! dlg->ExecuteLD(R_SEARCH_QUERY)) break; HBufC8* query8 = HBufC8::NewLC(query.Length()); TPtr8 query8Ptr(query8->Des()); query8Ptr.Copy(query); CTR->SearchL(*query8); CleanupStack::PopAndDestroy(); // query8 iTabGroup->SetActiveTabByIndex(1); ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(1))); LOG->WriteL(_L("Searching for: ")); LOG->WriteLineL(query); } break; case ESymellaCmdSettings: { ActivateLocalViewL(KSettingsViewId); } break; default: break; } }
// -------------------------------------------------------------------------- // UPnPAppSettingPageHomeIAP::CreateAndExecuteSettingPageL () // -------------------------------------------------------------------------- // void UPnPAppSettingItemHomeIAP::CreateAndExecuteSettingPageL() { __LOG8_1( "%s begin.", __PRETTY_FUNCTION__ ); // if sharing is on, only information note is displayed UPnPAVControllerFactory::TAVControllerServerStatus status; UPnPAVControllerFactory::Status( status ); if ( iSharingState || status == UPnPAVControllerFactory::EStatusActive ) { CAknInformationNote* note = new (ELeave) CAknInformationNote; CleanupStack::PushL(note); HBufC* noteText = iCoeEnv->AllocReadResourceLC( R_QTN_IUPNP_IAP_TURN_SHARING_OFF); note->ExecuteLD(*noteText); CleanupStack::PopAndDestroy(noteText); CleanupStack::Pop(note); return; } // Resets the member array for iap ids. // Creates new array for iap names. iIAPIdArray.Reset(); CDesCArray* array = new (ELeave) CDesCArrayFlat(5); CleanupStack::PushL(array); // adds static setting page items from resource // and stores the number of static items. AddStaticItemsL(array); TInt staticItemCount = array->Count(); // adds wlan access points, array GETS the ownership CUPnPSettingsEngine::GetWLANAccessPointsL( array, iIAPIdArray ); MAknQueryValue* qValue = QueryValue(); User::LeaveIfNull(qValue); LoadL(); StoreL(); TInt idx = GetIAPIndex( staticItemCount ); if ( idx >= array->MdcaCount() ) { idx = array->MdcaCount() - 1; } // setting page is launched CAknSettingPage* dlg = new (ELeave) CAknRadioButtonSettingPage( SettingPageResourceId(), idx, array); if (dlg->ExecuteLD()) { switch (idx) { case EUPnPSettingsEngineIAPItemNone: { DisplayInfoL(R_IBU_GALLERY_UPDATE_NOTE_TITLE_TEXT, R_IBU_GALLERY_UPDATE_NOTAVAIL_NOTE_TEXT, R_HOMECONNECT_INFO_QUERY); qValue->SetCurrentValueIndex(EUPnPSettingsEngineIAPItemNone); iIAPId = EUPnPSettingsEngineIAPIdNone; iIAPSetting = EUPnPSettingsEngineIAPItemNone; break; } case EUPnPSettingsEngineIAPItemAlwaysAsk: { qValue->SetCurrentValueIndex(EUPnPSettingsEngineIAPItemAlwaysAsk); iIAPId = EUPnPSettingsEngineIAPIdAlwaysAsk; iIAPSetting = EUPnPSettingsEngineIAPItemAlwaysAsk; DisplayInfoL(R_IBU_GALLERY_UPDATE_NOTE_TITLE_TEXT, R_IBU_GALLERY_UPDATE_NOTE_TEXT, R_HOMECONNECT_INFO_QUERY); break; } case EUPnPSettingsEngineIAPItemUserDefined: // Create new { // new iap wlan iap creation is started here TInt old_iap = iIAPId; CUPnPSettingsEngine::CreateAccessPointL(); //We have to re-get all the wlan iaps again since //user may modify the iap list RArray<TInt64> newArray; CleanupClosePushL( newArray ); //We only are interested in the iap ids CUPnPSettingsEngine::GetWLANAccessPointsL( NULL, newArray ); if( newArray.Count() <= 0 ) //if no iap exisits { //if previous iap is not "None" or "Always ask" if( old_iap > EUPnPSettingsEngineIAPIdAlwaysAsk ) { DisplayInfoL( R_IBU_GALLERY_UPDATE_NOTE_TITLE_TEXT, R_IBU_GALLERY_UPDATE_NOTAVAIL_NOTE_TEXT, R_HOMECONNECT_INFO_QUERY); iIAPId = EUPnPSettingsEngineIAPIdNone; qValue->SetCurrentValueIndex( EUPnPSettingsEngineIAPItemNone ); iIAPSetting = EUPnPSettingsEngineIAPItemNone; } iIAPIdArray.Reset(); CleanupStack::PopAndDestroy( &newArray ); } else { TBool newiap = ETrue; TInt lastItemIndex = newArray.Count() - 1; //if the last item on the new iap list //is found in the old iap array //then we think no new iap is created for( TInt i = 0; i < iIAPIdArray.Count(); i++ ) { if( newArray[lastItemIndex] == iIAPIdArray[i] ) { newiap = EFalse; i = iIAPIdArray.Count(); } } //get the new iap list iIAPIdArray.Reset(); for( TInt i = 0; i < newArray.Count(); i++ ) { iIAPIdArray.AppendL( newArray[i] ); } CleanupStack::PopAndDestroy( &newArray ); if( newiap ) { iIAPId = iIAPIdArray[lastItemIndex];//get new iap iIAPSetting = EUPnPSettingsEngineIAPItemUserDefined; // show confirmation note if connection is // unsecured, the database store the value of // the securitymode,such as EOpen,EWep,E802_1x, // EWpa,if select other securitymode except // EOpen, the return value of the // CheckAPSecurityL fuction is not EWLanUnsecured if ( CheckAPSecurityL(iIAPId) == EWLanUnsecured ) { CAknQueryDialog* dlg = CAknQueryDialog::NewL(); if (!(dlg->ExecuteLD( R_UNSECURED_CONNECTIONS_CONFIRMATION_QUERY))) { //user cancels the dialog UsePreviousIapL( old_iap ); } } else { // show 'Sharing Changed' note ( None -> sharing) if(old_iap == EUPnPSettingsEngineIAPIdNone && iIAPId != old_iap ) { DisplayInfoL( R_IBU_GALLERY_UPDATE_NOTE_TITLE_TEXT, R_IBU_GALLERY_UPDATE_NOTE_TEXT, R_HOMECONNECT_INFO_QUERY); } } } else { UsePreviousIapL(old_iap); } //if( newiap ) } //if( newArray.Count() <= 0 ) break; } default: // Predefined iap is selected { TInt index; TInt old_iap = iIAPId; TBool iapchange = EFalse; // iap id is set if ( idx - staticItemCount >= 0 ) { index = idx - staticItemCount; if (CheckAPSecurityL(iIAPIdArray[index]) == EWLanUnsecured) { // show confirmation note if connection is unsecured CAknQueryDialog* dlg = CAknQueryDialog::NewL(); if (dlg->ExecuteLD( R_UNSECURED_CONNECTIONS_CONFIRMATION_QUERY)) { //if "Continue" iapchange = ETrue; } } else { iapchange = ETrue; } if( iapchange ) { iIAPSetting = EUPnPSettingsEngineIAPItemUserDefined; iIAPId = iIAPIdArray[index]; qValue->SetCurrentValueIndex( EUPnPSettingsEngineIAPItemUserDefined); // if previous iap was 'None' and current iap // is not 'None' if ( old_iap == EUPnPSettingsEngineIAPIdNone && iIAPId != old_iap ) { DisplayInfoL( R_IBU_GALLERY_UPDATE_NOTE_TITLE_TEXT, R_IBU_GALLERY_UPDATE_NOTE_TEXT, R_HOMECONNECT_INFO_QUERY); } } } break; } } } LoadL(); StoreL(); CleanupStack::PopAndDestroy(array); __LOG8_1( "%s end.", __PRETTY_FUNCTION__ ); }
void CTraceContainer::HandleCommandL(TInt aCommand) { switch (aCommand) { case EAppHelpBack: { delete iMyHelpContainer; iMyHelpContainer = NULL; } SetMenuL(); DrawNow(); break; case EAppHelp: { delete iMyHelpContainer; iMyHelpContainer = NULL; iMyHelpContainer = CMyHelpContainer::NewL(); } SetMenuL(); DrawNow(); break; case EItemInfo: { /* RExampleServerClient CrashClient; CrashClient.Connect(); TExampleItem ItemBuffer; TFileName Bufferrr; TInt ItemCount(0); CrashClient.GetItemCount(ItemCount); for(TInt i=0; i < ItemCount; i++) { ItemBuffer.iIndex = i; CrashClient.GetItemL(ItemBuffer); AddItemListL(ItemBuffer); } if(!iServerIsOn) { CrashClient.ShutServerDownNow(); } CrashClient.Close();*/ } /* if(iSelectionBox) { TInt CurrInd = iSelectionBox->CurrentItemIndex(); if(CurrInd >= 0 && CurrInd <= iArray.Count()) { if(iArray[CurrInd]) { HBufC* Informmm = HBufC::NewLC(3000); TPtr Pointter(Informmm->Des()); GetInfoBufferL(*iArray[CurrInd],Pointter); TPtr NewPointter(Informmm->Des()); CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(NewPointter); dlg->PrepareLC(R_ABOUT_HEADING_PANE); dlg->SetHeaderTextL(KTraceApplicationName); dlg->RunLD(); CleanupStack::PopAndDestroy(Informmm); } } }*/ break; case ESettingsMe: { iProfileSettings = new(ELeave)CProfileSettings(); iProfileSettings->ConstructL(); } SetMenuL(); DrawNow(); break; case ESettingsOk: { if(iProfileSettings) { iProfileSettings->SaveValuesL(); // if(iServerIsOn) { RExampleServerClient CrashClient; CrashClient.Connect(); CrashClient.ReReadSettings(); CrashClient.Close(); } } delete iProfileSettings; iProfileSettings = NULL; } SetMenuL(); DrawNow(); break; case ESetMeOn: { iServerIsOn = ETrue; RExampleServerClient CrashClient; CrashClient.Connect(); CrashClient.StartTrace(); CrashClient.Close(); ChangeIconAndNameL(); if(iTimeOutTimer) { iTimeOutTimer->Cancel(); } else { iTimeOutTimer = CTimeOutTimer::NewL(EPriorityNormal,*this); } iTimeOutTimer->After(1000000); } break; case ESetMeOff: { iServerIsOn = EFalse; RExampleServerClient CrashClient; CrashClient.Connect(); CrashClient.ShutServerDownNow(); CrashClient.Close(); ChangeIconAndNameL(); if(iTimeOutTimer) { iTimeOutTimer->Cancel(); } } break; case EClearMe: { CAknQueryDialog* dlg = CAknQueryDialog::NewL(); if(dlg->ExecuteLD(R_QUERY,_L("Clear list"))) { RExampleServerClient CrashClient; CrashClient.Connect(); CrashClient.ClearItemList(); if(!iServerIsOn) { CrashClient.ShutServerDownNow(); } else { // re-start the trace CrashClient.StopTrace(); CrashClient.StartTrace(); } CrashClient.Close(); iArray.ResetAndDestroy(); // refresh info } } break; case EResetMe: { // refresh info } break; case EAbout: { HBufC* Abbout = KTraceAbbout().AllocLC(); TPtr Pointter(Abbout->Des()); CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(Pointter); dlg->PrepareLC(R_ABOUT_HEADING_PANE); dlg->SetHeaderTextL(KTraceApplicationName); dlg->RunLD(); CleanupStack::PopAndDestroy(Abbout); } break; case EBacktoYTasks: if(iTasksHandlerExit) { if(!iServerIsOn) { CAknQueryDialog* dlg = CAknQueryDialog::NewL(); if(dlg->ExecuteLD(R_QUERY,_L("Set Trace on"))) { RExampleServerClient CrashClient; CrashClient.Connect(); CrashClient.Close(); } } iTasksHandlerExit->HandlerExitL(this); } break; default: break; }; }
/* ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- */ void CMainContainer::HandleViewCommandL(TInt aCommand) { TBuf<60> Hjelpper; switch(aCommand) { case EAppHelpBack: { delete iMyHelpContainer; iMyHelpContainer = NULL; } SetMenuL(); DrawNow(); break; case EAppHelp: { delete iMyHelpContainer; iMyHelpContainer = NULL; iMyHelpContainer = CMyHelpContainer::NewL(0); } SetMenuL(); DrawNow(); break; case EProfTest: if(iProfileBox) { TInt Curr = iProfileBox->CurrentItemIndex(); if(Curr < 4) { if(Curr >= 0 && Curr < iKeyArray.Count()) { if(iKeyArray[Curr] && iKeyArray[Curr]->iNunmber) { TApaTaskList taskList( CEikonEnv::Static()->WsSession() ); TApaTask task = taskList.FindApp(KUidCallUIApp); if ( task.Exists() ) { TBuf<200> hjelpper; if(iKeyArray[Curr]->iNunmber) hjelpper.Copy(*iKeyArray[Curr]->iNunmber); task.SwitchOpenFile(hjelpper); } else { //Do start UI now. TThreadId app_threadid; CApaCommandLine* cmdLine; cmdLine=CApaCommandLine::NewLC(); cmdLine->SetExecutableNameL(KtxCallUIAppFileName); if(iKeyArray[Curr]->iNunmber) cmdLine->SetDocumentNameL(*iKeyArray[Curr]->iNunmber); cmdLine->SetCommandL( EApaCommandRun ); RApaLsSession ls; User::LeaveIfError(ls.Connect()); ls.StartApp(*cmdLine,app_threadid); ls.Close(); CleanupStack::PopAndDestroy(); // cmdLine } } } } else { Curr = (Curr - 4); if(Curr >= 0 && Curr < iItemArray.Count()) { if(iItemArray[Curr]) { TApaTaskList taskList( CEikonEnv::Static()->WsSession() ); TApaTask task = taskList.FindApp(KUidCallUIApp); if ( task.Exists() ) { TBuf<200> hjelpper; if(iItemArray[Curr]->iNunmber) hjelpper.Copy(*iItemArray[Curr]->iNunmber); task.SwitchOpenFile(hjelpper); } else { //Do start UI now. TThreadId app_threadid; CApaCommandLine* cmdLine; cmdLine=CApaCommandLine::NewLC(); cmdLine->SetExecutableNameL(KtxCallUIAppFileName); if(iItemArray[Curr]->iNunmber) cmdLine->SetDocumentNameL(*iItemArray[Curr]->iNunmber); cmdLine->SetCommandL( EApaCommandRun ); RApaLsSession ls; User::LeaveIfError(ls.Connect()); ls.StartApp(*cmdLine,app_threadid); ls.Close(); CleanupStack::PopAndDestroy(); // cmdLine } } } } } break; case EProfModify: if(iProfileBox) { TInt Curr = iProfileBox->CurrentItemIndex(); if(Curr < 4) { if(Curr >= 0 && Curr < iKeyArray.Count()) { if(iKeyArray[Curr]) { // get current and add data to settings.. delete iProfileSettings; iProfileSettings = NULL; iProfileSettings = new(ELeave)CProfileSettings(iCba,EFalse); iProfileSettings->SetMopParent(this); iProfileSettings->ConstructL(); iProfileSettings->SetDataL(iKeyArray[Curr]); } } } else { Curr = (Curr - 4); if(Curr >= 0 && Curr < iItemArray.Count()) { if(iItemArray[Curr]) { // get current and add data to settings.. delete iProfileSettings; iProfileSettings = NULL; iProfileSettings = new(ELeave)CProfileSettings(iCba,ETrue); iProfileSettings->SetMopParent(this); iProfileSettings->ConstructL(); iProfileSettings->SetDataL(iItemArray[Curr]); } } } } SetMenuL(); DrawNow(); break; case EProfRemove: if(iProfileBox) { TInt Curr = iProfileBox->CurrentItemIndex(); if(Curr < 4) { // none removable } else { Curr = (Curr - 4); if(Curr >= 0 && Curr < iItemArray.Count()) { if(iItemArray[Curr]) { StringLoader::Load(Hjelpper,R_STR_REMMESSAGE); CAknQueryDialog* dlg = CAknQueryDialog::NewL(); if(dlg->ExecuteLD(R_QUERY,Hjelpper)) { CScheduleDB* ScheduleDB = new(ELeave)CScheduleDB(); CleanupStack::PushL(ScheduleDB); ScheduleDB->ConstructL(); ScheduleDB->DeleteFromDatabaseL(iItemArray[Curr]->iIndex); CleanupStack::PopAndDestroy(ScheduleDB); MakeProfileBoxL(); } } } } } SetMenuL(); DrawNow(); break; case EProfNew: { delete iProfileSettings; iProfileSettings = NULL; iProfileSettings = new(ELeave)CProfileSettings(iCba,ETrue); iProfileSettings->SetMopParent(this); iProfileSettings->ConstructL(); } SetMenuL(); DrawNow(); break; case ESettOk2: case ESettOk: if(iProfileSettings) { if(aCommand == ESettOk) { CMsgSched* newIttem = new(ELeave)CMsgSched(); CleanupStack::PushL(newIttem); newIttem->iIndex = -1; newIttem->iTime.HomeTime(); iProfileSettings->GetValuesL(newIttem); newIttem->iEnabled = ETrue; CScheduleDB* ScheduleDB = new(ELeave)CScheduleDB(); CleanupStack::PushL(ScheduleDB); ScheduleDB->ConstructL(); if(newIttem->iIndex >= 0) ScheduleDB->UpdateDatabaseL(newIttem); else ScheduleDB->SaveToDatabaseL(newIttem); CleanupStack::PopAndDestroy(ScheduleDB); CleanupStack::PopAndDestroy(newIttem); }else{ // ESettOk2 TInt Curr = iProfileBox->CurrentItemIndex(); if(Curr >= 0 && Curr < iKeyArray.Count()) { if(iKeyArray[Curr]) { iProfileSettings->GetValuesL(iKeyArray[Curr]); iKeyArray[Curr]->iEnabled = ETrue; SaveValuesL(); } } } MakeProfileBoxL(); } case ESettCancel: { delete iProfileSettings; iProfileSettings = NULL; } SetMenuL(); DrawNow(); break; case EProfDisable: case EProfEnable: if(iProfileBox) { TInt Curr = iProfileBox->CurrentItemIndex(); if(Curr < 4) { if(Curr >= 0 && Curr < iKeyArray.Count()) { if(iKeyArray[Curr]) { if(aCommand == EProfEnable) iKeyArray[Curr]->iEnabled = ETrue; else // EProfDisable iKeyArray[Curr]->iEnabled = EFalse; SaveValuesL(); iProfileBox->Model()->SetItemTextArray(GetProfilesArrayL()); } } } else { Curr = (Curr - 4); if(Curr >= 0 && Curr < iItemArray.Count()) { if(iItemArray[Curr]) { if(aCommand == EProfEnable) iItemArray[Curr]->iEnabled = ETrue; else // EProfDisable iItemArray[Curr]->iEnabled = EFalse; CScheduleDB* ScheduleDB = new(ELeave)CScheduleDB(); CleanupStack::PushL(ScheduleDB); ScheduleDB->ConstructL(); ScheduleDB->UpdateDatabaseL(iItemArray[Curr]); CleanupStack::PopAndDestroy(ScheduleDB); iProfileBox->Model()->SetItemTextArray(GetProfilesArrayL()); } } } } DrawNow(); break; case ESett2Ok: if(iDefaultSettings) { iDefaultSettings->SaveValuesL(); } case ESett2Cancel: { delete iDefaultSettings; iDefaultSettings = NULL; } SetMenuL(); DrawNow(); break; case EDefSettings: { iDefaultSettings = new(ELeave)CDefaultSettings(iCba); iDefaultSettings->ConstructL(); } SetMenuL(); DrawNow(); break; default: if(iDefaultSettings) { iDefaultSettings->HandleViewCommandL(aCommand); } else if(iProfileSettings) { iProfileSettings->HandleViewCommandL(aCommand); } break; } }