void CYBrowserFileHandler1::HandleCommandL(TInt aCommand)
{
	switch (aCommand)
    { 
    case EAbout:
    	{
    		HBufC* Abbout = KtxAbbout().AllocLC();
			TPtr Pointter(Abbout->Des());
			CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(Pointter);
			dlg->PrepareLC(R_ABOUT_HEADING_PANE);
			dlg->SetHeaderTextL(KtxApplicationName);  
			dlg->RunLD();
			
			CleanupStack::PopAndDestroy(Abbout);
    	}
    	break;
    case EBacktoYBrowser:
    	if(iFileHandlerUtils)
    	{
    		iFileHandlerUtils->HandleExitL(this,MYBrowserFileHandlerUtils::ENoChangesMade);	
    	}
    	break; 
	default:
		break;
    };
}
void CBuddycloudCommunitiesContainer::HandleItemSelectionL(TInt aIndex) {
	if(aIndex == ECommunityFacebook) {
		CAknMessageQueryDialog* aMessageDialog = new (ELeave) CAknMessageQueryDialog();
		aMessageDialog->PrepareLC(R_EXIT_DIALOG);
		
		HBufC* aFacebookText = iEikonEnv->AllocReadResourceLC(R_LOCALIZED_STRING_SETTINGS_FACEBOOK_TEXT);
		aMessageDialog->SetHeaderTextL(_L("Facebook"));
		aMessageDialog->SetMessageTextL(*aFacebookText);
		CleanupStack::PopAndDestroy(); // aFacebookText

		TCallBack aCallback(FacebookLaunchCallback);
		aMessageDialog->SetLink(aCallback);
		aMessageDialog->SetLinkTextL(_L("http://apps.facebook.com/buddycloud"));
		
		if(aMessageDialog->RunLD() != 0) {		
			aCallback.CallBack();
		}
	}
	else if(aIndex == ECommunityTwitter) {
		CAknMultiLineDataQueryDialog* aDialog = 
					CAknMultiLineDataQueryDialog::NewL(iBuddycloudLogic->GetDescSetting(ESettingItemTwitterUsername), 
					iBuddycloudLogic->GetDescSetting(ESettingItemTwitterPassword));

		if(aDialog->ExecuteLD(R_CREDENTIALS_DIALOG) != 0) {
			iBuddycloudLogic->SendCommunityCredentials(ECommunityTwitter);
		}
	}
}
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CMgAppUi::HandleCommandL(TInt aCommand)
    {
    switch (aCommand)
    {
    case EChangeLayout:
    	#ifdef __SERIES60_3X__
    	{
    		if(Orientation() == EAppUiOrientationLandscape)
    		{
    			SetOrientationL(EAppUiOrientationPortrait);	
    		}
    		else
    		{
    			SetOrientationL(EAppUiOrientationLandscape);
    		}
    	}
    	#else

		#endif
    	break;

    case EAbout:
		{	
		#ifdef __SERIES60_3X__		
			HBufC* Abbout = KtxAboutText().AllocLC();
			TPtr Pointter(Abbout->Des());
			
			CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(Pointter);
			dlg->PrepareLC(R_ABOUT_HEADING_PANE);
			dlg->SetHeaderTextL(_L("About"));  
			dlg->RunLD();
				
			CleanupStack::PopAndDestroy(1);//,Abbout
		#else
		
		#endif
		}
    	break;
    case EClose:
    	{
    		// splash screen do nothing..
    	}
    	break;
#ifdef __SERIES60_3X__
    case EAknSoftkeyExit:
#endif
//    case EEikCmdExit:
		Exit();
        break;
    default:
    	if(iMainContainer)
    	{
    		iMainContainer->HandleViewCommandL(aCommand);
    	}
        break;
        }
    }
 /*
  * Save Form data, function to be executed when save option is selected. 
  * Creates the second form which allows for selecting the category.
  */
 TBool CYPagesForm1::SaveFormDataL()
{  
    CAknPopupFieldText* popupFieldText = static_cast <CAknPopupFieldText*> (ControlOrNull(EYPagesPopup));
 	if (popupFieldText) {		
		TInt categoryIndex = popupFieldText->CurrentValueIndex();
		TBuf <30> KMyTextFile;
		KMyTextFile.Format(_L("D:\\YPages\\%d%d.txt"), iColor, categoryIndex);
		
		RFs fileServer;
 	    User :: LeaveIfError (fileServer.Connect());
 	    RFile file;
 	    User::LeaveIfError(file.Open(fileServer, KMyTextFile, EFileRead|EFileStreamText));
 	    CleanupClosePushL(file);
 	    
 	    TFileText fileText;
 	    fileText.Set(file);
 	    
 	    TBuf<100> buffer;
 	    buffer = _L("");

 	    RBuf rBuf;
 	    rBuf.Create(buffer);
 	    rBuf.CleanupClosePushL();
 	    
 	  
 	    TInt err = KErrNone;
 	    while(err != KErrEof) {
 			err = fileText.Read(buffer);
 	    
 			if ((err != KErrNone) && (err != KErrEof)) {
 				User :: Leave(err);
 			}
 			if (KErrNone == err) {
 				rBuf.ReAllocL(rBuf.Length() + buffer.Length()+2);
 				rBuf.Append(buffer);
 				rBuf.Append(_L("\n"));
 			}
 	    }
 	    CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(rBuf);
 	    dlg->PrepareLC(R_ABOUT_HEADING_PANE);
   	    dlg->SetHeaderTextL(_L(""));  
   	    dlg->RunLD();
 	    		     
 	    CleanupStack::PopAndDestroy(&rBuf);
 	    CleanupStack::PopAndDestroy(&file);
 	    
 	    fileServer.Close();

 	
 	}

        

 	return ETrue;
 }
