Resolved issue N_SE-39048
authorChangyong Jeon <fin10.jeon@samsung.com>
Mon, 20 May 2013 13:45:53 +0000 (22:45 +0900)
committerChangyong Jeon <fin10.jeon@samsung.com>
Mon, 20 May 2013 13:45:53 +0000 (22:45 +0900)
Change-Id: I350a42d26b76a4ebab125af30e1fe056d5c21b9d

inc/ClDayPanel.h
inc/ClGoToDatePopup.h
inc/ClListPanel.h
inc/ClMonthPanel.h
inc/ClTypes.h
inc/ClYearPanel.h
src/ClDayPanel.cpp
src/ClGoToDatePopup.cpp
src/ClListPanel.cpp
src/ClMonthPanel.cpp
src/ClYearPanel.cpp

index 25e7d69..214c2d3 100644 (file)
@@ -27,6 +27,7 @@
 #include <FSocial.h>
 #include <FUi.h>
 
+#include "ClGoToDatePopup.h"
 #include "ClICalendarEventChangedEventListener.h"
 #include "ClICurrentDateChangedEventListener.h"
 #include "ClIDateFocusEventListener.h"
@@ -89,6 +90,7 @@ private:
        EventListPresentationModel* __pPm;
        Tizen::Ui::Controls::Panel* __pPanelDayEvent[VIEW_SCROLL_EFFECT_COUNT];
        PanningAnimationManager* __pPanningAnimationManager;
+       GoToDatePopup* __pGoToDatePopup;
 }; // DayPanel
 
 #endif // _CL_DAY_PANEL_H_
index 70ec480..e3a88e0 100644 (file)
@@ -30,17 +30,17 @@ class GoToDatePopup
        , public virtual Tizen::Ui::IActionEventListener
 {
 public:
+       GoToDatePopup(void);
+       virtual ~GoToDatePopup(void);
+
+       result Initialize(void);
+       void RequestPopup(const Tizen::Base::DateTime& initialDate, Tizen::Ui::Control* pTarget);
+
        virtual result OnInitializing(void);
        virtual result OnTerminating(void);
 
        virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
 
-       static void RequestGoToDate(const Tizen::Base::DateTime& initialDate, Tizen::Ui::Control* pTarget);
-
-private:
-       GoToDatePopup(void);
-       virtual ~GoToDatePopup(void);
-
 private:
        Tizen::Base::DateTime __date;
        Tizen::Ui::Controls::EditDate* __pEditDate;
index deea348..fe7a278 100644 (file)
@@ -27,6 +27,7 @@
 #include <FLocales.h>
 #include <FUi.h>
 
+#include "ClGoToDatePopup.h"
 #include "ClICalendarEventChangedEventListener.h"
 #include "ClICurrentDateChangedEventListener.h"
 
@@ -95,6 +96,7 @@ private:
        SharePopup* __pSharePopup;
        ThreeButtonPopup* __pThreeButtonPopup;
        TwoButtonPopup* __pTwoButtonPopup;
+       GoToDatePopup* __pGoToDatePopup;
 }; // ListPanel
 
 #endif // _CL_LIST_PANEL_H_
index 2986e7e..87e11cc 100644 (file)
@@ -26,6 +26,7 @@
 #include <FSocial.h>
 #include <FUi.h>
 
+#include "ClGoToDatePopup.h"
 #include "ClICalendarEventChangedEventListener.h"
 #include "ClICurrentDateChangedEventListener.h"
 #include "ClIDateFocusEventListener.h"
@@ -102,6 +103,7 @@ private:
        SharePopup* __pSharePopup;
        ThreeButtonPopup* __pThreeButtonPopup;
        TwoButtonPopup* __pTwoButtonPopup;
+       GoToDatePopup* __pGoToDatePopup;
 }; // MonthPanel
 
 #endif // _CL_MONTH_PANEL_H_
