Fix for N_SE-52218 N_SE-52137 N_SE-51981 N_SE-52184
authorAmith Kumar Mahale <amith.m@samsung.com>
Fri, 13 Sep 2013 13:30:49 +0000 (19:00 +0530)
committerAmith Kumar Mahale <amith.m@samsung.com>
Fri, 13 Sep 2013 13:34:04 +0000 (19:04 +0530)
Change-Id: I162f45f18da1c555428e22ca9b2a510f40866f51
Signed-off-by: Amith Kumar Mahale <amith.m@samsung.com>
inc/ClListPanel.h
inc/ClReminderForm.h
src/ClEventEditorForm.cpp
src/ClEventPresentationModel.cpp
src/ClListPanel.cpp
src/ClReminderForm.cpp

index 4f6c9e0..b5e6af2 100644 (file)
@@ -90,6 +90,7 @@ public:
 
 private:
        result Update(void);
+       void RefreshGroups(int groupIndex);
 
 private:
        EventListPresentationModel* __pPm;
index eba3500..f034891 100644 (file)
@@ -111,6 +111,8 @@ private:
        Tizen::Base::String __customReminderTimeUnitText;
        Tizen::Base::String __customReminderTimeOffset;
        int __index;
+       bool __isKeypadOpen;
+       bool __showContextMenu;
 }; // ReminderForm
 
 #endif // _CL_REMINDER_FORM_H_
index 499cc3d..2d13be1 100644 (file)
@@ -852,11 +852,11 @@ EventEditorForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId
                                        __pPm->SetEndTime(end);
 
                                        SetStyle(EDIT_EVENT_FORM_STYLE_CREATE);
-
-                                       if (__pEditFieldTitle)
+                                       //Fix for N_SE-52137
+                                       /*if (__pEditFieldTitle)
                                        {
                                                __pEditFieldTitle->SetFocus();
-                                       }
+                                       }*/
                                }
                        }
                }
index 049794b..18aaf66 100644 (file)
@@ -881,11 +881,11 @@ EventPresentationModel::Update(void)
                }
                        break;
                case FREQ_MONTHLY:
-                       __pRecurrence->SetDayOfMonth(startUtcTime.GetDay());
+                       __pRecurrence->SetDayOfMonth(__startDateTime.GetDay());
                        break;
                case FREQ_YEARLY:
-                       __pRecurrence->SetDayOfMonth(startUtcTime.GetDay());
-                       __pRecurrence->SetMonthOfYear(startUtcTime.GetMonth());
+                       __pRecurrence->SetDayOfMonth(__startDateTime.GetDay());
+                       __pRecurrence->SetMonthOfYear(__startDateTime.GetMonth());
                        break;
                default:
                        break;
