Fixed Nabi issues N_SE-49218, N_SE-49706
[apps/osp/Internet.git] / src / IntHistoryListForm.cpp
index 64bbc58..58cf0ae 100644 (file)
@@ -44,10 +44,10 @@ using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
 using namespace Tizen::System;
 
-static const wchar_t* IDB_TAB_ICON_BOOKMARKS = L"I01_tab_icon_bookmarks.png";
-static const wchar_t* IDB_TAB_ICON_HISTORY = L"I01_tab_icon_history.png";
-static const wchar_t* IDB_ICON_BOOKMARK_ON_TEMP = L"I01_icon_bookmark_on_temp.png";
-static const wchar_t* IDB_ICON_BOOKMARK_OFF_TEMP = L"I01_icon_bookmark_off_temp.png";
+static const wchar_t* IDB_TAB_ICON_BOOKMARKS =  L"I01_search_list_icon_favorite.png";
+static const wchar_t* IDB_TAB_ICON_HISTORY =L"I01_search_list_icon_history.png";
+static const wchar_t* IDB_ICON_BOOKMARK_ON_TEMP = L"00_icon_favorite_on_74x74.png";
+static const wchar_t* IDB_ICON_BOOKMARK_OFF_TEMP = L"00_icon_favorite_off_74x74.png";
 
 
 const int HistoryListForm::IDA_TABBAR_ITEM_1 = 101;
@@ -112,13 +112,20 @@ HistoryListForm::OnInitializing(void)
        Bitmap *pIconBitmap = null;
        AppResource* pAppResource = UiApp::GetInstance()->GetAppResource();
        const Color brown = Color(32, 32, 32, 0xFF);
-
+//     bool isHwBackButtonExist = false;
+//     Tizen::System::SystemInfo::GetValue(L"http:://tizen.org/feature/input.back.key",isHwBackButtonExist);
+//
+//     SetFormStyle(FORM_STYLE_INDICATOR | FORM_STYLE_HEADER | FORM_STYLE_FOOTER);
        // Setup back event listener
        SetFormBackEventListener(this);
 
        GetHeader()->AddActionEventListener(*this);
        GetFooter()->AddActionEventListener(*this);
 
+//     if(isHwBackButtonExist)
+//     {
+//             GetFooter()->SetBackButtonEnabled(false);
+//     }
        AddOrientationEventListener(*this);
        SettingInfo::AddSettingEventListener(*this);
 
@@ -128,6 +135,7 @@ HistoryListForm::OnInitializing(void)
                pSceneManager->AddSceneEventListener(IDSCN_HISTORY_LIST, *this);
        }
 
+       __fontSize = CommonUtil::GetFontSize();
        if (pAppResource == null)
        {
                return E_FAILURE;
@@ -151,6 +159,7 @@ HistoryListForm::OnInitializing(void)
        {
                return E_FAILURE;
        }
+       __pSearchBar->AddFocusEventListener(*this);
        __pSearchListView = new(std::nothrow) GroupedListView();
        if (__pSearchListView == null)
        {
@@ -268,9 +277,9 @@ HistoryListForm::OnActionPerformed(const Control& source, int actionId)
        break;
        case IDA_TABBAR_ITEM_1:
        {
-               result r = GetHeader()->SetItemSelected(1);
-               AppLog("SetItemSelected result %s",GetErrorMessage(r));
-               GetHeader()->Invalidate(true);
+       //      result r = GetHeader()->SetItemSelected(1);
+       //      AppLog("SetItemSelected result %s",GetErrorMessage(r));
+       //      GetHeader()->Invalidate(true);
 
                if (pSceneManager != null)
                {
@@ -284,20 +293,14 @@ HistoryListForm::OnActionPerformed(const Control& source, int actionId)
                        }
                        else
                        {
-
                                if(pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT))!= E_SUCCESS)
                                {
                                        AppLogDebug("BookmarkListForm::OnActionPerformed GoBackward failed");
                                        return;
                                }
-
                        }
                }
-//             r = pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
-               if (IsFailed(r))
-               {
-                       return;
-               }
+
        }
        break;
        default:
