Add the Calendar-Selector Popup to view operation, and resolve N_SE-30280 issue.
authorSungWan Kim <sw0726.kim@samsung.com>
Wed, 27 Mar 2013 07:07:02 +0000 (16:07 +0900)
committerSungWan Kim <sw0726.kim@samsung.com>
Thu, 28 Mar 2013 00:58:01 +0000 (09:58 +0900)
Change-Id: I59eed452e70a6028b07de6d33fd8e63d00a9be3b
Signed-off-by: SungWan Kim <sw0726.kim@samsung.com>
23 files changed:
inc/ClCalendarSelectorPopup.h
inc/ClEventDeleterForm.h
inc/ClEventDetailsForm.h
inc/ClEventSearcherForm.h
inc/ClListPanel.h
inc/ClMonthPanel.h
inc/ClTaskDetailsForm.h
inc/ClThreeButtonPopup.h
inc/ClTwoButtonPopup.h
inc/ClTypes.h
src/ClCalendarSelectorPopup.cpp
src/ClDayPanel.cpp
src/ClEventDeleterForm.cpp
src/ClEventDetailsForm.cpp
src/ClEventEditorForm.cpp
src/ClEventPresentationModel.cpp
src/ClEventSearcherForm.cpp
src/ClListPanel.cpp
src/ClMonthPanel.cpp
src/ClSharePopup.cpp
src/ClTaskDetailsForm.cpp
src/ClThreeButtonPopup.cpp
src/ClTwoButtonPopup.cpp

index 60f3b20..19e76db 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <FBase.h>
 #include <FUi.h>
+#include "ClTypes.h"
 
 class CalendarSelectorPopup
        : public Tizen::Ui::Controls::Popup
@@ -33,7 +34,7 @@ class CalendarSelectorPopup
 {
 public:
        result Initialize(void);
-       void RequestCalendar(Tizen::Ui::Control* pTarget = null);
+       void RequestCalendar(CalendarSelectorPopupStyle style, Tizen::Ui::Control* pTarget = null);
 
        CalendarSelectorPopup(void);
        virtual ~CalendarSelectorPopup(void);
index 514ce79..3185fba 100755 (executable)
@@ -30,6 +30,7 @@
 #include "ClICalendarEventChangedEventListener.h"
 
 class EventListPresentationModel;
+class TwoButtonPopup;
 
 class EventDeleterForm
        : public Tizen::Ui::Controls::Form
@@ -96,6 +97,7 @@ private:
        Tizen::Ui::Controls::CheckButton* __pSelectBeforeToday;
        Tizen::Ui::Controls::Panel* __pPanel;
        Tizen::Ui::Controls::Label* __pLabel;
+       TwoButtonPopup* __pTwoButtonPopup;
        bool __topBottomItemEnabled;
 }; // EventDeleterForm
 
index 438ea1d..e2b9b73 100644 (file)
 #include <FGraphics.h>
 #include <FUi.h>
 
+class CalendarSelectorPopup;
 class EventPresentationModel;
 class SharePopup;
+class ThreeButtonPopup;
+class TwoButtonPopup;
 
 class EventDetailsForm
        : public Tizen::Ui::Controls::Form
@@ -87,14 +90,18 @@ private:
        Tizen::Ui::Controls::TableViewItem* CreateSaveToItemN(int itemWidth, const Tizen::Base::String& accountName,
                                                                                                                const Tizen::Base::String& calendarName,
                                                                                                                const Tizen::Graphics::Bitmap* pCalendarIcon = null);
-       result SendAppControlResult(Tizen::App::AppCtrlResult appControlResult);
        void InitializeSubMenu(void);
+       result SaveEvent(void);
+       result SendAppControlResult(Tizen::App::AppCtrlResult appControlResult);
 
 private:
        EventPresentationModel* __pPm;
        Tizen::Ui::Controls::SectionTableView* __pTableView;
        Tizen::Ui::Controls::ContextMenu* __pContextMenuSub;
+       CalendarSelectorPopup* __pCalendarSelectorPopup;
        SharePopup* __pSharePopup;
+       ThreeButtonPopup* __pThreeButtonPopup;
+       TwoButtonPopup* __pTwoButtonPopup;
 }; // EventDetailsForm
 
 #endif // _CL_EVENT_DETAILS_FORM_H_
index ec5c398..23736a3 100644 (file)
@@ -28,6 +28,8 @@
 
 class EventSearchPresentationModel;
 class SharePopup;
+class ThreeButtonPopup;
+class TwoButtonPopup;
 
 class EventSearcherForm
        : public Tizen::Ui::Controls::Form
@@ -94,6 +96,8 @@ private:
        Tizen::Ui::Controls::ListContextItem* __pContextItem;
        Tizen::Ui::Controls::ListContextItem* __pContextItemNoEdit;
        SharePopup* __pSharePopup;
+       ThreeButtonPopup* __pThreeButtonPopup;
+       TwoButtonPopup* __pTwoButtonPopup;
 };
 
 #endif // _CL_EVENT_SEARCHER_FORM_H_
index 82111f2..6e5e172 100644 (file)
@@ -32,6 +32,8 @@
 
 class EventListPresentationModel;
 class SharePopup;
+class ThreeButtonPopup;
+class TwoButtonPopup;
 
 class ListPanel
        : public Tizen::Ui::Controls::Panel
@@ -91,6 +93,8 @@ private:
        Tizen::Ui::Controls::ListContextItem* __pContextItemNoEdit;
        Tizen::Locales::DateTimeFormatter* __pDateFormatter;
        SharePopup* __pSharePopup;
+       ThreeButtonPopup* __pThreeButtonPopup;
+       TwoButtonPopup* __pTwoButtonPopup;
 }; // ListPanel
 
 #endif // _CL_LIST_PANEL_H_
index 6672aef..e7030d7 100644 (file)
@@ -35,6 +35,8 @@
 class EventListPresentationModel;
 class PanningAnimationManager;
 class SharePopup;
+class ThreeButtonPopup;
+class TwoButtonPopup;
 
 class MonthPanel
        : public Tizen::Ui::Controls::Panel
@@ -98,6 +100,8 @@ private:
        Tizen::Ui::Controls::ListContextItem* __pContextItemNoEdit;
        PanningAnimationManager* __pPanningAnimationManager;
        SharePopup* __pSharePopup;
+       ThreeButtonPopup* __pThreeButtonPopup;
+       TwoButtonPopup* __pTwoButtonPopup;
 }; // MonthPanel
 
 #endif // _CL_MONTH_PANEL_H_