index 6dde875..9cc9148 100644 (file)
@@ -498,37 +498,12 @@ ListPanel::OnGroupedListViewItemStateChanged(GroupedListView& listView,
 
        if (groupIndex == 0)
        {
-               DateTime minRange = __pPm->GetViewMinRange();
-               minRange.AddMonths(PREVIOUS_DATE);
-               DateTime minDateTime = Calendarbook::GetMinDateTime();
-               minDateTime.AddYears(1);
-               if (minRange < minDateTime)
-               {
-                       minRange = minDateTime;
-               }
-
-               __pPm->SetViewType(VIEW_TYPE_LIST);
-               __pPm->SetViewRange(minRange, __pPm->GetViewMaxRange());
-
-               Update();
+               RefreshGroups(groupIndex);
                return;
        }
        else if (groupIndex == lastGroupIndex)
        {
-               DateTime maxRange = __pPm->GetViewMaxRange();
-               maxRange.AddMonths(NEXT_DATE);
-               DateTime maxDateTime = Calendarbook::GetMaxDateTime();
-               maxDateTime.AddYears(-1);
-               if (maxRange > maxDateTime)
-               {
-                       maxRange = maxDateTime;
-               }
-
-               __pPm->SetViewType(VIEW_TYPE_LIST);
-               __pPm->SetViewRange(__pPm->GetViewMinRange(), maxRange);
-
-               Update();
-
+               RefreshGroups(groupIndex);
                listView.ScrollToItem(listView.GetGroupCount() - 1, 0);
                listView.Invalidate(false);
                return;
@@ -707,13 +682,7 @@ ListPanel::OnCurrentDateChanged(const DateTime& currentDate, const DateTime& pre
 result
 ListPanel::Update(void)
 {
-       int initialcount = __pGroupedListViewEventsList->GetGroupCount();
        result r = __pGroupedListViewEventsList->UpdateList();
-       int finalcount = __pGroupedListViewEventsList->GetGroupCount();
-       if (initialcount != finalcount)
-       {
-               __pGroupedListViewEventsList->ExpandAllGroups();
-       }
 
        if (r == E_SUCCESS)
        {
@@ -725,3 +694,60 @@ ListPanel::Update(void)
 
        return r;
 }
+
+void
+ListPanel::RefreshGroups(int groupIndex)
+{
+       if (groupIndex == 0)
+               {
+                       DateTime startDate = __pPm->GetDateTimeFromGroupIndex(0);
+                       DateTime minRange = __pPm->GetViewMinRange();
+                       minRange.AddMonths(PREVIOUS_DATE);
+                       DateTime minDateTime = Calendarbook::GetMinDateTime();
+                       minDateTime.AddYears(1);
+                       if (minRange < minDateTime)
+                       {
+                               minRange = minDateTime;
+                       }
+
+                       __pPm->SetViewType(VIEW_TYPE_LIST);
+                       __pPm->SetViewRange(minRange, __pPm->GetViewMaxRange());
+                       int addedGroupCount = __pPm->GetGroupIndex(startDate);
+
+                       __pGroupedListViewEventsList->RefreshList(0, 0, LIST_REFRESH_TYPE_ITEM_MODIFY);
+                       for (int i = 0; i < addedGroupCount; ++i)
+                       {
+                               __pGroupedListViewEventsList->RefreshList(i + TOP_BOTTOM_ITEM_COUNT, -1, LIST_REFRESH_TYPE_ITEM_ADD);
+                       }
+                       if (__pGroupedListViewEventsList->IsGroupExpanded(GetGroupCount() - 1) == false)
+                       {
+                               __pGroupedListViewEventsList->ExpandGroup(GetGroupCount() - 1);
+                       }
+                       return;
+               }
+               else
+               {
+                       int prevGroupCount = __pPm->GetWholeDayCount();
+                       DateTime maxRange = __pPm->GetViewMaxRange();
+                       maxRange.AddMonths(NEXT_DATE);
+                       DateTime maxDateTime = Calendarbook::GetMaxDateTime();
+                       maxDateTime.AddYears(-1);
+                       if (maxRange > maxDateTime)
+                       {
+                               maxRange = maxDateTime;
+                       }
+
+                       __pPm->SetViewType(VIEW_TYPE_LIST);
+                       __pPm->SetViewRange(__pPm->GetViewMinRange(), maxRange);
+
+                       int groupCount = __pPm->GetWholeDayCount();
+
+                       for (int i = prevGroupCount; i < groupCount; ++i)
+                       {
+                               __pGroupedListViewEventsList->RefreshList(i + TOP_BOTTOM_ITEM_COUNT, -1, LIST_REFRESH_TYPE_ITEM_ADD);
+                       }
+                       __pGroupedListViewEventsList->RefreshList(__pGroupedListViewEventsList->GetGroupCount() - 1, 0, LIST_REFRESH_TYPE_ITEM_MODIFY);
+
+                       return;
+               }
+}
index b46f201..2e07c0f 100644 (file)
@@ -61,6 +61,8 @@ ReminderForm::ReminderForm(void)
        , __customReminderTimeUnit(REMINDER_TIME_UNIT_MINUTE)
        , __customReminderTimeUnitText(ResourceManager::GetString(IDS_TMR_OPT_MIN_LC_ABB))
        , __index(0)
+       ,__isKeypadOpen(false)
+       ,__showContextMenu(false)
 {
 }
 
@@ -587,11 +589,20 @@ ReminderForm::OnActionPerformed(const Control& source, int actionId)
        {
        case IDA_REMINDER_FORM_TIME_UNIT:
        {
-               Point point = __pButtonReminderTimeUnit->ConvertToScreenPosition(__pButtonReminderTimeUnit->GetPosition());
-               point.x -= __pButtonReminderTimeUnit->GetWidth();
-               __pContextMenuTimeUnitSelector->SetAnchorPosition(point);
-               __pContextMenuTimeUnitSelector->SetShowState(true);
-               __pContextMenuTimeUnitSelector->Show();
+               if(__isKeypadOpen == true)
+               {
+                       //should wait till it is closed
+                       __showContextMenu = true;
+                       SetFocus();
+               }
+               else
+               {
+                       Point point = __pButtonReminderTimeUnit->ConvertToScreenPosition(__pButtonReminderTimeUnit->GetPosition());
+                       point.x -= __pButtonReminderTimeUnit->GetWidth();
+                       __pContextMenuTimeUnitSelector->SetAnchorPosition(point);
+                       __pContextMenuTimeUnitSelector->SetShowState(true);
+                       __pContextMenuTimeUnitSelector->Show();
+               }
                break;
        }
        case REMINDER_TIME_UNIT_MINUTE:
@@ -639,23 +650,20 @@ ReminderForm::OnKeypadWillOpen(Tizen::Ui::Control& source)
 void
 ReminderForm::OnKeypadOpened(Tizen::Ui::Control& source)
 {
-       if (__pButtonReminderTimeUnit->IsVisible())
-       {
-               Point point = __pButtonReminderTimeUnit->ConvertToScreenPosition(__pButtonReminderTimeUnit->GetPosition());
-               point.x -= __pButtonReminderTimeUnit->GetWidth();
-               __pContextMenuTimeUnitSelector->SetAnchorPosition(point);
-               __pContextMenuTimeUnitSelector->Invalidate(false);
-       }
+       __isKeypadOpen = true;
 }
 void
 ReminderForm::OnKeypadClosed(Tizen::Ui::Control& source)
 {
-       if (__pButtonReminderTimeUnit->IsVisible())
+       __isKeypadOpen = false;
+       if(__showContextMenu == true)
        {
                Point point = __pButtonReminderTimeUnit->ConvertToScreenPosition(__pButtonReminderTimeUnit->GetPosition());
                point.x -= __pButtonReminderTimeUnit->GetWidth();
                __pContextMenuTimeUnitSelector->SetAnchorPosition(point);
-               __pContextMenuTimeUnitSelector->Invalidate(false);
+               __pContextMenuTimeUnitSelector->SetShowState(true);
+               __pContextMenuTimeUnitSelector->Show();
+               __showContextMenu = false;
        }
 }
 void