index 43e1226..51459ba 100644 (file)
@@ -370,6 +370,7 @@ enum
        IDA_SUB_MENU_SETTING = 10405,
 
        IDA_GO_TO_DATE_POPUP_DONE = 10801,
+       IDA_GO_TO_DATE_POPUP_CANCEL = 10902,
 
        IDA_EVENT_POPUP_DELETE = 10901,
 
index 7b2dbfd..dd31724 100644 (file)
@@ -26,6 +26,7 @@
 #include <FGraphics.h>
 #include <FUi.h>
 
+#include "ClGoToDatePopup.h"
 #include "ClICurrentDateChangedEventListener.h"
 #include "ClIDateFocusEventListener.h"
 #include "ClIPanningAnimationControlProvider.h"
@@ -84,6 +85,7 @@ private:
        Tizen::Graphics::Bitmap* __pBitmapHolidayText[YEAR_PANEL_COUNT_OF_DAY];
        Tizen::Graphics::Bitmap* __pBitmapTodayText[YEAR_PANEL_COUNT_OF_DAY];
        Tizen::Graphics::Bitmap* __pBitmapFocus;
+       GoToDatePopup* __pGoToDatePopup;
 }; // YearPanel
 
 #endif // _CL_YEAR_PANEL_H_
index 5897a57..9d01b3d 100644 (file)
@@ -1103,6 +1103,7 @@ DayEventPanel::CollapseAllDayEventList(void)
 DayPanel::DayPanel(void)
        : __pPm(null)
        , __pPanningAnimationManager(null)
+       , __pGoToDatePopup(null)
 {
        memset((void *)__pPanelDayEvent, 0, sizeof(Panel*) * VIEW_SCROLL_EFFECT_COUNT);
 }
@@ -1146,6 +1147,9 @@ DayPanel::OnInitializing(void)
        pPanel->SetScrollEventListener(*this);
        __pPanelDayEvent[VIEW_SCROLL_EFFECT_CURRENT] = pPanel;
 
+       __pGoToDatePopup = new (std::nothrow) GoToDatePopup();
+       __pGoToDatePopup->Initialize();
+
        return E_SUCCESS;
 }
 
@@ -1155,6 +1159,12 @@ DayPanel::OnTerminating(void)
        AppLogDebug("Enter");
        __pPm->RemoveCalendarEventChangedEventListener(*this);
        __pPm->RemoveCurrentDateChangedEventListener(*this);
+
+       if (__pGoToDatePopup)
+       {
+               __pGoToDatePopup->Destroy();
+       }
+
        return E_SUCCESS;
 }
 
@@ -1168,7 +1178,7 @@ DayPanel::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
                __pPm->SetTodayToCurrentDate();
                break;
        case IDA_SUB_MENU_GO_TO_DATE:
-               GoToDatePopup::RequestGoToDate(__pPm->GetCurrentDate(), this);
+               __pGoToDatePopup->RequestPopup(__pPm->GetCurrentDate(), this);
                break;
        case IDA_MAIN_FORM_FOOTER_CREATE:
        {
index b41c546..4f2c730 100644 (file)
@@ -33,8 +33,6 @@ using namespace Tizen::Social;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 
-static const int IDA_GO_TO_DATE_POPUP_CANCEL = 10902;
-
 GoToDatePopup::GoToDatePopup(void)
        : __pEditDate(null)
        , __pTarget(null)
@@ -46,10 +44,25 @@ GoToDatePopup::~GoToDatePopup(void)
 }
 
 result
