calendarui/controller/src/calenviewmanager.cpp
changeset 64 1881ad52dc45
parent 63 a3cb48f6c889
child 75 7ac58b2aae6f
equal deleted inserted replaced
63:a3cb48f6c889 64:1881ad52dc45
   256 	mCalenMonthView = static_cast<CalenMonthView *> 
   256 	mCalenMonthView = static_cast<CalenMonthView *> 
   257 							(mMonthViewDocLoader->findWidget(CALEN_MONTHVIEW));
   257 							(mMonthViewDocLoader->findWidget(CALEN_MONTHVIEW));
   258 	Q_ASSERT_X(mCalenMonthView, "calenviewmanager.cpp", 
   258 	Q_ASSERT_X(mCalenMonthView, "calenviewmanager.cpp", 
   259 											"Unable to load calenMonth view");
   259 											"Unable to load calenMonth view");
   260 	
   260 	
       
   261 	// Set the parent to delete the view once will exit the application
       
   262 	mCalenMonthView->setParent(this);
       
   263 	
   261 	// Setup the month view.
   264 	// Setup the month view.
   262 	mCalenMonthView->setupView(mMonthViewDocLoader);
   265 	mCalenMonthView->setupView(mMonthViewDocLoader);
   263 	
   266 	
   264 	OstTraceFunctionExit0( CALENVIEWMANAGER_LOADMONTHVIEW_EXIT );
   267 	OstTraceFunctionExit0( CALENVIEWMANAGER_LOADMONTHVIEW_EXIT );
   265 }
   268 }
   287 	// Get the calenagenda view from the loader
   290 	// Get the calenagenda view from the loader
   288 	mCalenAgendaView = static_cast<CalenAgendaView *> (mAgendaViewDocLoader->findWidget(CALEN_AGENDAVIEW));
   291 	mCalenAgendaView = static_cast<CalenAgendaView *> (mAgendaViewDocLoader->findWidget(CALEN_AGENDAVIEW));
   289 	if (!mCalenAgendaView) {
   292 	if (!mCalenAgendaView) {
   290 		qFatal("calenviewmanager.cpp : Unable to find agenda view");
   293 		qFatal("calenviewmanager.cpp : Unable to find agenda view");
   291 	}
   294 	}
       
   295 	
       
   296 	// Set the parent to delete the view once will exit the application
       
   297 	mCalenAgendaView->setParent(this);
   292 	
   298 	
   293 	// Setup the agenda view
   299 	// Setup the agenda view
   294 	mCalenAgendaView->setupView(mAgendaViewDocLoader);
   300 	mCalenAgendaView->setupView(mAgendaViewDocLoader);
   295 	
   301 	
   296 	// The following code is done to provide swipe support
   302 	// The following code is done to provide swipe support
   323         mCalenDayView = static_cast<CalenDayView *>
   329         mCalenDayView = static_cast<CalenDayView *>
   324             (docLoader->findWidget(CALEN_DAYVIEW));
   330             (docLoader->findWidget(CALEN_DAYVIEW));
   325         if (!mCalenDayView) {
   331         if (!mCalenDayView) {
   326             qFatal("calenviewmanager.cpp : Unable to find day view");
   332             qFatal("calenviewmanager.cpp : Unable to find day view");
   327         }
   333         }
       
   334         
       
   335         // Set the parent to delete the view once will exit the application
       
   336         mCalenDayView->setParent(this);
   328         
   337         
   329         // Set up the day view - day view takes the ownership
   338         // Set up the day view - day view takes the ownership
   330         mCalenDayView->setupView(docLoader);
   339         mCalenDayView->setupView(docLoader);
   331     }
   340     }
   332 }
   341 }
   687     mCalenAgendaViewAlt = static_cast<CalenAgendaView *> (mAgendaViewAltDocLoader->findWidget(CALEN_AGENDAVIEW));
   696     mCalenAgendaViewAlt = static_cast<CalenAgendaView *> (mAgendaViewAltDocLoader->findWidget(CALEN_AGENDAVIEW));
   688     if (!mCalenAgendaViewAlt) {
   697     if (!mCalenAgendaViewAlt) {
   689         qFatal("calenviewmanager.cpp : Unable to find alternate agenda view");
   698         qFatal("calenviewmanager.cpp : Unable to find alternate agenda view");
   690     }
   699     }
   691 
   700 
       
   701     // Set the parent to delete the view once will exit the application
       
   702     mCalenAgendaViewAlt->setParent(this);
       
   703     
   692     // Setup the agenda view
   704     // Setup the agenda view
   693     mCalenAgendaViewAlt->setupView(mAgendaViewAltDocLoader);
   705     mCalenAgendaViewAlt->setupView(mAgendaViewAltDocLoader);
   694     OstTraceFunctionExit0( CALENVIEWMANAGER_LOADALTERNATEAGENDAVIEW_EXIT );
   706     OstTraceFunctionExit0( CALENVIEWMANAGER_LOADALTERNATEAGENDAVIEW_EXIT );
   695 }
   707 }
   696 
   708 
   950 		mCalenMonthView->fetchEntriesAndUpdateModel();
   962 		mCalenMonthView->fetchEntriesAndUpdateModel();
   951 	}
   963 	}
   952 	else if (mCalenAgendaView && currentview == mCalenAgendaView) {
   964 	else if (mCalenAgendaView && currentview == mCalenAgendaView) {
   953 		mCalenAgendaView->doPopulation();
   965 		mCalenAgendaView->doPopulation();
   954 	}
   966 	}
       
   967     else if (mCalenDayView && currentview == mCalenDayView) {
       
   968         mCalenDayView->doPopulation();
       
   969     }
   955 	// Calls the emitAppReady function of CalenController. Need to emit this
   970 	// Calls the emitAppReady function of CalenController. Need to emit this
   956 	// signal after the view is fully constructed & populated
   971 	// signal after the view is fully constructed & populated
   957 	// with actual data and ready to be used. So entry view & instance view
   972 	// with actual data and ready to be used. So entry view & instance view
   958 	// needs to be created so that a new entry can also be created. Finally
   973 	// needs to be created so that a new entry can also be created. Finally
   959 	// NotesApplication object needs to emit applicationReady Signal.
   974 	// NotesApplication object needs to emit applicationReady Signal.