calendarui/controller/src/calencmdlinelauncher.cpp
branchRCL_3
changeset 36 9c5b1510919f
parent 30 d68a4b5d5885
child 48 bf573002ff72
--- a/calendarui/controller/src/calencmdlinelauncher.cpp	Tue May 25 12:41:10 2010 +0300
+++ b/calendarui/controller/src/calencmdlinelauncher.cpp	Wed Jun 09 09:40:23 2010 +0300
@@ -34,6 +34,7 @@
 #include "calencmdlineparser.h"         // CCalCmdLineParser
 #include "CalenUid.h"
 #include "calensend.h"
+#include "calendialogshutter.h"
 
 // ================= MEMBER FUNCTIONS =======================
 
@@ -92,6 +93,12 @@
         }
 
     delete iCalendarLaunchCallBack;
+    
+    if ( iShutter )
+        {
+        delete iShutter;
+        iShutter = NULL;
+        }
 
     TRACE_EXIT_POINT;
     }
@@ -119,7 +126,7 @@
     iController.RegisterForNotificationsL( this, exitFlags );
     
     exitFlags.Reset();
-
+    iShutter = CCalenDialogShutter::NewL( CEikonEnv::Static() );
     TRACE_EXIT_POINT;
     }
 
@@ -153,22 +160,10 @@
             // Tell the editui that whatever it was doing, it should not alter
             // the focus state
             iController.IssueCommandL( ECalenNotifyFocusChange );
-
-            // Send a key event to the currently open dialog (viewer / editor)
-            // to dismiss it
-            /*TKeyEvent key;
-            key.iRepeats = 0;
-            key.iCode = EKeyEscape;
-            key.iModifiers = 0;
-            CCoeEnv::Static()->SimulateKeyEventL( key, EEventKey );*/
-            AknDialogShutter::ShutDialogsL( *CEikonEnv::Static() );
-            // Break is added to close the messaging editor as the messagng editor is not 
-            // consuming the escape key event.
-            /*if( iGlobalData->CalenSendL().IsMessagingEditorOpen() )
-                {
-            break;
-                }*/
-                 
+            
+            iShutter->Cancel();
+            //close all open dialogs in asynchronous way
+            iShutter->ShutDialogsL();
             }
 
         // Interpret 8bit data as 16bit unicode data