index 9f65548..cc47440 100644 (file)
@@ -28,6 +28,8 @@
 #include <FSocial.h>
 #include <FUi.h>
 
+class CalendarSelectorPopup;
+
 class TaskDetailsForm
        : public Tizen::Ui::Controls::Form
        , public virtual Tizen::Ui::IActionEventListener
@@ -44,6 +46,7 @@ public:
 
        virtual result OnInitializing(void);
        virtual result OnTerminating(void);
+       virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
 
        virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
 
@@ -88,11 +91,13 @@ private:
        Tizen::Graphics::Bitmap* GetCalendarIconN(Tizen::Social::RecordId calendarId = Tizen::Social::INVALID_RECORD_ID) const;
        Tizen::Base::String GetCalendarName(Tizen::Social::RecordId calendarId = Tizen::Social::INVALID_RECORD_ID) const;
        Tizen::Base::String GetReminderString(const Tizen::Social::Reminder* pReminder = null) const;
+       result SaveTask(Tizen::Social::RecordId calendarId = Tizen::Social::INVALID_RECORD_ID);
        result SendAppControlResult(Tizen::App::AppCtrlResult appControlResult);
 
 private:
        Tizen::Social::CalTodo* __pTask;
        Tizen::Ui::Controls::SectionTableView* __pTableView;
+       CalendarSelectorPopup* __pCalendarSelectorPopup;
 }; // TaskDetailsForm
 
 #endif // _CL_TASK_DETAILS_FORM_H_
index 03b813c..5b12f39 100644 (file)
@@ -31,19 +31,21 @@ class ThreeButtonPopup
        , public virtual Tizen::Ui::IActionEventListener
 {
 public:
+       result Initialize(void);
+       void RequestPopup(ThreeButtonPopupStyle style, Tizen::Ui::Control* pTarget, const Tizen::Social::CalEventInstance* pEvent = null);
+
+       ThreeButtonPopup(void);
+       virtual ~ThreeButtonPopup(void);
+
        virtual result OnInitializing(void);
        virtual result OnTerminating(void);
 
        virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
 
-       static void RequestThreeButtonPopup(ThreeButtonPopupStyle style, Tizen::Ui::Control* pTarget, const Tizen::Social::CalEventInstance* pEvent = null);
-
-private:
-       ThreeButtonPopup(ThreeButtonPopupStyle style);
-       virtual ~ThreeButtonPopup(void);
-
 private:
-       ThreeButtonPopupStyle __style;
+       Tizen::Ui::Controls::Label* __pTitle;
+       Tizen::Ui::Controls::Button* __pButtonOnlyThis;
+       Tizen::Ui::Controls::Button* __pButtonAllEvents;
        Tizen::Ui::Control* __pTarget;
        Tizen::Social::CalEventInstance* __pEvent;
 }; // ThreeButtonPopup
index 1b2ce2c..1833eb8 100644 (file)
@@ -31,19 +31,19 @@ class TwoButtonPopup
        , public virtual Tizen::Ui::IActionEventListener
 {
 public:
+       result Initialize(void);
+       void RequestPopup(TwoButtonPopupStyle style, Tizen::Ui::Control* pTarget, const Tizen::Social::CalEventInstance* pEvent = null);
+
+       TwoButtonPopup(void);
+       virtual ~TwoButtonPopup(void);
+
        virtual result OnInitializing(void);
        virtual result OnTerminating(void);
 
        virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
 
-       static void RequestTwoButtonPopup(TwoButtonPopupStyle style, Tizen::Ui::Control* pTarget, const Tizen::Social::CalEventInstance* pEvent = null);
-
-private:
-       TwoButtonPopup(TwoButtonPopupStyle style);
-       virtual ~TwoButtonPopup(void);
-
 private:
-       TwoButtonPopupStyle __style;
+       Tizen::Ui::Controls::Label* __pTitle;
        Tizen::Ui::Control* __pTarget;
        Tizen::Social::CalEventInstance* __pEvent;
 }; // TwoButtonPopup
index 55991c4..71fc65e 100644 (file)
@@ -330,18 +330,23 @@ enum TaskPriority
        TASK_PRIORITY_HIGH
 };
 
+enum CalendarSelectorPopupStyle
+{
+       CALENDAR_SELECTOR_POPUP_STYLE_EVENT,
+       CALENDAR_SELECTOR_POPUP_STYLE_TODO,
+       CALENDAR_SELECTOR_POPUP_STYLE_ALL
+};
+
 enum ThreeButtonPopupStyle
 {
        THREE_BUTTON_POPUP_STYLE_EDIT,
-       THREE_BUTTON_POPUP_STYLE_DELETE,
-       THREE_BUTTON_POPUP_STYLE_NONE
+       THREE_BUTTON_POPUP_STYLE_DELETE
 };
 
 enum TwoButtonPopupStyle
 {
-       TWO_BUTTON_POPUP_STYLE_REPEATED_EVENT,
        TWO_BUTTON_POPUP_STYLE_SINGLE_EVENT,
-       TWO_BUTTON_POPUP_STYLE_NONE
+       TWO_BUTTON_POPUP_STYLE_REPEATED_EVENT
 };
 
 enum
index 1dff9c0..b4f4940 100644 (file)
@@ -24,7 +24,6 @@
 #include <FSocial.h>
 #include "ClCalendarSelectorPopup.h"
 #include "ClResourceManager.h"
-#include "ClTypes.h"
 
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
@@ -85,7 +84,7 @@ CalendarSelectorPopup::Initialize(void)
 }
 
 void