@@ -306,6 +309,18 @@ HistoryListForm::OnActionPerformed(const Control& source, int actionId)
 }
 
 void
+HistoryListForm::OnFocusGained(const Tizen::Ui::Control& source)
+{
+       __pSearchListView->SetEnabled(false);
+}
+
+void
+HistoryListForm::OnFocusLost(const Tizen::Ui::Control& source)
+{
+       __pSearchListView->SetEnabled(true);
+       __searchHistory = false;
+}
+void
 HistoryListForm::OnFormBackRequested(Form& source)
 {
        SceneManager* pSceneManager = SceneManager::GetInstance();
@@ -341,13 +356,13 @@ HistoryListForm::CreateGroupItem(int groupIndex, int itemWidth)
        GroupItemClass* pGroupItemClass = null;
 
        String weeksAgo2 = L"";
-       weeksAgo2.Format(25,CommonUtil::GetString(L"IDS_BR_BODY_PD_WEEKS_AGO").GetPointer(),2);
+       weeksAgo2.Format(25,CommonUtil::GetString(L"IDS_EMAIL_BODY_PD_WEEKS_AGO").GetPointer(),2);
 
        String weeksAgo3 = L"";
-       weeksAgo3.Format(25,CommonUtil::GetString(L"IDS_BR_BODY_PD_WEEKS_AGO").GetPointer(),3);
+       weeksAgo3.Format(25,CommonUtil::GetString(L"IDS_EMAIL_BODY_PD_WEEKS_AGO").GetPointer(),3);
 
        String weeksAgo4 = L"";
-       weeksAgo4.Format(25,CommonUtil::GetString(L"IDS_BR_BODY_PD_WEEKS_AGO").GetPointer(),4);
+       weeksAgo4.Format(25,CommonUtil::GetString(L"IDS_EMAIL_BODY_PD_WEEKS_AGO").GetPointer(),4);
 
        pItem = new(std::nothrow) GroupItem();
        if (pItem == null)
@@ -409,8 +424,10 @@ HistoryListForm::CreateGroupItem(int groupIndex, int itemWidth)
                                        return null;
                                }
                                dayOfWeek = pGregorianCalendar->GetTimeField(TIME_FIELD_DAY_OF_WEEK);
-
-                               delete pGregorianCalendar;
+                               if (pGregorianCalendar != NULL)
+                               {
+                                       delete pGregorianCalendar;
+                               }
 
                        }
                        switch(dayOfWeek)
@@ -457,8 +474,8 @@ HistoryListForm::CreateGroupItem(int groupIndex, int itemWidth)
 
 
 
-               if (pGroupItemClass->GetTitleText() == CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK") || pGroupItemClass->GetTitleText() == weeksAgo2
-                               || pGroupItemClass->GetTitleText() == weeksAgo3 || pGroupItemClass->GetTitleText() == weeksAgo4 || pGroupItemClass->GetTitleText() == CommonUtil::GetString(L"IDS_BR_EARLIER_THIS_MONTH") || pGroupItemClass->GetTitleText() == CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_MONTH") || pGroupItemClass->GetTitleText() == CommonUtil::GetString(L"IDS_BR_BODY_OLDER"))
+               if (pGroupItemClass->GetTitleText() == CommonUtil::GetString(L"IDS_BR_BODY_LAST_WEEK") || pGroupItemClass->GetTitleText() == weeksAgo2
+                               || pGroupItemClass->GetTitleText() == weeksAgo3 || pGroupItemClass->GetTitleText() == weeksAgo4 || pGroupItemClass->GetTitleText() == CommonUtil::GetString(L"IDS_BR_EARLIER_THIS_MONTH") || pGroupItemClass->GetTitleText() == CommonUtil::GetString(L"IDS_BR_BODY_LAST_MONTH") || pGroupItemClass->GetTitleText() == CommonUtil::GetString(L"IDS_BR_BODY_OLDER"))
                {
                        text.Append(L" - ");
                        text.Append(pGroupItemClass->GetEndTime().GetDay());
@@ -507,34 +524,40 @@ HistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
        if(__pGroupData == null)
        {
                delete pItem;
+               delete pImage;
                return null;
        }
 
        if (pItem == null)
        {
+               delete pImage;
                return null;
        }
        pGroupItemClass = dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex));
        if (pGroupItemClass == null)
        {
                delete pItem;
+               delete pImage;
                return null;
        }
        if (pGroupItemClass->GetHistoryData() == null)
        {
                delete pItem;
+               delete pImage;
                return null;
        }
        pHistory = dynamic_cast< History* >(pGroupItemClass->GetHistoryData()->GetAt(itemIndex));
        if (pHistory == null)
        {
                delete pItem;
+               delete pImage;
                return null;
        }