+GoToDatePopup::Initialize(void)
+{
+       return Construct(L"IDL_GO_TO_DATE_POPUP");
+}
+
+void
+GoToDatePopup::RequestPopup(const DateTime& initialDate, Control* pTarget)
+{
+       __date = initialDate;
+       __pTarget = pTarget;
+
+       SetShowState(true);
+       Show();
+}
+
+result
 GoToDatePopup::OnInitializing(void)
 {
        __pEditDate = dynamic_cast<EditDate*>(GetControl(L"IDC_EDITDATE"));
-       AppAssertf(__pEditDate != null, "[E_FAILURE] Unable to get button.");
        __pEditDate->SetYearRange(Calendarbook::GetMinDateTime().GetYear() + 1, Calendarbook::GetMaxDateTime().GetYear() - 1);
        __pEditDate->SetDate(__date);
 
@@ -60,12 +73,10 @@ GoToDatePopup::OnInitializing(void)
        SetTitleText(title);
 
        Button* pButtonDone = dynamic_cast<Button*>(GetControl(L"IDC_BUTTON_DONE"));
-       AppAssertf(pButtonDone != null, "[E_FAILURE] Unable to get button.");
        pButtonDone->SetActionId(IDA_GO_TO_DATE_POPUP_DONE);
        pButtonDone->AddActionEventListener(*this);
 
        Button* pButtonCancel = dynamic_cast<Button*>(GetControl(L"IDC_BUTTON_CANCEL"));
-       AppAssertf(pButtonCancel != null, "[E_FAILURE] Unable to get button.");
        pButtonCancel->SetActionId(IDA_GO_TO_DATE_POPUP_CANCEL);
        pButtonCancel->AddActionEventListener(*this);
 
@@ -85,28 +96,16 @@ GoToDatePopup::OnActionPerformed(const Control& source, int actionId)
        {
        case IDA_GO_TO_DATE_POPUP_DONE:
                __date = __pEditDate->GetDate();
-               SetShowState(false);
-               if (__pTarget != null)
+               if (__pTarget)
                {
                        LinkedList* pArgs = new (std::nothrow) LinkedList();
                        pArgs->Add(new (std::nothrow) DateTime(__date));
                        __pTarget->SendUserEvent(IDA_GO_TO_DATE_POPUP_DONE, pArgs);
                }
-               delete this;
+               SetShowState(false);
                break;
        case IDA_GO_TO_DATE_POPUP_CANCEL:
                SetShowState(false);
-               delete this;
                break;
        }
 }
-
-void
-GoToDatePopup::RequestGoToDate(const DateTime& initialDate, Control* pTarget)
-{
-       GoToDatePopup* pPopup = new (std::nothrow) GoToDatePopup();
-       pPopup->__date = initialDate;
-       pPopup->__pTarget = pTarget;
-       pPopup->Construct(L"IDL_GO_TO_DATE_POPUP");
-       pPopup->Show();
-}
index 4b455c1..c244931 100644 (file)
@@ -81,6 +81,7 @@ ListPanel::ListPanel(void)
        , __pSharePopup(null)
        , __pThreeButtonPopup(null)
        , __pTwoButtonPopup(null)
+       , __pGoToDatePopup(null)
 {
 }
 
@@ -132,6 +133,9 @@ ListPanel::OnInitializing(void)
        __pTwoButtonPopup = new (std::nothrow) TwoButtonPopup();
        __pTwoButtonPopup->Initialize();
 
+       __pGoToDatePopup = new (std::nothrow) GoToDatePopup();
+       __pGoToDatePopup->Initialize();
+
        return E_SUCCESS;
 }
 
@@ -144,9 +148,23 @@ ListPanel::OnTerminating(void)
        delete __pContextItem;
        delete __pContextItemNoEdit;
        delete __pDateFormatter;
-       delete __pSharePopup;
-       delete __pThreeButtonPopup;
-       delete __pTwoButtonPopup;
+
+       if (__pSharePopup)
+       {
+               __pSharePopup->Destroy();
+       }
+       if (__pThreeButtonPopup)
+       {
+               __pThreeButtonPopup->Destroy();
+       }
+       if (__pTwoButtonPopup)
+       {
+               __pTwoButtonPopup->Destroy();
+       }
+       if (__pGoToDatePopup)
+       {
+               __pGoToDatePopup->Destroy();
+       }
 
        return E_SUCCESS;
 }