-CalendarSelectorPopup::RequestCalendar(Control* pTarget)
+CalendarSelectorPopup::RequestCalendar(CalendarSelectorPopupStyle style, Control* pTarget)
 {
        if (__pCalendars != null)
        {
@@ -97,7 +96,18 @@ CalendarSelectorPopup::RequestCalendar(Control* pTarget)
        calendarbook.Construct();
 
        CalendarbookFilter filter(CB_FI_TYPE_CALENDAR);
-       filter.AppendInt(FI_CONJ_OP_NONE, CALENDAR_FI_PR_ITEM_TYPE, FI_CMP_OP_EQUAL, CALENDAR_ITEM_TYPE_EVENT_ONLY);
+       switch (style)
+       {
+       case CALENDAR_SELECTOR_POPUP_STYLE_EVENT:
+               filter.AppendInt(FI_CONJ_OP_NONE, CALENDAR_FI_PR_ITEM_TYPE, FI_CMP_OP_EQUAL, CALENDAR_ITEM_TYPE_EVENT_ONLY);
+               break;
+       case CALENDAR_SELECTOR_POPUP_STYLE_TODO:
+               filter.AppendInt(FI_CONJ_OP_NONE, CALENDAR_FI_PR_ITEM_TYPE, FI_CMP_OP_EQUAL, CALENDAR_ITEM_TYPE_TODO_ONLY);
+               break;
+       case CALENDAR_SELECTOR_POPUP_STYLE_ALL:
+               filter.AppendInt(FI_CONJ_OP_NONE, CALENDAR_FI_PR_ITEM_TYPE, FI_CMP_OP_EQUAL, CALENDAR_ITEM_TYPE_EVENT_AND_TODO);
+               break;
+       }
 
        __pCalendars = calendarbook.SearchN(filter);
        TryReturnVoid(__pCalendars != null, "[E_FAILURE] Unable to get calendar list.");
index c9446d1..35da6c1 100644 (file)
@@ -627,6 +627,8 @@ DayEventPanel::OnInitializing(void)
 result
 DayEventPanel::OnTerminating(void)
 {
+       __pPanelDayEvents->RemoveScrollEventListener(*this);
+       __eventButtons.RemoveAll(false);
        return E_SUCCESS;
 }
 
index abea002..09eb79f 100755 (executable)
@@ -80,6 +80,7 @@ EventDeleterForm::EventDeleterForm(void)
        , __pSelectBeforeToday(null)
        , __pPanel(null)
        , __pLabel(null)
+       , __pTwoButtonPopup(null)
        , __topBottomItemEnabled(false)
 {
 }
@@ -134,6 +135,9 @@ EventDeleterForm::OnInitializing(void)
 
        __pDateFormatter = ResourceManager::CreateDateFormatterN(DATE_TIME_STYLE_SHORT);
 
+       __pTwoButtonPopup = new (std::nothrow) TwoButtonPopup();
+       __pTwoButtonPopup->Initialize();
+
        return E_SUCCESS;
 }
 
@@ -143,6 +147,7 @@ EventDeleterForm::OnTerminating(void)
        delete __pCalendarbook;
        delete __pDateFormatter;
        delete __pTimeFormatter;
+       delete __pTwoButtonPopup;
        __pPm->RemoveCalendarEventChangedEventListener(*this);
 
        return E_SUCCESS;
@@ -596,7 +601,7 @@ EventDeleterForm::OnActionPerformed(const Control& source, int actionId)
                        }
                }
 
-               TwoButtonPopup::RequestTwoButtonPopup(style, this);
+               __pTwoButtonPopup->RequestPopup(style, this);
                break;
        case IDA_SELECT_ALL_CHECKED:
                for (int i = startGroupIndex; i <= endGroupIndex; i++)
index 911cb28..a23e781 100644 (file)
@@ -23,6 +23,7 @@
 #include <string>
 #include <FSocial.h>
 #include "ClCalendarApp.h"
+#include "ClCalendarSelectorPopup.h"
 #include "ClEventDetailsForm.h"
 #include "ClEventPresentationModel.h"
 #include "ClResourceManager.h"
@@ -121,7 +122,10 @@ EventDetailsForm::EventDetailsForm(void)
        : __pPm(null)
        , __pTableView(null)
        , __pContextMenuSub(null)
+       , __pCalendarSelectorPopup(null)
        , __pSharePopup(null)
+       , __pThreeButtonPopup(null)
+       , __pTwoButtonPopup(null)
 {
 }
 
@@ -157,6 +161,12 @@ EventDetailsForm::OnInitializing(void)
        __pSharePopup = new (std::nothrow) SharePopup();
        __pSharePopup->Initialize();
 
+       __pThreeButtonPopup = new (std::nothrow) ThreeButtonPopup();
+       __pThreeButtonPopup->Initialize();
+
+       __pTwoButtonPopup = new (std::nothrow) TwoButtonPopup();
+       __pTwoButtonPopup->Initialize();
+
        return E_SUCCESS;
 }
 
@@ -164,7 +174,10 @@ result
 EventDetailsForm::OnTerminating(void)
 {
        delete __pPm;
+       delete __pCalendarSelectorPopup;
        delete __pSharePopup;
+       delete __pThreeButtonPopup;
+       delete __pTwoButtonPopup;
        return E_SUCCESS;
 }
 
@@ -215,6 +228,20 @@ EventDetailsForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
                }
                break;
        }
+       case IDA_CALENDAR_SELECTOR_POPUP_DONE:
+               if (pArgs != null)
+               {
+                       __pPm->SetCalendar(static_cast<Integer*>(pArgs->GetAt(0))->value);
+                       if (SaveEvent() == E_SUCCESS)
+                       {
+                               if (GetFooter() != null)
+                               {
+                                       GetFooter()->RemoveAllItems();
+                               }
+                               __pTableView->UpdateTableView();
+                       }
+               }
+               break;
        }
 
        if (pArgs != null)
@@ -446,6 +473,12 @@ EventDetailsForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneI
                        r = __pPm->SetVcsFile(*pPath);
                        TryCatch(r == E_SUCCESS, , "[E_FAILURE] Unable to parse events from vcs file.");
 
