calendarui/views/src/calenagendaview.cpp
changeset 75 7ac58b2aae6f
parent 70 a5ed90760192
child 81 ce92091cbd61
equal deleted inserted replaced
72:27feeedec790 75:7ac58b2aae6f
   152     }
   152     }
   153     
   153     
   154     // Set self as the current view
   154     // Set self as the current view
   155     // mServices.MainWindow().setCurrentView(this);
   155     // mServices.MainWindow().setCurrentView(this);
   156     
   156     
   157     // Dont override the soft key behavior if day view is the first view
   157     // Dont override the soft key behavior if day view or agenda view is the first view
   158     if (ECalenAgendaView != mServices.getFirstView()) {
   158     if (ECalenMonthView == mServices.getFirstView()) {
   159 		mSoftKeyAction = new HbAction(Hb::BackNaviAction);
   159 		mSoftKeyAction = new HbAction(Hb::BackNaviAction);
   160 		setNavigationAction(mSoftKeyAction);
   160 		setNavigationAction(mSoftKeyAction);
   161 		// Connect to the signal triggered by clicking on back button.
   161 		// Connect to the signal triggered by clicking on back button.
   162 		connect(mSoftKeyAction, SIGNAL(triggered()), this,
   162 		connect(mSoftKeyAction, SIGNAL(triggered()), this,
   163 		        SLOT(launchMonthView()));
   163 		        SLOT(launchMonthView()));
   164 		if (mSwitchToDayViewAction) {
   164 	}
   165 			mSwitchToDayViewAction->setVisible(true);
   165     
   166 				}
       
   167 	} else {
       
   168 		if (mSwitchToDayViewAction) {
       
   169 			mSwitchToDayViewAction->setVisible(false);
       
   170 		}
       
   171 	}
       
   172     // Initialize the content widget
   166     // Initialize the content widget
   173     mAgendaViewWidget->showWidget();
   167     mAgendaViewWidget->showWidget();
   174     
   168     
   175 	//set Current Activity as day view
   169 	//set Current Activity as day view
   176     mActivityId = ECalenAgendaView;
   170     mActivityId = ECalenAgendaView;
   238     OstTraceFunctionEntry0( CALENAGENDAVIEW_GESTUREEVENT_ENTRY );
   232     OstTraceFunctionEntry0( CALENAGENDAVIEW_GESTUREEVENT_ENTRY );
   239     
   233     
   240     if(HbSwipeGesture *gesture = qobject_cast<HbSwipeGesture *>(event->gesture(Qt::SwipeGesture))) {
   234     if(HbSwipeGesture *gesture = qobject_cast<HbSwipeGesture *>(event->gesture(Qt::SwipeGesture))) {
   241         if (gesture->state() == Qt::GestureStarted) {
   235         if (gesture->state() == Qt::GestureStarted) {
   242             if(QSwipeGesture::Left == gesture->sceneHorizontalDirection()) {
   236             if(QSwipeGesture::Left == gesture->sceneHorizontalDirection()) {
   243                 mServices.IssueCommandL(ECalenShowNextDay);
   237                 // Check if we can swipe
       
   238                 if (checkIfWeCanSwipe(mDate, false)) {
       
   239                     mServices.IssueCommandL(ECalenShowNextDay);
       
   240                 }
   244                 event->accept(Qt::SwipeGesture);
   241                 event->accept(Qt::SwipeGesture);
   245             } else if(QSwipeGesture::Right == gesture->sceneHorizontalDirection()) {
   242             } else if(QSwipeGesture::Right == gesture->sceneHorizontalDirection()) {
   246                 mServices.IssueCommandL(ECalenShowPrevDay);
   243                 // Check if we can swipe
       
   244                 if (checkIfWeCanSwipe(mDate, true)) {
       
   245                     mServices.IssueCommandL(ECalenShowPrevDay);
       
   246                 }
   247                event->accept(Qt::SwipeGesture);
   247                event->accept(Qt::SwipeGesture);
   248             }
   248             }
   249         }
   249         }
   250     } 
   250     } 
   251     
   251