void CYBrowserFileHandler1::HandleCommandL(TInt aCommand)
{
	if(iDebugFile.SubSessionHandle())
	{	
		iDebugFile.Write(_L8("cmd, "));
	}
	
	switch (aCommand)
    { 
	case EPlugAppHelpBack:
		{
			delete iMyHelpContainer;
			iMyHelpContainer = NULL;
		}
		SetMenuL();
		DrawNow();
		break;
	case EPlugAppHelp:
		{
			delete iMyHelpContainer;
			iMyHelpContainer = NULL;    		
			iMyHelpContainer = CMyHelpContainer::NewL();
		}
		SetMenuL();
		DrawNow();    		
		break;
    case EPlugAbout:
    	{			
    		HBufC* Abbout = KMailAbbout().AllocLC();
			TPtr Pointter(Abbout->Des());
			CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(Pointter);
			dlg->PrepareLC(R_ABOUT_HEADING_PANE);
			dlg->SetHeaderTextL(KMailAbboutName);  
			dlg->RunLD();
			
			CleanupStack::PopAndDestroy(Abbout);
    	}
    	break;
    case EBacktoYBrowser:
    	if(iFileHandlerUtils)
    	{
    		iFileHandlerUtils->HandleExitL(this,MYBrowserFileHandlerUtils::EChangesMade);	
    	}
    	break; 
	default:
		if(iMailBoxContainer)
		{
			iMailBoxContainer->HandleViewCommandL(aCommand);
		}
		break;
    };
}
Example #6
0
void CMLauncherAppUi::ShowErrorCleanCommL(TMsgType aErrorType, HBufC* aErrorString, TInt aErr, TBool aClean, TBool aKeepListening)
{
	//write the message into the LOG as well
	CleanupStack::PushL(aErrorString);
	LOG(ELogGeneral,1,"CMLauncherAppUi::ShowErrorCleanCommL: error type=%d, error=%d, error text: %S",aErrorType,aErr,aErrorString);
	//LOG(*);

	// if we are going to switch the view in this function, we would need to postpone showing the error
	// message until the new view is activated. Otherwise the activation will delete out error
	TBool showErrorAfterViewSwitch(EFalse);
	//first, we close the stuff!
	__ASSERT_ALWAYS((!(aErrorType==EMsgError || aErrorType==EMsgErrorPersistent) || aClean),Panic(EBTErrorAndNoClean));

	if(aClean)
	{
		if((iDirection==EDirectionReceiving && CCommReceiver::GetInstanceL()->iActiveRequest==CCommCommon::EActiveRequestTransferPlaylist) ||
		   (iDirection==EDirectionSending && CCommSender::GetInstanceL()->iActiveRequest==CCommCommon::EActiveRequestTransferPlaylist))
		{
			if(iCurrentView==iFiletransferView)
				showErrorAfterViewSwitch=ETrue; //the view will be changed!
			PlaylistTransferCompleteL();//this cleans the data as well (delete the socket)
		}
		else
		    Clean(aKeepListening);
	};

	LOG0("CMLauncherAppUi::ShowErrorCleanCommL: closing stuff ended, now we show the error message");
	if(aErrorType==EMsgNotePersistent || aErrorType==EMsgWarningPersistent || aErrorType==EMsgErrorPersistent)
	{
		//this is a different type of note
		CAknMessageQueryDialog* dlg = new (ELeave)CAknMessageQueryDialog;
		CleanupStack::PushL(dlg);

		dlg->SetMessageTextL(*aErrorString);
		HBufC* header(NULL);
		switch(aErrorType)
		{
		case EMsgNotePersistent:header=StringLoader::LoadLC(R_NOTE_HEADER);break;
		case EMsgWarningPersistent:header=StringLoader::LoadLC(R_WARNING_HEADER);break;
		case EMsgErrorPersistent:header=StringLoader::LoadLC(R_ERROR_HEADER);break;
		default:LOG0("CMLauncherAppUi::ShowErrorCleanCommL: switch(aErrorType)/persistent: %d not handled",aErrorType);Panic(ESwitchValueNotHandled);
		};

		dlg->SetHeaderTextL(*header);
		CleanupStack::PopAndDestroy(header);

		if(showErrorAfterViewSwitch && iListView)
		{
			iDlgMsg=dlg;
			iListView->iFlags|=CFFListView::EHasMessage2Display;
			LOG0("Show dialog postponed after view change");
		}
		else
		{
			iDlgMsg=dlg;
			DisplayMessageL();
		};
		CleanupStack::Pop(dlg);
		CleanupStack::PopAndDestroy(aErrorString);
	}
	else
	{
		CAknResourceNoteDialog *note(NULL);
		switch(aErrorType)
		{
		case EMsgError:note=new(ELeave)CAknErrorNote;break;
		case EMsgWarning:note=new(ELeave)CAknWarningNote;break;
		case EMsgNote:note=new(ELeave)CAknInformationNote;break;
		default:LOG0("CMLauncherAppUi::ShowErrorCleanCommL: switch(aErrorType)/note: %d not handled",aErrorType);Panic(ESwitchValueNotHandled);
		};
		if(showErrorAfterViewSwitch && iListView)
		{
			iDlgNote=note;
			iDlgNoteString=aErrorString;
			iListView->iFlags|=CFFListView::EHasMessage2Display;
			CleanupStack::Pop(aErrorString);
			LOG0("Show note postponed after view change");
		}
		else
		{
			iDlgNote=note;
			iDlgNoteString=aErrorString;
			CleanupStack::Pop(aErrorString);
			DisplayMessageL();
		};
	};

	LOG(ELogGeneral,-1,"CMLauncherAppUi::ShowErrorCleanCommL: end");
};
Example #7
0
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;
    };
}
Example #8
0
/*
-----------------------------------------------------------------------
-----------------------------------------------------------------------
*/
TBool CMgAppUi::ShowDisclaimerL(void)
{
	TBool OkToContinue(EFalse);

	if(KAppIsTrial){
        TFindFile AppFile(CCoeEnv::Static()->FsSession());
        if(KErrNone != AppFile.FindByDir(KtxDisclaimerFileName, KNullDesC))
        {
            HBufC* Abbout = KtxDisclaimer().AllocLC();
            TPtr Pointter(Abbout->Des());
            CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(Pointter);
            dlg->PrepareLC(R_DDD_HEADING_PANE);
            dlg->SetHeaderTextL(KtxDisclaimerTitle);  
            if(dlg->RunLD())
            {
                TFileName ShortFil;
                if(KErrNone ==CCoeEnv::Static()->FsSession().PrivatePath(ShortFil))
                {
                    TFindFile privFile(CCoeEnv::Static()->FsSession());
                    if(KErrNone == privFile.FindByDir(ShortFil, KNullDesC))
                    {
                        TParsePtrC hjelp(privFile.File());
                        ShortFil.Copy(hjelp.Drive());
                        ShortFil.Append(KtxDisclaimerFileName);
                    }
                }
    
            
                BaflUtils::EnsurePathExistsL(CCoeEnv::Static()->FsSession(),ShortFil);
            
                RFile MyFile;
                if(KErrNone == MyFile.Create(CCoeEnv::Static()->FsSession(),ShortFil,EFileWrite))
                {
                    TTime NowTime;
                    NowTime.HomeTime();
                    
                    TBuf8<255> InfoLine;
                    InfoLine.Copy(_L8("Accepted on Date\t"));
                        
                    InfoLine.AppendNum(NowTime.DateTime().Day() + 1);
                    InfoLine.Append(_L8("."));
                    InfoLine.AppendNum((NowTime.DateTime().Month() + 1));
                    InfoLine.Append(_L8("."));
                    InfoLine.AppendNum(NowTime.DateTime().Year());
                    InfoLine.Append(_L8(" "));
                    InfoLine.Append(_L8("--"));
                    InfoLine.AppendNum(NowTime.DateTime().Hour());
                    InfoLine.Append(_L8(":"));		
                    TInt HelperInt = NowTime.DateTime().Minute();
                    if(HelperInt < 10)
                        InfoLine.AppendNum(0);
                    InfoLine.AppendNum(HelperInt);
                    InfoLine.Append(_L8(":"));
                    HelperInt = NowTime.DateTime().Second();
                    if(HelperInt < 10)
                        InfoLine.AppendNum(0);
                    InfoLine.AppendNum(HelperInt);
                    InfoLine.Append(_L8(" "));
                    
                    MyFile.Write(InfoLine);
                    MyFile.Close();
                }
                
                OkToContinue = ETrue;
            }
            
            CleanupStack::PopAndDestroy(Abbout);
        }
        else
        {
            OkToContinue = ETrue;
        }
	}
    else
    {
        OkToContinue = ETrue;
    }
	
	return OkToContinue;
}
Example #9
0
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;
    };
}