647 } else { // Calendar was in backgroung but now its being brought to foreground |
647 } else { // Calendar was in backgroung but now its being brought to foreground |
648 // If current state is editing state or printing state |
648 // If current state is editing state or printing state |
649 // or deleting state or sending state, then dont do anything as |
649 // or deleting state or sending state, then dont do anything as |
650 // user might loose the data |
650 // user might loose the data |
651 CCalenStateMachine::TCalenStateIndex currentState = iStateMachine->CurrentState(); |
651 CCalenStateMachine::TCalenStateIndex currentState = iStateMachine->CurrentState(); |
652 if ((currentState == CCalenStateMachine::ECalenEditingState) || |
652 if ((currentState == CCalenStateMachine::ECalenDeletingState) || |
653 (currentState == CCalenStateMachine::ECalenDeletingState) || |
|
654 (currentState == CCalenStateMachine::ECalenPrintingState) || |
653 (currentState == CCalenStateMachine::ECalenPrintingState) || |
655 (currentState == CCalenStateMachine::ECalenSendingState)) { |
654 (currentState == CCalenStateMachine::ECalenSendingState)) { |
656 // simply return - we dont have anything to do |
655 // simply return - we dont have anything to do |
657 } else { |
656 } |
658 // Set the context properly |
657 else if (currentState == CCalenStateMachine::ECalenEditingState) { |
659 mContext->setFocusDateAndTime(dateTime); |
658 // close the editor and save the entry |
660 IssueCommandL(view); |
659 //and launch the desired view |
661 } |
660 iActionUi->saveAndCloseEditor(); |
|
661 } |
|
662 // Set the context properly |
|
663 mContext->setFocusDateAndTime(dateTime); |
|
664 IssueCommandL(view); |
|
665 |
|
666 // connect to raise the window to foreground once the view is ready |
|
667 connect(&MainWindow(), SIGNAL(viewReady()), |
|
668 this, SLOT(raiseWindow())); |
662 } |
669 } |
663 OstTraceFunctionExit0( CCALENCONTROLLER_HANDLESERVICEMANAGERSLOT_EXIT ); |
670 |
664 } |
671 } |
665 |
672 void CCalenController::raiseWindow() |
|
673 { |
|
674 MainWindow().raise(); |
|
675 disconnect(&MainWindow(), SIGNAL(viewReady()), |
|
676 this, SLOT(raiseWindow())); |
|
677 } |
666 // ---------------------------------------------------------------------------- |
678 // ---------------------------------------------------------------------------- |
667 // CCalenController::getFirstView |
679 // CCalenController::getFirstView |
668 // returns the first view with which calendar has been launched |
680 // returns the first view with which calendar has been launched |
669 // (other items were commented in a header). |
681 // (other items were commented in a header). |
670 // --------------------------------------------------------------------------- |
682 // --------------------------------------------------------------------------- |