calendarui/controller/src/calencontroller.cpp
changeset 68 a5a1242fd2e8
parent 58 ef813d54df51
child 77 b0711afde476
--- a/calendarui/controller/src/calencontroller.cpp	Wed Aug 18 09:47:38 2010 +0300
+++ b/calendarui/controller/src/calencontroller.cpp	Thu Sep 02 20:25:23 2010 +0300
@@ -644,6 +644,8 @@
 		// launch the appropriate view
 		iViewManager->constructAndActivateView(view);
 		
+		iIsFromServiceFrmWrk = false;
+		
 	} else { // Calendar was in backgroung but now its being brought to foreground
 		// If current state is editing state or printing state
 		// or deleting state or sending state, then dont do anything as
@@ -654,11 +656,28 @@
 			(currentState == CCalenStateMachine::ECalenSendingState)) {
 			// simply return - we dont have anything to do
 		} 
+
+		else if (currentState == CCalenStateMachine::ECalenViewingState) {
+             if(iViewManager->isEventViewerActive()){
+		         iViewManager->closeAgendaEventView();
+		        }
+		}
 		else if (currentState == CCalenStateMachine::ECalenEditingState) {
-			// close the editor and save the entry
+			// close the editor and save the entry if application is in background
             //and launch the desired view
-            iActionUi->saveAndCloseEditor();
+            if(iViewManager->isEventViewerActive()){
+                iViewManager->saveAndCloseEditor();
+                iViewManager->closeAgendaEventView();
+               }
+            else{
+                iActionUi->saveAndCloseEditor();
+            }
 		} 
+
+		else if (currentState == CCalenStateMachine::ECalenSettingsState){
+            iViewManager->removeSettingsView();
+	        }
+ 
 		// Set the context properly
 		mContext->setFocusDateAndTime(dateTime);
 		IssueCommandL(view);