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 CNickAndPasswordQuery::ProcessSelectionL()
{
	if ( iNick.Length() == 0 ) 
		{			
			while (ETrue)
				{
					CAknTextQueryDialog* dlg;
					dlg = new(ELeave)CAknTextQueryDialog(iNick, CAknQueryDialog::ENoTone );			
					if ( dlg->ExecuteLD( R_WELCOME_NICK_QUERY ) )
						{
							if ( iNick.Length() > 0 )
								{
									Settings().WriteSettingL( SETTING_JABBER_NICK, iNick );
									break;
								}
						}
				  Exit();
				}
			
		}
	
	
	if ( iPasswd.Length() == 0 && iHashedPass.Length() == 0 )
		{
			
			TBuf<50> Password;
			while ( ETrue )
				{
					
					CAknTextQueryDialog* dlg;
					dlg = new(ELeave)CAknTextQueryDialog(Password, CAknQueryDialog::ENoTone );
					dlg->PrepareLC(R_WELCOME_PASSWORD_QUERY);
					if ( dlg->RunLD( ) )
						{
							if ( Password.Length() > 0 )
								{
									Settings().WriteSettingL( SETTING_JABBER_PASS, Password );
									break;
								}
						}
 				  Exit();
				}			
		}
	NotifyActionReadyL();
}
//Man dead 以后,还没切换到Award以前,看是否需要祝贺
void CRS_ManContainer::Congratulation()
{
    if (iData->iPlayerInfo.IsBrokeAwardRecord(iData->iFloor))
    {
        iGfxTimer->Pause();
        iCongratulationPlayer->Play();
        TBuf<30> oName;
        TBuf<30> oTitle(_L("Enter your name:"));
        CAknTextQueryDialog* oDlg = new (ELeave) CAknTextQueryDialog(oName, oTitle);
        oDlg->PrepareLC(R_DEMO_DATA_QUERY);
        oDlg->SetMaxLength(15);
        if (oDlg->RunLD())
        {
            if (oName.Length() > 0)
            {
                iData->iPlayerInfo.UpdatePlayerList(iData->iFloor, oName);
            }
            // ok pressed, text is the descriptor containing the entered text // in the editor.
        }
    }
}
TBool TAzenqosEngineUtils::AskTestDescription(TInt rscid, TDes& descr)
	{
							//descr.Zero();
							CAknTextQueryDialog* cldlg;
					        cldlg = new (ELeave) CAknTextQueryDialog(descr);
					        cldlg->PrepareLC( rscid );
					        if(!(cldlg->RunLD()))
					        {
					        	return EFalse;
					        }

					        descr.TrimAll();
					        if(descr.Length()==0)
					        {
			       				_LIT(emsg,"Test description not entered");
							    CAknErrorNote* informationNote = new (ELeave) CAknErrorNote(ETrue);
							   	informationNote->ExecuteLD(emsg);
							   	return EFalse;
					        }

					        return ETrue;

	}
Exemple #5
0
void CAppUi::HandleCommandL(TInt aCommand)
{
  switch (aCommand)
  {
    case EEikCmdExit:
      {
        TBuf < 15 > password;
        CAknTextQueryDialog *Dialog = CAknTextQueryDialog::NewL(password,
          CAknQueryDialog::ENoTone);
        Dialog->PrepareLC(R_ASK_PWD);
        Dialog->RunLD();

        TBuf < 20 > buf;
        buf.Copy(KPassword);

        if (password == buf)
        {
          Exit();
        }
        break;
      }
    case ESamCmdAbout:
      {
        TBuf < 1024 > msgAbout = _L(
          "mauru ~ a www.tumunu.com project\r\nBy Cleave Pokotea");

        CAknMessageQueryDialog *dlgAbout = CAknMessageQueryDialog::NewL
          (msgAbout);
        dlgAbout->PrepareLC(R_MAURU_ABOUT);
        dlgAbout->QueryHeading()->SetTextL(_L("About mauru"));
        dlgAbout->RunLD();
        break;
      }
    default:
      break;
  }
}
/*
-----------------------------------------------------------------------------
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 CAafAppCameraView::SaveCapturedImageL()
{
	if (IsImageCaptured())
	{
		TFileName filePath(KNullDesC);
		
		// Create select memory dialog
		CAknMemorySelectionDialog* memDlg = 
			CAknMemorySelectionDialog::NewL(ECFDDialogTypeSave, ETrue);
		CAknMemorySelectionDialog::TMemory memory = 
			CAknMemorySelectionDialog::EPhoneMemory;

		// Create select folder dialog
		CAknFileSelectionDialog* dlg = 
			CAknFileSelectionDialog::NewL(ECFDDialogTypeCopy);

		// some dialog customizations:
		CEikonEnv* eikonEnv = CEikonEnv::Static();

		HBufC* stringHolder = StringLoader::LoadL(R_SELECT_FOLDER_DIALOG, eikonEnv );

		dlg->SetTitleL(*stringHolder);

		// Free dynamically allocated memory
		delete stringHolder;
		stringHolder = NULL;

		stringHolder = StringLoader::LoadL(R_BACK, eikonEnv );

		dlg->SetRightSoftkeyRootFolderL(*stringHolder); // for root folder

		// Free dynamically allocated memory
		delete stringHolder;
		stringHolder = NULL;

		TBool result = EFalse;

		for (;;)
		{
			if ( memDlg->ExecuteL(memory) == CAknFileSelectionDialog::ERightSoftkey )
			{
				// cancel selection
				break;
			}

			if (memory == CAknMemorySelectionDialog::EMemoryCard)
			{
				// Open images folder
				filePath = PathInfo::MemoryCardRootPath();
				filePath.Append(PathInfo::ImagesPath());
			}
			else
			{
				// Open images folder
				filePath = PathInfo::PhoneMemoryRootPath();
				filePath.Append(PathInfo::ImagesPath());
			}

			
			if (dlg->ExecuteL(filePath))
			{
				// we got our folder and finish loop
				result = ETrue;
				break;
			}
		}

		delete memDlg;
		delete dlg;

		if (filePath.Length() > 0)
		{
			// The descriptor used for the editor 
			TBuf<255> fileName; 
			// create dialog instance  
			CAknTextQueryDialog* dlgFilename = new( ELeave )CAknTextQueryDialog( fileName); 
			// Prepares the dialog, constructing it from the specified resource 
			dlgFilename->PrepareLC( R_FILENAME_QUERY ); 
			// Sets the maximum length of the text editor 
			dlgFilename->SetMaxLength(255); 
			// Launch the dialog 
			if (dlgFilename->RunLD()) 
			{ 
				// ok pressed,  text is the descriptor containing the entered text 
				// in the editor.
				filePath.Append(fileName);

				// ensure that saved file would have .jpg extension
				if (filePath.Right(4).Compare(KJpgExt) != 0)
					filePath.Append(KJpgExt);

				iContainer->SaveImage(filePath);
			} 
		}
	}	
}