From: Amith Kumar Mahale Date: Tue, 11 Jun 2013 12:22:00 +0000 (+0530) Subject: Fix for N_SE-40886 N_SE-39204 X-Git-Tag: submit/tizen_2.2/20130714.134303~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da2dbf01a6d460a9ebfb8cd79e300676797c4a21;p=apps%2Fosp%2FCalendar.git Fix for N_SE-40886 N_SE-39204 Change-Id: Ie65dc3246cc7eda4bbae4a9b68cf0a65de5a2749 Signed-off-by: Amith Kumar Mahale --- diff --git a/inc/ClEventPresentationModel.h b/inc/ClEventPresentationModel.h index aebfaf6..de93de4 100644 --- a/inc/ClEventPresentationModel.h +++ b/inc/ClEventPresentationModel.h @@ -30,7 +30,8 @@ #include "ClICalendarEventChangedEventListener.h" class EventPresentationModel - : public virtual ICalendarAppStatusChangedEventListener + : public virtual Tizen::Social::ICalendarbookEventListener + , public virtual ICalendarAppStatusChangedEventListener { public: result Construct(const Tizen::Social::RecordId eventId = Tizen::Social::INVALID_RECORD_ID); @@ -63,6 +64,7 @@ public: bool IsSaved(void) const; bool IsEditable(void) const; bool IsRecurring(void) const; + bool IsEventValid(void) const; result RemoveEvent(bool deleteOriginal = true); result SetCalendar(const Tizen::Social::RecordId calendarId); @@ -90,6 +92,9 @@ public: virtual void OnForeground(void); virtual void OnBackground(void); + virtual void OnCalendarEventsChanged(const Tizen::Base::Collection::IList& eventChangeInfoList); + virtual void OnCalendarTodosChanged(const Tizen::Base::Collection::IList& todoChangeInfoList); + private: void FireCalendarEventChangedEvent(void); diff --git a/src/ClEventDetailsForm.cpp b/src/ClEventDetailsForm.cpp index 150f1e1..6271aa1 100644 --- a/src/ClEventDetailsForm.cpp +++ b/src/ClEventDetailsForm.cpp @@ -665,7 +665,23 @@ EventDetailsForm::OnActionPerformed(const Control& source, int actionId) void EventDetailsForm::OnCalendarEventChanged(void) { - __pTableView->UpdateTableView(); + if(__pPm->IsEventValid() == false) + { + if(__pThreeButtonPopup != null && __pThreeButtonPopup->GetShowState() == true) + { + __pThreeButtonPopup->SetShowState(false); + } + if(__pTwoButtonPopup != null && __pTwoButtonPopup->GetShowState() == true) + { + __pTwoButtonPopup->SetShowState(false); + } + SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT)); + + } + else + { + __pTableView->UpdateTableView(); + } } TableViewItem* diff --git a/src/ClEventPresentationModel.cpp b/src/ClEventPresentationModel.cpp index 6f0ab2a..50a6800 100644 --- a/src/ClEventPresentationModel.cpp +++ b/src/ClEventPresentationModel.cpp @@ -69,7 +69,7 @@ result EventPresentationModel::Construct(const RecordId eventId) { __pCalendarbook = new (std::nothrow) Calendarbook(); - __pCalendarbook->Construct(); + __pCalendarbook->Construct(*this); result r = SetEventId(eventId); TryCatch(r == E_SUCCESS, , "[%s] Unable to construct EventPresentationModel.", GetErrorMessage(r)); @@ -152,6 +152,7 @@ EventPresentationModel::GetEventId(void) const return __pEventInstance->GetOriginalEventId(); } return __pEvent->GetRecordId(); + } String @@ -979,3 +980,31 @@ EventPresentationModel::FireCalendarEventChangedEvent(void) delete pEnum; } } + +bool +EventPresentationModel::IsEventValid(void) const +{ + + CalEvent* pEvent = __pCalendarbook->GetEventN(__pEvent->GetRecordId()); + if (pEvent) + { + delete pEvent; + return true; + } + else + { + return false; + } +} + +void +EventPresentationModel::OnCalendarEventsChanged(const IList& eventChangeInfoList) +{ + FireCalendarEventChangedEvent(); +} + +void +EventPresentationModel::OnCalendarTodosChanged(const IList& todoChangeInfoList) +{ + +} diff --git a/src/ClMonthPanel.cpp b/src/ClMonthPanel.cpp index 4187c9b..f7c7a0f 100644 --- a/src/ClMonthPanel.cpp +++ b/src/ClMonthPanel.cpp @@ -1071,6 +1071,7 @@ MonthPanel::OnDateFocused(const DateTime& focusedDate) AppLogDebug("focusedDate: %ls", focusedDate.ToString().GetPointer()); DateTime adjustFocusedDate = focusedDate; adjustFocusedDate.AddMonths(__pPm->GetCurrentMonth() - adjustFocusedDate.GetMonth()); + adjustFocusedDate.AddYears(__pPm->GetCurrentYear() - adjustFocusedDate.GetYear()); AppLogDebug("adjustFocusedDate: %ls", adjustFocusedDate.ToString().GetPointer()); __pPm->SetCurrentDate(adjustFocusedDate); __pListViewEvent->UpdateList();