-       r = pItem->Construct(Dimension(itemWidth, 128), LIST_ANNEX_STYLE_NORMAL);
+       r = pItem->Construct(Dimension(itemWidth, 128 - 44 + __fontSize), LIST_ANNEX_STYLE_NORMAL);
        if (IsFailed(r))
        {
                delete pItem;
+               delete pImage;
                return null;
        }
 
@@ -565,29 +588,31 @@ HistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
        }
        if (pBitmap != null)
        {
-               r = pItem->AddElement(Rectangle(16, 28,72, 72), IDA_FORMAT_ICON, *pBitmap, null);
+               r = pItem->AddElement(Rectangle(16, 28 + (__fontSize - 44)/2,72, 72), IDA_FORMAT_ICON, *pBitmap, null);
                delete pBitmap;
                if (IsFailed(r))
                {
                        delete pItem;
+                       delete pImage;
                        AppLogException("CreateItem failed with %s", GetErrorMessage(r));
                        return null;
                }
        }
        bool urlFoundInBookmark = false;
-
-       if(__pBookmarkList != null)
-       {
-               for (int i = 0; i < __pBookmarkList->GetCount();i++)
-               {
-                       BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pBookmarkList->GetAt(i));
-                       if(pBookMark != null && pHistory->GetHistoryUrl().CompareTo(pBookMark->GetUrl()) == 0)
-                       {
-                               urlFoundInBookmark = true;
-                               break;
-                       }
-               }
-       }
+//
+//     if(__pBookmarkList != null)
+//     {
+//             for (int i = 0; i < __pBookmarkList->GetCount();i++)
+//             {
+//                     BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pBookmarkList->GetAt(i));
+//                     if(pBookMark != null && pHistory->GetHistoryUrl().CompareTo(pBookMark->GetUrl()) == 0)
+//                     {
+//                             urlFoundInBookmark = true;
+//                             break;
+//                     }
+//             }
+//     }
+       BookmarkPresentationModel::GetInstance()->DoesBookmarkExist(pHistory->GetHistoryUrl(),urlFoundInBookmark);
        if (urlFoundInBookmark == true)
        {
                pBookmarkBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_BOOKMARK_ON_TEMP);
@@ -596,20 +621,20 @@ HistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
        {
                pBookmarkBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_BOOKMARK_OFF_TEMP);
        }
-       bookmarkBtnWidth = 64;
+       bookmarkBtnWidth = 74;
 
 
-       r = pItem->AddElement(Rectangle(104, 10, GetClientAreaBounds().width - 108 - 32 - bookmarkBtnWidth - 32, 60), IDA_FORMAT_TITLE, pHistory->GetHistoryTitle(), 44,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true);
+       r = pItem->AddElement(Rectangle(104, 10, GetClientAreaBounds().width - 108 - 32 - bookmarkBtnWidth - 32, 60 - 44 + __fontSize), IDA_FORMAT_TITLE, pHistory->GetHistoryTitle(), __fontSize,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true);
        TryCatch(!IsFailed(r), "CreateItem failed with %s",GetErrorMessage(r));
 
 //     if(__pSearchBar->GetMode() == SEARCH_BAR_MODE_INPUT)
 //             r = pItem->AddElement(Rectangle(104, 70, GetClientAreaBounds().width - 108 - 32 - bookmarkBtnWidth - 32, 48), IDA_FORMAT_URL, pHistory->GetHistoryUrl(),32,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true);
 //     else
