creator/engine/src/creator_log.cpp
changeset 19 4b22a598b890
parent 17 4f2773374eff
child 23 c9bf25a20c9f
--- a/creator/engine/src/creator_log.cpp	Fri May 14 15:53:02 2010 +0300
+++ b/creator/engine/src/creator_log.cpp	Thu May 27 12:52:19 2010 +0300
@@ -105,18 +105,62 @@
 
 //----------------------------------------------------------------------------
 
-TBool CCreatorLogs::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
+void CCreatorLogs::QueryDialogClosedL(TBool aPositiveAction, TInt aUserData)
+    {
+    LOGSTRING("Creator: CCreatorModuleBase::QueryDialogClosedL");
+    
+    if( aPositiveAction == EFalse )
+        {
+        iEngine->ShutDownEnginesL();
+        return;
+        }
+    
+    TBool finished(EFalse);
+    TBool retval(ETrue);
+    switch(aUserData)
+        {
+        case ECreatorLogsDelete:
+            iEntriesToBeCreated = 1;
+            finished = ETrue;
+            break;
+        case ECreatorLogsStart:
+            finished = ETrue;
+            break;
+        default:
+            //some error
+            retval = EFalse;
+            break;
+        }
+    if( retval == EFalse )
+        {
+        iEngine->ShutDownEnginesL();
+        }
+    else if( finished )
+        {
+        // add this command to command array
+        iEngine->AppendToCommandArrayL(iCommand, NULL, iEntriesToBeCreated);
+        // started exucuting commands
+        iEngine->ExecuteFirstCommandL( KSavingText );
+        }
+    }
+    
+//----------------------------------------------------------------------------
+
+TBool CCreatorLogs::AskDataFromUserL(TInt aCommand)
     {
     LOGSTRING("Creator: CCreatorLogs::AskDataFromUserL");
+    
+    iCommand = aCommand;
+    
     if ( aCommand == ECmdDeleteLogs )
         {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all log entries?") );
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all log entries?"), this, ECreatorLogsDelete );
         }
     else if ( aCommand ==  ECmdDeleteCreatorLogs )
         {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all log entries created with Creator?") );
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all log entries created with Creator?"), this, ECreatorLogsDelete );
         }
-    return iEngine->GetEngineWrapper()->EntriesQueryDialog( aNumberOfEntries, _L("How many entries to create?") );
+    return iEngine->GetEngineWrapper()->EntriesQueryDialog( &iEntriesToBeCreated, _L("How many entries to create?"), EFalse, this, ECreatorLogsStart );
     }
 
 //----------------------------------------------------------------------------