58 CalenNativeView(services), mContentScrollArea(NULL), mContentWidget(NULL), |
58 CalenNativeView(services), mContentScrollArea(NULL), mContentWidget(NULL), |
59 mHourScrollArea(NULL), mVLayout(NULL), mMainContainer(NULL), |
59 mHourScrollArea(NULL), mVLayout(NULL), mMainContainer(NULL), |
60 mDocLoader(NULL), mIsLaunching(true), mSettingsManager(NULL), |
60 mDocLoader(NULL), mIsLaunching(true), mSettingsManager(NULL), |
61 mRegionalInfoKey(XQSettingsKey::TargetCentralRepository, |
61 mRegionalInfoKey(XQSettingsKey::TargetCentralRepository, |
62 KCRUidCalendar, KCalendarShowRegionalInfo), mServices(services), |
62 KCRUidCalendar, KCalendarShowRegionalInfo), mServices(services), |
63 mRegionalInfoGroupBox(NULL), mGoToTodayMenuAction(NULL), mBg(NULL) |
63 mRegionalInfoGroupBox(NULL), mGoToTodayMenuAction(NULL), mBg(NULL), |
|
64 mGesturesAbsorber(NULL) |
64 { |
65 { |
65 setupMenu(); |
66 setupMenu(); |
66 |
67 |
67 // Create model manager |
68 // Create model manager |
68 mModelManager = new CalenDayModelManager(mServices, true, this); |
69 mModelManager = new CalenDayModelManager(mServices, true, this); |
141 mIsLaunching = false; |
142 mIsLaunching = false; |
142 QMetaObject::invokeMethod(this, "setupViewport", Qt::QueuedConnection); |
143 QMetaObject::invokeMethod(this, "setupViewport", Qt::QueuedConnection); |
143 } else { |
144 } else { |
144 setupViewport(); |
145 setupViewport(); |
145 } |
146 } |
|
147 |
|
148 //Set gestures absorber |
|
149 if (!mGesturesAbsorber) { |
|
150 mGesturesAbsorber = new HbWidget(this); |
|
151 mGesturesAbsorber->setZValue(100); |
|
152 mGesturesAbsorber->grabGesture(Qt::SwipeGesture); |
|
153 mGesturesAbsorber->grabGesture(Qt::PanGesture); |
|
154 mGesturesAbsorber->setGeometry(rect()); |
|
155 mGesturesAbsorber->installEventFilter(mContentScrollArea); |
|
156 } |
146 |
157 |
147 populationComplete(); |
158 populationComplete(); |
148 } |
159 } |
149 |
160 |
150 /*! |
161 /*! |
152 */ |
163 */ |
153 void CalenDayView::populationComplete() |
164 void CalenDayView::populationComplete() |
154 { |
165 { |
155 CalenNativeView::populationComplete(); |
166 CalenNativeView::populationComplete(); |
156 } |
167 } |
157 |
|
158 /*! |
|
159 \brief Reimplemented from MCalenNotificationHandler. The function handles calendar notifications |
|
160 |
|
161 \param notification notification type |
|
162 */ |
|
163 void CalenDayView::HandleNotification(const TCalenNotification notification) |
|
164 { |
|
165 Q_UNUSED( notification ) |
|
166 } |
|
167 |
|
168 |
168 |
169 /*! |
169 /*! |
170 \brief Sets up the view accroding to the 'xml' |
170 \brief Sets up the view accroding to the 'xml' |
171 |
171 |
172 \param docLoader Pointer to document loader |
172 \param docLoader Pointer to document loader |
282 /*! |
282 /*! |
283 \brief Sets the menu for day view |
283 \brief Sets the menu for day view |
284 */ |
284 */ |
285 void CalenDayView::setupMenu() |
285 void CalenDayView::setupMenu() |
286 { |
286 { |
287 menu()->addAction(hbTrId("txt_calendar_opt_new_event"), this, SLOT(runNewMeeting())); |
287 menu()->addAction(hbTrId("txt_calendar_opt_new_event"), this, SLOT(runNewMeeting())); |
288 //get pointer to this position, because need to change visibility |
288 //get pointer to this position, because need to change visibility |
289 mGoToTodayMenuAction = menu()->addAction(hbTrId("txt_calendar_opt_go_to_today"), this, SLOT(runGoToToday())); |
289 mGoToTodayMenuAction = menu()->addAction(hbTrId("txt_calendar_opt_go_to_today"), this, SLOT(runGoToToday())); |
290 menu()->addAction(hbTrId("txt_calendar_opt_go_to_date"), this, SLOT(goToDate())); |
290 menu()->addAction(hbTrId("txt_calendar_opt_go_to_date"), this, SLOT(goToDate())); |
291 //TODO: Add id for this text |
291 //TODO: Add id for this text |
292 //"Switch to Agenda view" |
292 //"Switch to Agenda view" |
293 menu()->addAction(hbTrId("txt_calendar_opt_switch_to_agenda_view"), this, SLOT(runChangeToAgendaView())); |
293 menu()->addAction(hbTrId("txt_calendar_opt_switch_to_agenda_view"), this, SLOT(runChangeToAgendaView())); |
294 //TODO: Add id for this text (lunar data) |
294 //TODO: Add id for this text (lunar data) |
295 //"Show lunar data" |
295 //"Show lunar data" |
296 if (pluginEnabled()) |
296 if (pluginEnabled()) |
297 { |
297 { |
298 menu()->addAction(hbTrId("txt_calendar_opt_show_lunar_data"), this, SLOT(runLunarData())); |
298 menu()->addAction(hbTrId("txt_calendar_opt_show_lunar_data"), this, SLOT(runLunarData())); |
299 } |
299 } |
300 menu()->addAction(hbTrId("txt_calendar_opt_settings"), this, SLOT(launchSettingsView())); |
300 menu()->addAction(hbTrId("txt_calendar_opt_settings"), this, SLOT(launchSettingsView())); |
|
301 |
|
302 // Close the menu once closeDialogs() is received |
|
303 connect(this, SIGNAL(closeDialogs()), menu(), SLOT(close())); |
301 } |
304 } |
302 |
305 |
303 /*! |
306 /*! |
304 \brief To change Day view to Agenda View |
307 \brief To change Day view to Agenda View |
305 */ |
308 */ |