-               r = pItem->AddElement(Rectangle(104, 70, GetClientAreaBounds().width - 108 - 32 - bookmarkBtnWidth - 32, 48), IDA_FORMAT_URL, pHistory->GetHistoryUrl(),32,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,true);
+               r = pItem->AddElement(Rectangle(104, 70 - 44 +__fontSize, GetClientAreaBounds().width - 108 - 32 - bookmarkBtnWidth - 32, 48), IDA_FORMAT_URL, pHistory->GetHistoryUrl(),32,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,true);
        TryCatch(!IsFailed(r), "CreateItem failed with %s",GetErrorMessage(r));
        if ( pBookmarkBitmap != null)
        {
-               r = pItem->AddElement(Rectangle(GetClientAreaBounds().width - bookmarkBtnWidth - 16, (128 - pBookmarkBitmap->GetHeight())/2, bookmarkBtnWidth, bookmarkBtnWidth), IDA_FORMAT_BOOKMARK, *pBookmarkBitmap);
+               r = pItem->AddElement(Rectangle(GetClientAreaBounds().width - bookmarkBtnWidth - 16, (128 - pBookmarkBitmap->GetHeight())/2 +(__fontSize - 44)/2, bookmarkBtnWidth, bookmarkBtnWidth), IDA_FORMAT_BOOKMARK, *pBookmarkBitmap);
                TryCatch(!IsFailed(r), "CreateItem failed with %s",GetErrorMessage(r));
                delete pBookmarkBitmap;
        }
@@ -618,6 +643,7 @@ HistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
 
        CATCH:
        delete pItem;
+       delete pImage;
        return null;
 }
 