@@ -184,7 +202,7 @@ ListPanel::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
        }
                break;
        case IDA_SUB_MENU_GO_TO_DATE:
-               GoToDatePopup::RequestGoToDate(__pPm->GetCurrentDate(), this);
+               __pGoToDatePopup->RequestPopup(__pPm->GetCurrentDate(), this);
                break;
        case IDA_SUB_MENU_DELETE:
                SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_EVENT_DELETER,
index 5ec059f..58d727a 100644 (file)
@@ -645,6 +645,7 @@ MonthPanel::MonthPanel(void)
        , __pSharePopup(null)
        , __pThreeButtonPopup(null)
        , __pTwoButtonPopup(null)
+       , __pGoToDatePopup(null)
 {
        memset((void *)__pPanelMonthCalendar, 0, sizeof(Panel*) * VIEW_SCROLL_EFFECT_COUNT);
 }
@@ -726,6 +727,9 @@ MonthPanel::OnInitializing(void)
        __pTwoButtonPopup = new (std::nothrow) TwoButtonPopup();
        __pTwoButtonPopup->Initialize();
 
+       __pGoToDatePopup = new (std::nothrow) GoToDatePopup();
+       __pGoToDatePopup->Initialize();
+
        return E_SUCCESS;
 }
 
@@ -747,6 +751,10 @@ MonthPanel::OnTerminating(void)
        {
                __pTwoButtonPopup->Destroy();
        }
+       if (__pGoToDatePopup)
+       {
+               __pGoToDatePopup->Destroy();
+       }
 
        delete __pContextItem;
        delete __pContextItemNoEdit;
@@ -763,7 +771,7 @@ MonthPanel::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
                __pPm->SetTodayToCurrentDate();
                break;
        case IDA_SUB_MENU_GO_TO_DATE:
-               GoToDatePopup::RequestGoToDate(__pPm->GetCurrentDate(), this);
+               __pGoToDatePopup->RequestPopup(__pPm->GetCurrentDate(), this);
                break;
        case IDA_MAIN_FORM_FOOTER_CREATE:
        {
index 2074eaa..5030066 100644 (file)
@@ -322,6 +322,7 @@ YearPanel::YearPanel(void)
        : __pPm(null)
        , __pPanningAnimationManager(null)
        , __pBitmapFocus(null)
+       , __pGoToDatePopup(null)
 {
        memset((void *)__pPanelYearCalendar, 0, sizeof(Panel*) * VIEW_SCROLL_EFFECT_COUNT);
        memset((void *)__pBitmapWeekText, 0, sizeof(Bitmap*) * YEAR_PANEL_COUNT_OF_WEEK);
@@ -371,6 +372,9 @@ YearPanel::OnInitializing(void)
        pCalendarPanel->SetDateFocusEventListener(*this);
        __pPanelYearCalendar[VIEW_SCROLL_EFFECT_CURRENT] = pCalendarPanel;
 
+       __pGoToDatePopup = new (std::nothrow) GoToDatePopup();
+       __pGoToDatePopup->Initialize();
+
        return E_SUCCESS;
 }
 
@@ -391,6 +395,11 @@ YearPanel::OnTerminating(void)
        }
        delete __pBitmapFocus;
 
+       if (__pGoToDatePopup)
+       {
+               __pGoToDatePopup->Destroy();
+       }
+
        return E_SUCCESS;
 }
 
@@ -404,7 +413,7 @@ YearPanel::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
                __pPm->SetTodayToCurrentDate();
                break;
        case IDA_SUB_MENU_GO_TO_DATE:
-               GoToDatePopup::RequestGoToDate(__pPm->GetCurrentDate(), this);
+               __pGoToDatePopup->RequestPopup(__pPm->GetCurrentDate(), this);
                break;
        case IDA_MAIN_FORM_FOOTER_CREATE:
        {