calendarui/agendaeventviewer/src/agendaeventview.cpp
changeset 63 a3cb48f6c889
parent 57 bb2d3e476f29
child 70 a5ed90760192
equal deleted inserted replaced
57:bb2d3e476f29 63:a3cb48f6c889
    92 		mMaptileService(NULL),
    92 		mMaptileService(NULL),
    93 		mProgressTimer(NULL),
    93 		mProgressTimer(NULL),
    94 		mProgressIconCount(0),
    94 		mProgressIconCount(0),
    95 		mMaptileStatusReceived(false),
    95 		mMaptileStatusReceived(false),
    96 		mMaptileStatus(-1),
    96 		mMaptileStatus(-1),
    97 		mNotesPluginLoaded(false)
    97 		mNotesPluginLoaded(false),
       
    98 		mCalenEditorClosed(true)		        
    98 {
    99 {
    99 	OstTraceFunctionEntry0( AGENDAEVENTVIEW_AGENDAEVENTVIEW_ENTRY );
   100 	OstTraceFunctionEntry0( AGENDAEVENTVIEW_AGENDAEVENTVIEW_ENTRY );
   100 	mTranslator->loadCommon();
   101 	mTranslator->loadCommon();
   101 	mDocLoader = new AgendaEventViewerDocLoader;
   102 	mDocLoader = new AgendaEventViewerDocLoader;
   102 
   103 
  1108 		// Launch the calendar entry editor using calendar editor api
  1109 		// Launch the calendar entry editor using calendar editor api
  1109 		mCalenEditor = new CalenEditor(mOwner->mAgendaUtil, this);
  1110 		mCalenEditor = new CalenEditor(mOwner->mAgendaUtil, this);
  1110 		connect(mCalenEditor, SIGNAL(dialogClosed()),
  1111 		connect(mCalenEditor, SIGNAL(dialogClosed()),
  1111 		                        this, SLOT(handleCalendarEditorClosed()));
  1112 		                        this, SLOT(handleCalendarEditorClosed()));
  1112 		mCalenEditor->edit(mAgendaEntry, false);
  1113 		mCalenEditor->edit(mAgendaEntry, false);
  1113 	
  1114 		mCalenEditorClosed = false;
  1114 		
  1115 		
  1115 	}
  1116 	}
  1116 	OstTraceFunctionExit0( AGENDAEVENTVIEW_EDIT_EXIT );
  1117 	OstTraceFunctionExit0( AGENDAEVENTVIEW_EDIT_EXIT );
  1117 }
  1118 }
  1118 
  1119 
  1274 void AgendaEventView::handleCalendarEditorClosed()
  1275 void AgendaEventView::handleCalendarEditorClosed()
  1275 {
  1276 {
  1276     OstTraceFunctionEntry0( AGENDAEVENTVIEW_HANDLECALENDAREDITORCLOSED_ENTRY );
  1277     OstTraceFunctionEntry0( AGENDAEVENTVIEW_HANDLECALENDAREDITORCLOSED_ENTRY );
  1277 
  1278 
  1278 	// Cleanup.
  1279 	// Cleanup.
       
  1280     mCalenEditorClosed = true;
  1279 	mCalenEditor->deleteLater();
  1281 	mCalenEditor->deleteLater();
  1280 	mOwner->editingCompleted();
  1282 	mOwner->editingCompleted();
  1281 
  1283 
  1282 	OstTraceFunctionExit0( AGENDAEVENTVIEW_HANDLECALENDAREDITORCLOSED_EXIT );
  1284 	OstTraceFunctionExit0( AGENDAEVENTVIEW_HANDLECALENDAREDITORCLOSED_EXIT );
  1283 }
  1285 }
  1491         addMapTileImage();
  1493         addMapTileImage();
  1492     }
  1494     }
  1493     OstTraceFunctionExit0( AGENDAEVENTVIEW_CHANGEDORIENTATION_EXIT );
  1495     OstTraceFunctionExit0( AGENDAEVENTVIEW_CHANGEDORIENTATION_EXIT );
  1494 }
  1496 }
  1495 
  1497 
       
  1498 /*!
       
  1499     Close the editor and save the entry.
       
  1500     should be call if editor is open
       
  1501  */
       
  1502 void AgendaEventView::saveAndCloseEditor()
       
  1503 {
       
  1504     if(mCalenEditorClosed){
       
  1505         QObject *plugin = qobject_cast<QObject*> (
       
  1506                 mNotesEditorPluginLoader->instance());
       
  1507 
       
  1508         NotesEditorInterface* interface =
       
  1509             qobject_cast<NotesEditorInterface*>(plugin);
       
  1510 
       
  1511         
       
  1512         interface->close(NotesEditorInterface::CloseWithSave ,mOwner->mAgendaUtil);
       
  1513 
       
  1514     }
       
  1515     else{
       
  1516         if(mCalenEditor){
       
  1517             mCalenEditor->saveAndCloseEditor();
       
  1518         }
       
  1519     }
       
  1520 }
       
  1521 
       
  1522 /*!
       
  1523     Close the view .
       
  1524     should be call if view is open
       
  1525  */
       
  1526 void AgendaEventView::closeAgendaEventView()
       
  1527 {
       
  1528     close();  
       
  1529 }
  1496 // End of file
  1530 // End of file