diff -r ef813d54df51 -r a5a1242fd2e8 calendarui/agendaeventviewer/src/agendaeventview.cpp --- a/calendarui/agendaeventviewer/src/agendaeventview.cpp Wed Aug 18 09:47:38 2010 +0300 +++ b/calendarui/agendaeventviewer/src/agendaeventview.cpp Thu Sep 02 20:25:23 2010 +0300 @@ -94,7 +94,8 @@ mProgressIconCount(0), mMaptileStatusReceived(false), mMaptileStatus(-1), - mNotesPluginLoaded(false) + mNotesPluginLoaded(false), + mCalenEditorClosed(true) { OstTraceFunctionEntry0( AGENDAEVENTVIEW_AGENDAEVENTVIEW_ENTRY ); mTranslator->loadCommon(); @@ -1110,7 +1111,7 @@ connect(mCalenEditor, SIGNAL(dialogClosed()), this, SLOT(handleCalendarEditorClosed())); mCalenEditor->edit(mAgendaEntry, false); - + mCalenEditorClosed = false; } OstTraceFunctionExit0( AGENDAEVENTVIEW_EDIT_EXIT ); @@ -1276,6 +1277,7 @@ OstTraceFunctionEntry0( AGENDAEVENTVIEW_HANDLECALENDAREDITORCLOSED_ENTRY ); // Cleanup. + mCalenEditorClosed = true; mCalenEditor->deleteLater(); mOwner->editingCompleted(); @@ -1493,4 +1495,36 @@ OstTraceFunctionExit0( AGENDAEVENTVIEW_CHANGEDORIENTATION_EXIT ); } +/*! + Close the editor and save the entry. + should be call if editor is open + */ +void AgendaEventView::saveAndCloseEditor() +{ + if(mCalenEditorClosed){ + QObject *plugin = qobject_cast ( + mNotesEditorPluginLoader->instance()); + + NotesEditorInterface* interface = + qobject_cast(plugin); + + + interface->close(NotesEditorInterface::CloseWithSave ,mOwner->mAgendaUtil); + + } + else{ + if(mCalenEditor){ + mCalenEditor->saveAndCloseEditor(); + } + } +} + +/*! + Close the view . + should be call if view is open + */ +void AgendaEventView::closeAgendaEventView() +{ + close(); +} // End of file