@@ -665,7 +691,13 @@ HistoryListForm::GetGroupCount(void)
                if (__searchHistory == false)
                {
                        int count = 0;
-                       HistoryPresentationModel::GetInstance()->GetHistoryCount(count);
+                       DateTime startTime;
+                       DateTime endTime;
+                       HistoryPresentationModel::GetCurrentDateTime(endTime);
+
+                       startTime.SetValue(0,0,0);
+
+                       HistoryPresentationModel::GetInstance()->GetHistoryCountWithTimeRange(startTime,endTime,count);
                        if (count == 0)
                        {
                                return 0;
@@ -675,6 +707,11 @@ HistoryListForm::GetGroupCount(void)
                else
                {
                        int count = 0;
+                       if (__searchText.GetLength() > 0)
+                       {
+                               __searchText.Replace(L"%", L"/%");
+                               __searchText.Replace(L"_", L"/_");
+                       }
                //      String searchText = __pSearchBar->GetText();
                        result r = HistoryPresentationModel::GetInstance()->GetSearchHistoryCount(count, __searchText);
                        if(count)
@@ -819,7 +856,12 @@ HistoryListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId
        }
 
        int count = 0;
-       HistoryPresentationModel::GetInstance()->GetHistoryCount(count);
+       DateTime startTime;
+       DateTime endTime;
+       HistoryPresentationModel::GetCurrentDateTime(endTime);;
+
+       startTime.SetValue(0,0,0);
+       HistoryPresentationModel::GetInstance()->GetHistoryCountWithTimeRange(startTime,endTime,count);
        if (count == 0)
        {
                __pSearchBar->SetShowState(false);
@@ -837,10 +879,10 @@ HistoryListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId
        //              __pGroupedListView->UpdateList();
        //      }
 
-       result r = GetHeader()->SetItemSelected(2);
+       result r = GetHeader()->SetItemSelected(1);
        if (IsFailed(r))
        {
-               AppLog("HistoryListForm::OnSceneActivatedN header failed %ls", GetErrorMessage(r));
+               AppLog("HistoryListForm::OnSceneActivatedN header failed %s", GetErrorMessage(r));
                return;
        }
 
@@ -889,18 +931,19 @@ HistoryListForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, in
 
                bool bookmarkFound = false;
                BookmarkData* pBookMark = null;
-               if(__pBookmarkList != null)
-               {
-                       for (int i = 0; i < __pBookmarkList->GetCount(); i++)
-                       {
-                               pBookMark = dynamic_cast< BookmarkData* >(__pBookmarkList->GetAt(i));
-                               if (pBookMark != null && toggledUrl.CompareTo(pBookMark->GetUrl()) == 0)
-                               {
-                                       bookmarkFound = true;
-                                       break;
-                               }
-                       }
-               }
+//             if(__pBookmarkList != null)
+//             {
+//                     for (int i = 0; i < __pBookmarkList->GetCount(); i++)
+//                     {
+//                             pBookMark = dynamic_cast< BookmarkData* >(__pBookmarkList->GetAt(i));
+//                             if (pBookMark != null && toggledUrl.CompareTo(pBookMark->GetUrl()) == 0)
+//                             {
+//                                     bookmarkFound = true;
+//                                     break;
+//                             }
+//                     }
+//             }
+               BookmarkPresentationModel::GetInstance()->DoesBookmarkExist(toggledUrl,bookmarkFound);
                if(bookmarkFound == false)
                {
                        // Add the history in bookmark database
@@ -912,7 +955,13 @@ HistoryListForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, in
                        bookmark.SetBookmarkTitle(bookmarkTitle);
                        bookmark.SetUrl(pHistory->GetHistoryUrl());
                        bookmark.SetFaviconId(pHistory->GetFaviconId());
-                       bookmark.SetFavIconBuffer(*pHistory->GetFavIconBuffer());
+                       if(pHistory->GetFavIconBuffer())
+                       {
+                               ByteBuffer *pBuffer = new ByteBuffer();
+
+                               pBuffer->Construct(*pHistory->GetFavIconBuffer());
+                               bookmark.SetFavIconBuffer(*pBuffer);
+                       }
                        //r = BookmarkPresentationModel::GetInstance()->SaveBookmark(pBookmark);
                        r = BookmarkPresentationModel::GetInstance()->SaveTempBookmark(bookmark);
                }
@@ -1082,13 +1131,13 @@ HistoryListForm::GetMonth(int month)
                monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_MAR"));
                break;
        case APRIL:
-               monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_APR"));
+               monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_APRIL"));
                break;
        case MAY:
                monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_MAY"));
                break;
        case JUNE:
-               monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_JUN"));
+               monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_JUNE"));
                break;
        case JULY:
                monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_JUL"));
@@ -1130,6 +1179,7 @@ HistoryListForm::OnKeypadActionPerformed(Control &source, KeypadAction keypadAct
                __pSearchListView->SetEnabled(true);
                __searchHistory = true;
                __searchText =__pSearchBar->GetText();
+               AppLog("SearchTextHistory %S errormsg %s",__searchText.GetPointer(),GetErrorMessage(GetLastResult()));
 
                r = __pGroupedListView->SetShowState(false);
                if (IsFailed(r))
@@ -1191,8 +1241,6 @@ HistoryListForm::OnOrientationChanged(const Control& source, OrientationStatus o
                {
                        return;
                }
-               __pGroupedListView->UpdateList();
-
                if (__pSearchListView != null)
                {
                        r = __pSearchListView->SetBounds(Rectangle(0,  0, GetClientAreaBounds().width, __pGroupedListView->GetHeight()));
@@ -1264,10 +1312,10 @@ HistoryListForm::CreateGroupItems()
        String titleText;
 
        String weeksAgo2 = L"";
-       weeksAgo2.Format(25,CommonUtil::GetString(L"IDS_BR_BODY_PD_WEEKS_AGO").GetPointer(),2);
+       weeksAgo2.Format(25,CommonUtil::GetString(L"IDS_EMAIL_BODY_PD_WEEKS_AGO").GetPointer(),2);
 
        String weeksAgo3 = L"";
-       weeksAgo3.Format(25,CommonUtil::GetString(L"IDS_BR_BODY_PD_WEEKS_AGO").GetPointer(),3);
+       weeksAgo3.Format(25,CommonUtil::GetString(L"IDS_EMAIL_BODY_PD_WEEKS_AGO").GetPointer(),3);
 
        if (__pGroupData != null)
        {
@@ -1294,7 +1342,7 @@ HistoryListForm::CreateGroupItems()
                {
                        return;
                }
-               titleText = CommonUtil::GetString(L"IDS_BR_BODY_SEARCHED_ITEMS");
+               titleText = CommonUtil::GetString(L"IDS_BR_BODY_SEARCH");
                pGroupItemClass->SetTitleText(titleText);
                r = __pGroupData->Add(*pGroupItemClass);
                if (IsFailed(r))
@@ -1338,7 +1386,7 @@ HistoryListForm::CreateGroupItems()
                        {
                                return;
                        }
-                       titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
+                       titleText = CommonUtil::GetString(L"IDS_BR_BODY_LAST_WEEK");
                        pGroupItemClass->SetTitleText(titleText);
                        dateTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
                        pGroupItemClass->SetEndTime(dateTime);
@@ -1353,7 +1401,7 @@ HistoryListForm::CreateGroupItems()
                        {
                                return;
                        }
-                       titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
+                       titleText = CommonUtil::GetString(L"IDS_BR_BODY_LAST_WEEK");
                        pGroupItemClass->SetTitleText(titleText);
                        dateTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
                        pGroupItemClass->SetEndTime(dateTime);
@@ -1382,7 +1430,7 @@ HistoryListForm::CreateGroupItems()
                        {
                                return;
                        }
-                       titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
+                       titleText = CommonUtil::GetString(L"IDS_BR_BODY_LAST_WEEK");
                        pGroupItemClass->SetTitleText(titleText);
                        dateTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
                        dateTime.AddDays(currentTime.GetDay() - 1 - 1);
@@ -1427,7 +1475,7 @@ HistoryListForm::CreateGroupItems()
                        {
                                return;
                        }
-                       titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
+                       titleText = CommonUtil::GetString(L"IDS_BR_BODY_LAST_WEEK");
                        pGroupItemClass->SetTitleText(titleText);
                        dateTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
                        dateTime.AddDays(currentTime.GetDay() - 2 - 1);
@@ -1487,7 +1535,7 @@ HistoryListForm::CreateGroupItems()
                        {
                                return;
                        }
-                       titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
+                       titleText = CommonUtil::GetString(L"IDS_BR_BODY_LAST_WEEK");
                        pGroupItemClass->SetTitleText(titleText);
                        dateTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
                        dateTime.AddDays(currentTime.GetDay() - 3 - 1);
@@ -1562,7 +1610,7 @@ HistoryListForm::CreateGroupItems()
                        {
                                return;
                        }
-                       titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
+                       titleText = CommonUtil::GetString(L"IDS_BR_BODY_LAST_WEEK");
                        pGroupItemClass->SetTitleText(titleText);
                        dateTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
                        dateTime.AddDays(currentTime.GetDay() - 4 - 1);
@@ -1652,7 +1700,7 @@ HistoryListForm::CreateGroupItems()
                        {
                                return;
                        }
-                       titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
+                       titleText = CommonUtil::GetString(L"IDS_BR_BODY_LAST_WEEK");
                        pGroupItemClass->SetTitleText(titleText);
                        dateTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
                        dateTime.AddDays(currentTime.GetDay() - 5 - 1);
@@ -1693,7 +1741,7 @@ HistoryListForm::CreateGroupItems()
                                        return;
                                }
                                String weeksAgo3 = L"";
-                               weeksAgo3.Format(25,CommonUtil::GetString(L"IDS_BR_BODY_PD_WEEKS_AGO").GetPointer(),3);
+                               weeksAgo3.Format(25,CommonUtil::GetString(L"IDS_EMAIL_BODY_PD_WEEKS_AGO").GetPointer(),3);
                                pGroupItemClass->SetTitleText(weeksAgo3);
                                dateTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
                                dateTime.AddDays(currentTime.GetDay() - 14 - dayOfWeek + 2 - 1);
@@ -1807,7 +1855,7 @@ HistoryListForm::CreateGroupItems()
                {
                        return;
                }
-               titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_MONTH");
+               titleText = CommonUtil::GetString(L"IDS_BR_BODY_LAST_MONTH");
                pGroupItemClass->SetTitleText(titleText);
                dateTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
                dateTime.AddDays(-1);