+                       if (__pCalendarSelectorPopup == null)
+                       {
+                               __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup();
+                               __pCalendarSelectorPopup->Initialize();
+                       }
+
                        if (GetFooter() != null)
                        {
                                Footer* pFooter = GetFooter();
@@ -507,6 +540,12 @@ EventDetailsForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneI
                        r = __pPm->SetVcsFile(pApp->GetUri());
                        TryCatch(r == E_SUCCESS, , "[E_FAILURE] Unable to parse events from vcs file.");
 
+                       if (__pCalendarSelectorPopup == null)
+                       {
+                               __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup();
+                               __pCalendarSelectorPopup->Initialize();
+                       }
+
                        if (GetFooter() != null)
                        {
                                Footer* pFooter = GetFooter();
@@ -554,7 +593,7 @@ EventDetailsForm::OnActionPerformed(const Control& source, int actionId)
        {
                if (__pPm->IsRecurring() == true)
                {
-                       ThreeButtonPopup::RequestThreeButtonPopup(THREE_BUTTON_POPUP_STYLE_EDIT, this);
+                       __pThreeButtonPopup->RequestPopup(THREE_BUTTON_POPUP_STYLE_EDIT, this);
                }
                else
                {
@@ -576,27 +615,33 @@ EventDetailsForm::OnActionPerformed(const Control& source, int actionId)
        {
                if (__pPm->IsRecurring() == true)
                {
-                       ThreeButtonPopup::RequestThreeButtonPopup(THREE_BUTTON_POPUP_STYLE_DELETE, this);
+                       __pThreeButtonPopup->RequestPopup(THREE_BUTTON_POPUP_STYLE_DELETE, this);
                }
                else
                {
-                       TwoButtonPopup::RequestTwoButtonPopup(TWO_BUTTON_POPUP_STYLE_SINGLE_EVENT, this);
+                       __pTwoButtonPopup->RequestPopup(TWO_BUTTON_POPUP_STYLE_SINGLE_EVENT, this);
                }
        }
                break;
        case IDA_EVENT_DETAILS_FORM_SHARE:
-//             SharePopup::RequestShare(__pPm->GetEventId());
                __pSharePopup->RequestShare(__pPm->GetEventId());
                break;
        case IDA_EVENT_DETAILS_FORM_ADD_TO_CALENDAR:
-               r = __pPm->Update();
-               TryReturnVoid(r == E_SUCCESS, "[%s] Unable to add event.", GetErrorMessage(r));
-
-               if (GetFooter() != null)
+               if (__pCalendarSelectorPopup != null)
                {
-                       GetFooter()->RemoveAllItems();
+                       __pCalendarSelectorPopup->RequestCalendar(CALENDAR_SELECTOR_POPUP_STYLE_EVENT, this);
+               }
+               else
+               {
+                       if (SaveEvent() == E_SUCCESS)
+                       {
+                               if (GetFooter() != null)
+                               {
+                                       GetFooter()->RemoveAllItems();
+                               }
+                               __pTableView->UpdateTableView();
+                       }
                }
-               __pTableView->UpdateTableView();
                break;
        default:
                break;
@@ -917,18 +962,6 @@ EventDetailsForm::CreateSaveToItemN(int itemWidth, const String& accountName, co
        return pItem;
 }
 
-result
-EventDetailsForm::SendAppControlResult(AppCtrlResult appControlResult)
-{
-       CalendarApp* pApp = static_cast<CalendarApp*>(UiApp::GetInstance());
-       TryReturn(pApp != null, E_FAILURE, "[E_FAILURE] Unable to get app instance.");
-
-       result r = AppControlProviderManager::GetInstance()->SendAppControlResult(pApp->GetRequestId(), appControlResult, null);
-       AppLogDebugIf(r != E_SUCCESS, "[%s] Unable to return result.", GetErrorMessage(r));
-
-       return r;
-}
-
 void
 EventDetailsForm::InitializeSubMenu(void)
 {
@@ -943,3 +976,29 @@ EventDetailsForm::InitializeSubMenu(void)
        __pContextMenuSub->AddItem(ResourceManager::GetString(IDS_COM_SK4_SHARE), IDA_EVENT_DETAILS_FORM_SHARE);
        __pContextMenuSub->SetShowState(false);
 }
+
+result
+EventDetailsForm::SendAppControlResult(AppCtrlResult appControlResult)
+{
+       CalendarApp* pApp = static_cast<CalendarApp*>(UiApp::GetInstance());
+       TryReturn(pApp != null, E_FAILURE, "[E_FAILURE] Unable to get app instance.");
+
+       result r = AppControlProviderManager::GetInstance()->SendAppControlResult(pApp->GetRequestId(), appControlResult, null);
+       AppLogDebugIf(r != E_SUCCESS, "[%s] Unable to return result.", GetErrorMessage(r));
+
+       return r;
+}
+
+result
+EventDetailsForm::SaveEvent(void)
+{
+       result r = __pPm->Update();
+       if (r != E_SUCCESS)
+       {
+               __pPm->Rollback();
+               AppLogDebug("[%s] Unable to add event.", GetErrorMessage(r));
+               return r;
+       }
+       __pPm->Commit();
+       return E_SUCCESS;
+}
index 1b5c5e5..9d4e43e 100644 (file)
@@ -586,6 +586,10 @@ EventEditorForm::GetSectionHeader(int sectionIndex)
 bool
 EventEditorForm::HasSectionHeader(int sectionIndex)
 {
+       if (sectionIndex == 0)
+       {
+               return false;
+       }
        return true;
 }
 
@@ -729,8 +733,7 @@ EventEditorForm::OnSectionTableViewItemStateChanged(SectionTableView& tableView,
        case GROUP_SAVE_TO:
                if (itemIndex == SAVE_TO_ITEM_SAVE_TO)
                {
-                       // Call SaveTo Popup.(Tizen 2.0 b1 RC1 APIs are not supported yet.)
-                       __pCalendarSelectorPopup->RequestCalendar(this);
+                       __pCalendarSelectorPopup->RequestCalendar(CALENDAR_SELECTOR_POPUP_STYLE_EVENT, this);
                }
                break;
        }
index 63d91e8..6b5dac1 100644 (file)
@@ -443,7 +443,7 @@ EventPresentationModel::IsAllEventEditing(void) const
 bool
 EventPresentationModel::IsSaved(void) const
 {
-       return __pEventInstance != null || __pEvent->GetCalendarId() != INVALID_RECORD_ID;
+       return __pEventInstance != null || __pEvent->GetRecordId() != INVALID_RECORD_ID;
 }
 
 bool
@@ -963,6 +963,14 @@ EventPresentationModel::Commit(void)
                __allEventEditing = true;
        }
 
+       if (__pCalendar == null || (__pCalendar != null && __pCalendar->GetRecordId() != __pEvent->GetCalendarId()))
+       {
+               Calendarbook calendarbook;
+               calendarbook.Construct();
+               delete __pCalendar;
+               __pCalendar = calendarbook.GetCalendarN(__pEvent->GetCalendarId());
+       }
+
        delete __pEventBackup;
        __pEventBackup = null;
        delete __pEventInstanceBackup;
index a0cf765..1751694 100644 (file)
@@ -64,6 +64,8 @@ EventSearcherForm::EventSearcherForm(void)
        , __pContextItem(null)
        , __pContextItemNoEdit(null)
        , __pSharePopup(null)
+       , __pThreeButtonPopup(null)
+       , __pTwoButtonPopup(null)
 {
 }
 
@@ -102,6 +104,12 @@ EventSearcherForm::OnInitializing(void)
        __pSharePopup = new (std::nothrow) SharePopup();
        __pSharePopup->Initialize();
 
+       __pThreeButtonPopup = new (std::nothrow) ThreeButtonPopup();
+       __pThreeButtonPopup->Initialize();
+
+       __pTwoButtonPopup = new (std::nothrow) TwoButtonPopup();
+       __pTwoButtonPopup->Initialize();
+
        return E_SUCCESS;
 }
 
@@ -112,6 +120,8 @@ EventSearcherForm::OnTerminating(void)
        delete __pContextItem;
        delete __pContextItemNoEdit;
        delete __pSharePopup;
+       delete __pThreeButtonPopup;
+       delete __pTwoButtonPopup;
        return E_SUCCESS;
 }
 
@@ -339,7 +349,7 @@ EventSearcherForm::OnGroupedListViewContextItemStateChanged(GroupedListView& lis
                case IDA_EVENT_SEARCHER_CONTEXT_MENU_EDIT:
                        if (pEventInstance->IsRecurring() == true)
                        {
-                               ThreeButtonPopup::RequestThreeButtonPopup(THREE_BUTTON_POPUP_STYLE_EDIT, this, pEventInstance);
+                               __pThreeButtonPopup->RequestPopup(THREE_BUTTON_POPUP_STYLE_EDIT, this, pEventInstance);
                        }
                        else
                        {
@@ -351,17 +361,16 @@ EventSearcherForm::OnGroupedListViewContextItemStateChanged(GroupedListView& lis
                        }
                        break;
                case IDA_EVENT_SEARCHER_CONTEXT_MENU_SHARE:
-//                     SharePopup::RequestShare(pEventInstance->GetOriginalEventId());
                        __pSharePopup->RequestShare(pEventInstance->GetOriginalEventId());
                        break;
                case IDA_EVENT_SEARCHER_CONTEXT_MENU_DELETE:
                        if (pEventInstance->IsRecurring() == true)
                        {
-                               ThreeButtonPopup::RequestThreeButtonPopup(THREE_BUTTON_POPUP_STYLE_DELETE, this, pEventInstance);
+                               __pThreeButtonPopup->RequestPopup(THREE_BUTTON_POPUP_STYLE_DELETE, this, pEventInstance);
                        }
                        else
                        {
-                               TwoButtonPopup::RequestTwoButtonPopup(TWO_BUTTON_POPUP_STYLE_SINGLE_EVENT, this, pEventInstance);
+                               __pTwoButtonPopup->RequestPopup(TWO_BUTTON_POPUP_STYLE_SINGLE_EVENT, this, pEventInstance);
                        }
                        break;
                }
index bbd743b..bf12979 100644 (file)
@@ -80,6 +80,8 @@ ListPanel::ListPanel(void)
        , __pContextItemNoEdit(null)
        , __pDateFormatter(null)
        , __pSharePopup(null)
+       , __pThreeButtonPopup(null)
+       , __pTwoButtonPopup(null)
 {
 }
 
@@ -125,6 +127,12 @@ ListPanel::OnInitializing(void)
        __pSharePopup = new (std::nothrow) SharePopup();
        __pSharePopup->Initialize();
 
+       __pThreeButtonPopup = new (std::nothrow) ThreeButtonPopup();
+       __pThreeButtonPopup->Initialize();
+
+       __pTwoButtonPopup = new (std::nothrow) TwoButtonPopup();
+       __pTwoButtonPopup->Initialize();
+
        return E_SUCCESS;
 }
 
@@ -138,6 +146,8 @@ ListPanel::OnTerminating(void)
        delete __pContextItemNoEdit;
        delete __pDateFormatter;
        delete __pSharePopup;
+       delete __pThreeButtonPopup;
+       delete __pTwoButtonPopup;
 
        return E_SUCCESS;
 }
