calendarui/controller/src/calencontroller.cpp
changeset 55 2c54b51f39c4
parent 51 0b38fc5b94c6
child 63 a3cb48f6c889
equal deleted inserted replaced
51:0b38fc5b94c6 55:2c54b51f39c4
   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 // ---------------------------------------------------------------------------
   703         }
   715         }
   704     OstTraceFunctionExit0( CCALENCONTROLLER_EVENTFILTER_EXIT );
   716     OstTraceFunctionExit0( CCALENCONTROLLER_EVENTFILTER_EXIT );
   705 
   717 
   706     return QObject::eventFilter(object, event);
   718     return QObject::eventFilter(object, event);
   707 }
   719 }
   708 // End of file
   720 
       
   721 /*
       
   722  * Emits the appReady signal.
       
   723  */
       
   724 void CCalenController::emitAppReady()
       
   725 {
       
   726 	emit appReady();
       
   727 }
       
   728 
       
   729 // End of file	--Don't remove this.