642 // Set the context properly |
642 // Set the context properly |
643 mContext->setFocusDateAndTime(dateTime); |
643 mContext->setFocusDateAndTime(dateTime); |
644 // launch the appropriate view |
644 // launch the appropriate view |
645 iViewManager->constructAndActivateView(view); |
645 iViewManager->constructAndActivateView(view); |
646 |
646 |
|
647 iIsFromServiceFrmWrk = false; |
|
648 |
647 } else { // Calendar was in backgroung but now its being brought to foreground |
649 } else { // Calendar was in backgroung but now its being brought to foreground |
648 // If current state is editing state or printing state |
650 // If current state is editing state or printing state |
649 // or deleting state or sending state, then dont do anything as |
651 // or deleting state or sending state, then dont do anything as |
650 // user might loose the data |
652 // user might loose the data |
651 CCalenStateMachine::TCalenStateIndex currentState = iStateMachine->CurrentState(); |
653 CCalenStateMachine::TCalenStateIndex currentState = iStateMachine->CurrentState(); |
652 if ((currentState == CCalenStateMachine::ECalenDeletingState) || |
654 if ((currentState == CCalenStateMachine::ECalenDeletingState) || |
653 (currentState == CCalenStateMachine::ECalenPrintingState) || |
655 (currentState == CCalenStateMachine::ECalenPrintingState) || |
654 (currentState == CCalenStateMachine::ECalenSendingState)) { |
656 (currentState == CCalenStateMachine::ECalenSendingState)) { |
655 // simply return - we dont have anything to do |
657 // simply return - we dont have anything to do |
656 } |
658 } |
|
659 |
|
660 else if (currentState == CCalenStateMachine::ECalenViewingState) { |
|
661 if(iViewManager->isEventViewerActive()){ |
|
662 iViewManager->closeAgendaEventView(); |
|
663 } |
|
664 } |
657 else if (currentState == CCalenStateMachine::ECalenEditingState) { |
665 else if (currentState == CCalenStateMachine::ECalenEditingState) { |
658 // close the editor and save the entry |
666 // close the editor and save the entry if application is in background |
659 //and launch the desired view |
667 //and launch the desired view |
660 iActionUi->saveAndCloseEditor(); |
668 if(iViewManager->isEventViewerActive()){ |
|
669 iViewManager->saveAndCloseEditor(); |
|
670 iViewManager->closeAgendaEventView(); |
|
671 } |
|
672 else{ |
|
673 iActionUi->saveAndCloseEditor(); |
|
674 } |
661 } |
675 } |
|
676 |
|
677 else if (currentState == CCalenStateMachine::ECalenSettingsState){ |
|
678 iViewManager->removeSettingsView(); |
|
679 } |
|
680 |
662 // Set the context properly |
681 // Set the context properly |
663 mContext->setFocusDateAndTime(dateTime); |
682 mContext->setFocusDateAndTime(dateTime); |
664 IssueCommandL(view); |
683 IssueCommandL(view); |
665 |
684 |
666 // connect to raise the window to foreground once the view is ready |
685 // connect to raise the window to foreground once the view is ready |