@@ -480,7 +490,7 @@ ListPanel::OnGroupedListViewContextItemStateChanged(GroupedListView& listView,
                case IDA_LIST_PANEL_CONTEXT_MENU_EDIT:
                        if (pEventInstance->IsRecurring() == true)
                        {
-                               ThreeButtonPopup::RequestThreeButtonPopup(THREE_BUTTON_POPUP_STYLE_EDIT, this, pEventInstance);
+                               __pThreeButtonPopup->RequestPopup(THREE_BUTTON_POPUP_STYLE_EDIT, this, pEventInstance);
                        }
                        else
                        {
@@ -493,17 +503,16 @@ ListPanel::OnGroupedListViewContextItemStateChanged(GroupedListView& listView,
                        }
                        break;
                case IDA_LIST_PANEL_CONTEXT_MENU_SHARE:
-//                     SharePopup::RequestShare(__pPm->GetEventWithWholeIndex(groupIndex - (TOP_BOTTOM_GROUP_ITEM_COUNT / 2), itemIndex)->GetOriginalEventId());
                        __pSharePopup->RequestShare(__pPm->GetEventWithWholeIndex(groupIndex - (TOP_BOTTOM_GROUP_ITEM_COUNT / 2), itemIndex)->GetOriginalEventId());
                        break;
                case IDA_LIST_PANEL_CONTEXT_MENU_DELETE:
                        if (__pPm->GetEventWithWholeIndex(actualGroupIndex, itemIndex)->IsRecurring() == true)
                        {
-                               ThreeButtonPopup::RequestThreeButtonPopup(THREE_BUTTON_POPUP_STYLE_DELETE, this, pEventInstance);
+                               __pThreeButtonPopup->RequestPopup(THREE_BUTTON_POPUP_STYLE_DELETE, this, pEventInstance);
                        }
                        else
                        {
-                               TwoButtonPopup::RequestTwoButtonPopup(TWO_BUTTON_POPUP_STYLE_SINGLE_EVENT, this, pEventInstance);
+                               __pTwoButtonPopup->RequestPopup(TWO_BUTTON_POPUP_STYLE_SINGLE_EVENT, this, pEventInstance);
                        }
                        break;
                }
index 859145e..f32cce5 100644 (file)
@@ -670,6 +670,8 @@ MonthPanel::MonthPanel(void)
        , __pContextItemNoEdit(null)
        , __pPanningAnimationManager(null)
        , __pSharePopup(null)
+       , __pThreeButtonPopup(null)
+       , __pTwoButtonPopup(null)
 {
        memset((void *)__pPanelMonthCalendar, 0, sizeof(Panel*) * VIEW_SCROLL_EFFECT_COUNT);
 }
@@ -744,6 +746,12 @@ MonthPanel::OnInitializing(void)
        __pSharePopup = new (std::nothrow) SharePopup();
        __pSharePopup->Initialize();
 
+       __pThreeButtonPopup = new (std::nothrow) ThreeButtonPopup();
+       __pThreeButtonPopup->Initialize();
+
+       __pTwoButtonPopup = new (std::nothrow) TwoButtonPopup();
+       __pTwoButtonPopup->Initialize();
+
        return E_SUCCESS;
 }
 
