Fix for N_SE-40886 N_SE-39204
authorAmith Kumar Mahale <amith.m@samsung.com>
Tue, 11 Jun 2013 12:22:00 +0000 (17:52 +0530)
committerAmith Kumar Mahale <amith.m@samsung.com>
Tue, 11 Jun 2013 12:22:00 +0000 (17:52 +0530)
Change-Id: Ie65dc3246cc7eda4bbae4a9b68cf0a65de5a2749
Signed-off-by: Amith Kumar Mahale <amith.m@samsung.com>
inc/ClEventPresentationModel.h
src/ClEventDetailsForm.cpp
src/ClEventPresentationModel.cpp
src/ClMonthPanel.cpp

index aebfaf6..de93de4 100644 (file)
@@ -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);
 
index 150f1e1..6271aa1 100644 (file)
@@ -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*
index 6f0ab2a..50a6800 100644 (file)
@@ -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)
+{
+
+}
index 4187c9b..f7c7a0f 100644 (file)
@@ -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();