creator/engine/src/creator_log.cpp
changeset 19 4b22a598b890
parent 17 4f2773374eff
child 23 c9bf25a20c9f
equal deleted inserted replaced
17:4f2773374eff 19:4b22a598b890
   103         delete iParameters;
   103         delete iParameters;
   104     }
   104     }
   105 
   105 
   106 //----------------------------------------------------------------------------
   106 //----------------------------------------------------------------------------
   107 
   107 
   108 TBool CCreatorLogs::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
   108 void CCreatorLogs::QueryDialogClosedL(TBool aPositiveAction, TInt aUserData)
       
   109     {
       
   110     LOGSTRING("Creator: CCreatorModuleBase::QueryDialogClosedL");
       
   111     
       
   112     if( aPositiveAction == EFalse )
       
   113         {
       
   114         iEngine->ShutDownEnginesL();
       
   115         return;
       
   116         }
       
   117     
       
   118     TBool finished(EFalse);
       
   119     TBool retval(ETrue);
       
   120     switch(aUserData)
       
   121         {
       
   122         case ECreatorLogsDelete:
       
   123             iEntriesToBeCreated = 1;
       
   124             finished = ETrue;
       
   125             break;
       
   126         case ECreatorLogsStart:
       
   127             finished = ETrue;
       
   128             break;
       
   129         default:
       
   130             //some error
       
   131             retval = EFalse;
       
   132             break;
       
   133         }
       
   134     if( retval == EFalse )
       
   135         {
       
   136         iEngine->ShutDownEnginesL();
       
   137         }
       
   138     else if( finished )
       
   139         {
       
   140         // add this command to command array
       
   141         iEngine->AppendToCommandArrayL(iCommand, NULL, iEntriesToBeCreated);
       
   142         // started exucuting commands
       
   143         iEngine->ExecuteFirstCommandL( KSavingText );
       
   144         }
       
   145     }
       
   146     
       
   147 //----------------------------------------------------------------------------
       
   148 
       
   149 TBool CCreatorLogs::AskDataFromUserL(TInt aCommand)
   109     {
   150     {
   110     LOGSTRING("Creator: CCreatorLogs::AskDataFromUserL");
   151     LOGSTRING("Creator: CCreatorLogs::AskDataFromUserL");
       
   152     
       
   153     iCommand = aCommand;
       
   154     
   111     if ( aCommand == ECmdDeleteLogs )
   155     if ( aCommand == ECmdDeleteLogs )
   112         {
   156         {
   113         return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all log entries?") );
   157         return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all log entries?"), this, ECreatorLogsDelete );
   114         }
   158         }
   115     else if ( aCommand ==  ECmdDeleteCreatorLogs )
   159     else if ( aCommand ==  ECmdDeleteCreatorLogs )
   116         {
   160         {
   117         return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all log entries created with Creator?") );
   161         return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all log entries created with Creator?"), this, ECreatorLogsDelete );
   118         }
   162         }
   119     return iEngine->GetEngineWrapper()->EntriesQueryDialog( aNumberOfEntries, _L("How many entries to create?") );
   163     return iEngine->GetEngineWrapper()->EntriesQueryDialog( &iEntriesToBeCreated, _L("How many entries to create?"), EFalse, this, ECreatorLogsStart );
   120     }
   164     }
   121 
   165 
   122 //----------------------------------------------------------------------------
   166 //----------------------------------------------------------------------------
   123 
   167 
   124 void CCreatorLogs::RunL()
   168 void CCreatorLogs::RunL()