@@ -756,6 +764,8 @@ MonthPanel::OnTerminating(void)
        delete __pContextItem;
        delete __pContextItemNoEdit;
        delete __pSharePopup;
+       delete __pThreeButtonPopup;
+       delete __pTwoButtonPopup;
        return E_SUCCESS;
 }
 
@@ -884,7 +894,7 @@ MonthPanel::OnListViewContextItemStateChanged(ListView& listView, int index, int
                case IDA_MONTH_PANEL_CONTEXT_MENU_EDIT:
                        if (pEvent->IsRecurring() == true)
                        {
-                               ThreeButtonPopup::RequestThreeButtonPopup(THREE_BUTTON_POPUP_STYLE_EDIT, this, pEvent);
+                               __pThreeButtonPopup->RequestPopup(THREE_BUTTON_POPUP_STYLE_EDIT, this, pEvent);
                        }
                        else
                        {
@@ -896,17 +906,16 @@ MonthPanel::OnListViewContextItemStateChanged(ListView& listView, int index, int
                        }
                        break;
                case IDA_MONTH_PANEL_CONTEXT_MENU_SHARE:
-//                     SharePopup::RequestShare(pEvent->GetOriginalEventId());
                        __pSharePopup->RequestShare(pEvent->GetOriginalEventId());
                        break;
                case IDA_MONTH_PANEL_CONTEXT_MENU_DELETE:
                        if (pEvent->IsRecurring() == true)
                        {
-                               ThreeButtonPopup::RequestThreeButtonPopup(THREE_BUTTON_POPUP_STYLE_DELETE, this, pEvent);
+                               __pThreeButtonPopup->RequestPopup(THREE_BUTTON_POPUP_STYLE_DELETE, this, pEvent);
                        }
                        else
                        {
-                               TwoButtonPopup::RequestTwoButtonPopup(TWO_BUTTON_POPUP_STYLE_SINGLE_EVENT, this, pEvent);
+                               __pTwoButtonPopup->RequestPopup(TWO_BUTTON_POPUP_STYLE_SINGLE_EVENT, this, pEvent);
                        }
                        break;
                }
index 947455a..3efa41a 100644 (file)
@@ -229,15 +229,5 @@ SharePopup::OnActionPerformed(const Control& source, int actionId)
        if (actionId == IDA_SHARE_POPUP_CLOSE)
        {
                SetShowState(false);
-//             delete this;
        }
 }
-
-//void
-//SharePopup::RequestShare(RecordId eventId)
-//{
-//     SharePopup* pPopup = new (std::nothrow) SharePopup();
-//     pPopup->__eventId = eventId;
-//     pPopup->Construct(L"IDL_SHARE_POPUP");
-//     pPopup->Show();
-//}
index a51201b..4ec5d20 100644 (file)
@@ -23,6 +23,7 @@
 #include <FGraphics.h>
 #include <FLocales.h>
 #include "ClCalendarApp.h"
+#include "ClCalendarSelectorPopup.h"
 #include "ClResourceManager.h"
 #include "ClTaskDetailsForm.h"
 #include "ClTypes.h"
@@ -112,6 +113,7 @@ static const int MAX_TITLE_TEXT = 20;
 TaskDetailsForm::TaskDetailsForm(void)
        : __pTask(null)
        , __pTableView(null)
+       , __pCalendarSelectorPopup(null)
 {
 }
 
@@ -146,10 +148,38 @@ result
 TaskDetailsForm::OnTerminating(void)
 {
        delete __pTask;
+       delete __pCalendarSelectorPopup;
        return E_SUCCESS;
 }
 
 void
+TaskDetailsForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
+{
+       switch (requestId)
+       {
+       case IDA_CALENDAR_SELECTOR_POPUP_DONE:
+               if (pArgs != null)
+               {
+                       if (SaveTask(static_cast<Integer*>(pArgs->GetAt(0))->value) == E_SUCCESS)
+                       {
+                               if (GetFooter() != null)
+                               {
+                                       GetFooter()->RemoveAllItems();
+                               }
+                               __pTableView->UpdateTableView();
+                       }
+               }
+               break;
+       }
+
+       if (pArgs != null)
+       {
+               pArgs->RemoveAll(true);
+               delete pArgs;
+       }
+}
+
+void
 TaskDetailsForm::OnFormBackRequested(Form& source)
 {
 //     result r = SendAppControlResult(APP_CTRL_RESULT_SUCCEEDED);
@@ -161,7 +191,7 @@ TaskDetailsForm::OnFormBackRequested(Form& source)
 int
 TaskDetailsForm::GetSectionCount(void)
 {
-       if (__pTask->GetCalendarId() == INVALID_RECORD_ID)
+       if (__pTask->GetRecordId() == INVALID_RECORD_ID)
        {
                return GROUP_COUNT - 1;
        }
@@ -276,7 +306,11 @@ TaskDetailsForm::GetSectionHeader(int sectionIndex)
 bool
 TaskDetailsForm::HasSectionHeader(int sectionIndex)
 {
-       if (sectionIndex == GROUP_INFORMATION_CONTENT)
+       if (sectionIndex == GROUP_MAIN_CONTENT)
+       {
+               return false;
+       }
+       else if (sectionIndex == GROUP_INFORMATION_CONTENT)
        {
                if ((__pTask->GetLocation().IsEmpty() == true) && (__pTask->GetDescription().IsEmpty() == true))
                {
@@ -347,6 +381,12 @@ TaskDetailsForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId
                        TryCatch(pTodos != null, , "[E_FAILURE] Unable to parse todos from vcs file.");
                        TryCatch(pTodos->GetCount() > 0, delete pTodos, "[E_FAILURE] Unable to parse todos from vcs file.");
 
+                       if (__pCalendarSelectorPopup == null)
+                       {
+                               __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup();
+                               __pCalendarSelectorPopup->Initialize();
+                       }
+
                        __pTask = static_cast<CalTodo*>(pTodos->GetAt(0));
                        pTodos->RemoveAt(0, false);
                        pTodos->RemoveAll(true);
@@ -395,6 +435,12 @@ TaskDetailsForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId
                        TryCatch(pTodos != null, , "[E_FAILURE] Unable to parse todos from vcs file.");
                        TryCatch(pTodos->GetCount() > 0, delete pTodos, "[E_FAILURE] Unable to parse todos from vcs file.");
 
+                       if (__pCalendarSelectorPopup == null)
+                       {
+                               __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup();
+                               __pCalendarSelectorPopup->Initialize();
+                       }
+
                        __pTask = static_cast<CalTodo*>(pTodos->GetAt(0));
                        pTodos->RemoveAt(0, false);
                        pTodos->RemoveAll(true);
@@ -420,19 +466,21 @@ TaskDetailsForm::OnActionPerformed(const Control& source, int actionId)
        switch (actionId)
        {
        case IDA_TASK_DETAILS_FORM_ADD_TO_CALENDAR:
-               if (__pTask->GetSubject().IsEmpty() == true)
+               if (__pCalendarSelectorPopup != null)
                {
-                       __pTask->SetSubject(ResourceManager::GetString(IDS_CLD_BODY_NO_TITLE));
+                       __pCalendarSelectorPopup->RequestCalendar(CALENDAR_SELECTOR_POPUP_STYLE_TODO, this);
                }
-               Calendarbook calendarbook;
-               calendarbook.Construct();
-               calendarbook.AddTodo(*__pTask);
-
-               if (GetFooter() != null)
+               else
                {
-                       GetFooter()->RemoveAllItems();
+                       if (SaveTask() == E_SUCCESS)
+                       {
+                               if (GetFooter() != null)
+                               {
+                                       GetFooter()->RemoveAllItems();
+                               }
+                               __pTableView->UpdateTableView();
+                       }
                }
-               __pTableView->UpdateTableView();
                break;
        }
 }
@@ -851,6 +899,34 @@ TaskDetailsForm::GetReminderString(const Reminder* pReminder) const
 }
 
 result
+TaskDetailsForm::SaveTask(RecordId calendarId)
+{
+       String subject = __pTask->GetSubject();
+       if (subject.IsEmpty() == true)
+       {
+               __pTask->SetSubject(ResourceManager::GetString(IDS_CLD_BODY_NO_TITLE));
+       }
+       Calendarbook calendarbook;
+       calendarbook.Construct();
+       result r = E_SUCCESS;
+       if (calendarId != INVALID_RECORD_ID)
+       {
+               r = calendarbook.AddTodo(*__pTask, calendarId);
+       }
+       else
+       {
+               r = calendarbook.AddTodo(*__pTask);
+       }
+
+       if (r != E_SUCCESS)
+       {
+               __pTask->SetSubject(subject);
+       }
+
+       return r;
+}
+
+result
 TaskDetailsForm::SendAppControlResult(AppCtrlResult appControlResult)
 {
        CalendarApp* pApp = static_cast<CalendarApp*>(UiApp::GetInstance());
index 66d0dc4..15146d1 100755 (executable)
@@ -33,8 +33,10 @@ using namespace Tizen::Ui::Controls;
 
 static const int IDA_EVENT_POPUP_CANCEL = 11905;
 
-ThreeButtonPopup::ThreeButtonPopup(ThreeButtonPopupStyle style)
-       : __style(style)
+ThreeButtonPopup::ThreeButtonPopup(void)
+       : __pTitle(null)
+       , __pButtonOnlyThis(null)
+       , __pButtonAllEvents(null)
        , __pTarget(null)
        , __pEvent(null)
 {
@@ -45,37 +47,59 @@ ThreeButtonPopup::~ThreeButtonPopup(void)
 }
 
 result
-ThreeButtonPopup::OnInitializing(void)
+ThreeButtonPopup::Initialize(void)
+{
+       result r = Construct(L"IDL_THREE_BUTTON_POPUP");
+       if (r == E_SUCCESS)
+       {
+               __pTitle = dynamic_cast<Label*>(GetControl(L"IDC_LABEL"));
+               AppAssertf(__pTitle != null, "[E_FAILURE] Unable to get label.");
+
+               __pButtonOnlyThis = dynamic_cast<Button*>(GetControl(L"IDC_BUTTON_ONLY_THIS_EVENT"));
+               AppAssertf(__pButtonOnlyThis != null, "[E_FAILURE] Unable to get button.");
+
+               __pButtonAllEvents = dynamic_cast<Button*>(GetControl(L"IDC_BUTTON_ALL_EVENTS"));
+               AppAssertf(__pButtonAllEvents != null, "[E_FAILURE] Unable to get button.");
+       }
+       return r;
+}
+
+void
+ThreeButtonPopup::RequestPopup(ThreeButtonPopupStyle style, Control* pTarget, const CalEventInstance* pEvent)
 {
-       Label* pTitle = dynamic_cast<Label*>(GetControl(L"IDC_LABEL"));
-       AppAssertf(pTitle != null, "[E_FAILURE] Unable to get label.");
+       switch (style)
+       {
+       case THREE_BUTTON_POPUP_STYLE_EDIT:
+               __pTitle->SetText(ResourceManager::GetString(IDS_POPUP_EDIT_EVENT_QUESTION));
+               __pButtonOnlyThis->SetActionId(IDA_EVENT_POPUP_ONLY_THIS_EVENT_EDIT);
+               __pButtonAllEvents->SetActionId(IDA_EVENT_POPUP_ALL_REPETITIVE_EVENT_EDIT);
+               break;
+       case THREE_BUTTON_POPUP_STYLE_DELETE:
+               __pTitle->SetText(ResourceManager::GetString(IDS_COM_POP_DELETE_Q));
+               __pButtonOnlyThis->SetActionId(IDA_EVENT_POPUP_ONLY_THIS_EVENT_DELETE);
+               __pButtonAllEvents->SetActionId(IDA_EVENT_POPUP_ALL_REPETITIVE_EVENT_DELETE);
+               break;
+       }
 
-       Button* pButtonOnlyThis = dynamic_cast<Button*>(GetControl(L"IDC_BUTTON_ONLY_THIS_EVENT"));
-       AppAssertf(pButtonOnlyThis != null, "[E_FAILURE] Unable to get button.");
-       pButtonOnlyThis->AddActionEventListener(*this);
+       __pTarget = pTarget;
 
-       Button* pButtonAllEvents = dynamic_cast<Button*>(GetControl(L"IDC_BUTTON_ALL_EVENTS"));
-       AppAssertf(pButtonAllEvents != null, "[E_FAILURE] Unable to get button.");
-       pButtonAllEvents->AddActionEventListener(*this);
+       delete __pEvent;
+       __pEvent = (pEvent != null) ? new (std::nothrow) CalEventInstance(*pEvent) : null;
+
+       Show();
+}
+
+result
+ThreeButtonPopup::OnInitializing(void)
+{
+       __pButtonOnlyThis->AddActionEventListener(*this);
+       __pButtonAllEvents->AddActionEventListener(*this);
 
        Button* pButtonCancel = dynamic_cast<Button*>(GetControl(L"IDC_BUTTON_CANCEL"));
        AppAssertf(pButtonCancel != null, "[E_FAILURE] Unable to get button.");
        pButtonCancel->SetActionId(IDA_EVENT_POPUP_CANCEL);
        pButtonCancel->AddActionEventListener(*this);
 
-       if (__style == THREE_BUTTON_POPUP_STYLE_EDIT)
-       {
-               pTitle->SetText(ResourceManager::GetString(IDS_POPUP_EDIT_EVENT_QUESTION));
-               pButtonOnlyThis->SetActionId(IDA_EVENT_POPUP_ONLY_THIS_EVENT_EDIT);
-               pButtonAllEvents->SetActionId(IDA_EVENT_POPUP_ALL_REPETITIVE_EVENT_EDIT);
-       }
-       else if (__style == THREE_BUTTON_POPUP_STYLE_DELETE)
-       {
-               pTitle->SetText(ResourceManager::GetString(IDS_COM_POP_DELETE_Q));
-               pButtonOnlyThis->SetActionId(IDA_EVENT_POPUP_ONLY_THIS_EVENT_DELETE);
-               pButtonAllEvents->SetActionId(IDA_EVENT_POPUP_ALL_REPETITIVE_EVENT_DELETE);
-       }
-
        return E_SUCCESS;
 }
 
@@ -100,16 +124,4 @@ ThreeButtonPopup::OnActionPerformed(const Control& source, int actionId)
                }
                __pTarget->SendUserEvent(actionId, pArgs);
        }
-
-       delete this;
-}
-
-void
-ThreeButtonPopup::RequestThreeButtonPopup(ThreeButtonPopupStyle style, Control* pTarget, const CalEventInstance* pEvent)
-{
-       ThreeButtonPopup* pPopup = new (std::nothrow) ThreeButtonPopup(style);
-       pPopup->__pTarget = pTarget;
-       pPopup->__pEvent = (pEvent != null) ? new (std::nothrow) CalEventInstance(*pEvent) : null;
-       pPopup->Construct(L"IDL_THREE_BUTTON_POPUP");
-       pPopup->Show();
 }
index 41341af..e25be87 100644 (file)
@@ -33,8 +33,8 @@ using namespace Tizen::Ui::Controls;
 
 static const int IDA_EVENT_POPUP_CANCEL = 10902;
 
-TwoButtonPopup::TwoButtonPopup(TwoButtonPopupStyle style)
-       : __style(style)
+TwoButtonPopup::TwoButtonPopup(void)
+       : __pTitle(null)
        , __pTarget(null)
        , __pEvent(null)
 {
@@ -45,19 +45,41 @@ TwoButtonPopup::~TwoButtonPopup(void)
 }
 
 result
-TwoButtonPopup::OnInitializing(void)
+TwoButtonPopup::Initialize(void)
 {
-       Label* pTitle = dynamic_cast<Label*>(GetControl(L"IDC_LABEL"));
-       AppAssertf(pTitle != null, "[E_FAILURE] Unable to get label.");
-       if (__style == TWO_BUTTON_POPUP_STYLE_REPEATED_EVENT)
+       result r = Construct(L"IDL_TWO_BUTTON_POPUP");
+       if (r == E_SUCCESS)
        {
-               pTitle->SetText(ResourceManager::GetString(IDS_POPUP_DELETE_MULTIPLE_REPEATED_EVENT));
+               __pTitle = dynamic_cast<Label*>(GetControl(L"IDC_LABEL"));
+               AppAssertf(__pTitle != null, "[E_FAILURE] Unable to get label.");
        }
-       else
+       return r;
+}
+
+void
+TwoButtonPopup::RequestPopup(TwoButtonPopupStyle style, Control* pTarget, const CalEventInstance* pEvent)
+{
+       switch (style)
        {
-               pTitle->SetText(ResourceManager::GetString(IDS_COM_POP_DELETE_Q));
+       case TWO_BUTTON_POPUP_STYLE_REPEATED_EVENT:
+               __pTitle->SetText(ResourceManager::GetString(IDS_POPUP_DELETE_MULTIPLE_REPEATED_EVENT));
+               break;
+       default:
+               __pTitle->SetText(ResourceManager::GetString(IDS_COM_POP_DELETE_Q));
+               break;
        }
 
+       __pTarget = pTarget;
+
+       delete __pEvent;
+       __pEvent = (pEvent != null) ? new (std::nothrow) CalEventInstance(*pEvent) : null;
+
+       Show();
+}
+
+result
+TwoButtonPopup::OnInitializing(void)
+{
        Button* pButtonDone = dynamic_cast<Button*>(GetControl(L"IDC_BUTTON_DELETE"));
        AppAssertf(pButtonDone != null, "[E_FAILURE] Unable to get button.");
        pButtonDone->SetActionId(IDA_EVENT_POPUP_DELETE);
@@ -92,16 +114,4 @@ TwoButtonPopup::OnActionPerformed(const Control& source, int actionId)
                }
                __pTarget->SendUserEvent(actionId, pArgs);
        }
-
-       delete this;
-}
-
-void
-TwoButtonPopup::RequestTwoButtonPopup(TwoButtonPopupStyle style, Control* pTarget, const CalEventInstance* pEvent)
-{
-       TwoButtonPopup* pPopup = new (std::nothrow) TwoButtonPopup(style);
-       pPopup->__pTarget = pTarget;
-       pPopup->__pEvent = (pEvent != null) ? new (std::nothrow) CalEventInstance(*pEvent) : null;
-       pPopup->Construct(L"IDL_TWO_BUTTON_POPUP");
-       pPopup->Show();
 }