From 52631c98bd879f8b4054e1d22daa6f1a5d914b06 Mon Sep 17 00:00:00 2001 From: Changyong Jeon Date: Mon, 20 May 2013 10:30:51 +0900 Subject: [PATCH] Resolved issues N_SE-38835, N_SE-38574 and replace the control build codes to xml. Change-Id: I5d5a7ae47ed468f3168b862b73a6169220f7ae20 --- inc/ClCalendarSelectorPopup.h | 20 ++- .../IDL_CALENDAR_SELECTOR_POPUP.xml | 24 +-- .../IDL_PANEL_CALENDAR_LIST_ITEM.xml | 28 ++++ src/ClCalendarSelectorPopup.cpp | 173 +++++++++------------ src/ClEventEditorForm.cpp | 31 +--- src/ClEventPresentationModel.cpp | 2 +- src/ClImportForm.cpp | 48 +++--- 7 files changed, 153 insertions(+), 173 deletions(-) create mode 100644 res/screen-size-normal/IDL_PANEL_CALENDAR_LIST_ITEM.xml diff --git a/inc/ClCalendarSelectorPopup.h b/inc/ClCalendarSelectorPopup.h index 9066916..b797a04 100644 --- a/inc/ClCalendarSelectorPopup.h +++ b/inc/ClCalendarSelectorPopup.h @@ -29,8 +29,8 @@ class CalendarSelectorPopup : public Tizen::Ui::Controls::Popup , public virtual Tizen::Ui::IActionEventListener - , public virtual Tizen::Ui::Controls::IListViewItemEventListener - , public virtual Tizen::Ui::Controls::IListViewItemProvider + , public virtual Tizen::Ui::Controls::ITableViewItemProvider + , public virtual Tizen::Ui::Controls::ITableViewItemEventListener { public: result Initialize(void); @@ -44,19 +44,17 @@ public: virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId); + virtual Tizen::Ui::Controls::TableViewItem* CreateItem(int itemIndex, int itemWidth); + virtual bool DeleteItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem); + virtual int GetDefaultItemHeight(void); virtual int GetItemCount(void); - virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth); - virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth); - - virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status); - virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction); - virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status); - virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback); - virtual void OnListViewItemReordered(Tizen::Ui::Controls::ListView& listView, int indexFrom, int indexTo); + virtual void UpdateItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem); + virtual void OnTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::TableView& tableView, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated); + virtual void OnTableViewItemReordered(Tizen::Ui::Controls::TableView& tableView, int itemIndexFrom, int itemIndexTo); + virtual void OnTableViewItemStateChanged(Tizen::Ui::Controls::TableView& tableView, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status); public: Tizen::Base::Collection::IList* __pCalendars; - Tizen::Ui::Controls::ListView* __pListView; Tizen::Ui::Control* __pTarget; }; // CalendarSelectorPopup diff --git a/res/screen-size-normal/IDL_CALENDAR_SELECTOR_POPUP.xml b/res/screen-size-normal/IDL_CALENDAR_SELECTOR_POPUP.xml index 3208037..63472c1 100644 --- a/res/screen-size-normal/IDL_CALENDAR_SELECTOR_POPUP.xml +++ b/res/screen-size-normal/IDL_CALENDAR_SELECTOR_POPUP.xml @@ -4,20 +4,20 @@ --> - + - - - + + + - - - - - + + + + + diff --git a/res/screen-size-normal/IDL_PANEL_CALENDAR_LIST_ITEM.xml b/res/screen-size-normal/IDL_PANEL_CALENDAR_LIST_ITEM.xml new file mode 100644 index 0000000..627fdda --- /dev/null +++ b/res/screen-size-normal/IDL_PANEL_CALENDAR_LIST_ITEM.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + diff --git a/src/ClCalendarSelectorPopup.cpp b/src/ClCalendarSelectorPopup.cpp index fd66412..78ae862 100644 --- a/src/ClCalendarSelectorPopup.cpp +++ b/src/ClCalendarSelectorPopup.cpp @@ -31,13 +31,6 @@ using namespace Tizen::Social; using namespace Tizen::Ui; using namespace Tizen::Ui::Controls; -enum CalendarItemElementId -{ - CALENDAR_ITEM_ELEMENT_ID_ICON, - CALENDAR_ITEM_ELEMENT_ID_NAME, - CALENDAR_ITEM_ELEMENT_ID_ADDRESS -}; - static const int IDA_CALENDAR_SELECTOR_POPUP_CANCEL = 20902; static const RecordId ID_DEFAULT_BIRTHDAY_CALENDAR = 3; @@ -47,25 +40,9 @@ static const int H_2_ITEMS_EVENT_LIST = 478; static const int H_3_ITEMS_EVENT_LIST = 620; static const int H_MANY_ITEMS_EVENT_LIST = 680; static const int H_ITEM = 140; -static const int X_CALENDAR_ICON = 20; -static const int Y_CALENDAR_ICON = 38; -static const int W_CALENDAR_ICON = 64; -static const int W_CALENDAR_ICON_MARGIN = 16; -static const int H_CALENDAR_ICON = 64; -static const int Y_CALENDAR_NAME = 22; -static const int H_CALENDAR_NAME = 42; -static const int Y_CALENDAR_ADDRESS = 64; -static const int H_CALENDAR_ADDRESS = 54; -static const int FONT_SIZE_DETAIL02 = 44; -static const unsigned int COLOR_DETAIL02 = Color32<0, 0, 0>::Value; -static const unsigned int COLOR_DETAIL02_FOCUS = Color32<255, 255, 255>::Value; -static const int FONT_SIZE_DETAIL03 = 32; -static const unsigned int COLOR_DETAIL03 = Color32<128, 128, 128>::Value; -static const unsigned int COLOR_DETAIL03_FOCUS = Color32<255, 255, 255>::Value; CalendarSelectorPopup::CalendarSelectorPopup(void) : __pCalendars(null) - , __pListView(null) , __pTarget(null) { @@ -87,7 +64,7 @@ CalendarSelectorPopup::Initialize(void) } void -CalendarSelectorPopup::RequestCalendar(CalendarSelectorPopupStyle style, Control* pTarget, bool readOnly) +CalendarSelectorPopup::RequestCalendar(CalendarSelectorPopupStyle style, Tizen::Ui::Control* pTarget, bool readOnly) { if (__pCalendars) { @@ -118,9 +95,9 @@ CalendarSelectorPopup::RequestCalendar(CalendarSelectorPopupStyle style, Control } __pCalendars = calendarbook.SearchN(filter); - TryReturnVoid(__pCalendars != null, "[E_FAILURE] Unable to get calendar list."); + TryReturnVoid(__pCalendars, "[E_FAILURE] Unable to get calendar list."); - if (readOnly == false) + if (!readOnly) { IEnumerator* pEnum = __pCalendars->GetEnumeratorN(); int index = 0; @@ -136,23 +113,20 @@ CalendarSelectorPopup::RequestCalendar(CalendarSelectorPopupStyle style, Control delete pEnum; } - if (__pCalendars->GetCount() > 0) + switch (__pCalendars->GetCount()) { - switch (__pCalendars->GetCount()) - { - case 1: - SetSize(GetWidth(), H_1_ITEM_EVENT_LIST); - break; - case 2: - SetSize(GetWidth(), H_2_ITEMS_EVENT_LIST); - break; - case 3: - SetSize(GetWidth(), H_3_ITEMS_EVENT_LIST); - break; - default: - SetSize(GetWidth(), H_MANY_ITEMS_EVENT_LIST); - break; - } + case 1: + SetSize(GetWidth(), H_1_ITEM_EVENT_LIST); + break; + case 2: + SetSize(GetWidth(), H_2_ITEMS_EVENT_LIST); + break; + case 3: + SetSize(GetWidth(), H_3_ITEMS_EVENT_LIST); + break; + default: + SetSize(GetWidth(), H_MANY_ITEMS_EVENT_LIST); + break; } __pTarget = pTarget; @@ -163,15 +137,12 @@ CalendarSelectorPopup::RequestCalendar(CalendarSelectorPopupStyle style, Control result CalendarSelectorPopup::OnInitializing(void) { - __pListView = dynamic_cast(GetControl(L"IDC_LISTVIEW")); - AppAssertf(__pListView != null, "[E_FAILURE] Unable to get listview."); - __pListView->SetItemProvider(*this); - __pListView->AddListViewItemEventListener(*this); - // TBD : Below code will be deleted.(Tizen SDK 2.0 has a defect on first drawing.) - __pListView->UpdateList(); - - Button* pButtonCancel = dynamic_cast(GetControl(L"IDC_BUTTON_CANCEL")); - AppAssertf(pButtonCancel != null, "[E_FAILURE] Unable to get button."); + AppLogDebug("Enter"); + TableView* pTableView = static_cast(GetControl(L"IDC_TABLEVIEW")); + pTableView->SetItemProvider(this); + pTableView->AddTableViewItemEventListener(*this); + + Button* pButtonCancel = static_cast(GetControl(L"IDC_BUTTON_CANCEL")); pButtonCancel->SetActionId(IDA_CALENDAR_SELECTOR_POPUP_CANCEL); pButtonCancel->AddActionEventListener(*this); @@ -181,102 +152,108 @@ CalendarSelectorPopup::OnInitializing(void) result CalendarSelectorPopup::OnTerminating(void) { + AppLogDebug("Enter"); return E_SUCCESS; } void -CalendarSelectorPopup::OnActionPerformed(const Control& source, int actionId) +CalendarSelectorPopup::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) { SetShowState(false); } -int -CalendarSelectorPopup::GetItemCount(void) +Tizen::Ui::Controls::TableViewItem* +CalendarSelectorPopup::CreateItem(int itemIndex, int itemWidth) { - return __pCalendars->GetCount(); -} + AppLogDebug("itemIndex: %d", itemIndex); + RelativeLayout layout; + layout.Construct(); -ListItemBase* -CalendarSelectorPopup::CreateItem(int index, int itemWidth) -{ - CustomItem* pItem = new (std::nothrow) CustomItem(); - pItem->Construct(Dimension(itemWidth, H_ITEM), LIST_ANNEX_STYLE_NORMAL); + TableViewItem* pItem = new (std::nothrow) TableViewItem(); + pItem->Construct(layout, Dimension(itemWidth, H_ITEM)); - Calendar* pCalendar = static_cast(__pCalendars->GetAt(index)); - Bitmap* pBitmapIcon = null; + Calendar* pCalendar = static_cast(__pCalendars->GetAt(itemIndex)); + Bitmap* pIconBitmap = null; String accountName; if (pCalendar->GetAccountId() != INVALID_ACCOUNT_ID) { Account account = AccountAccessor::GetInstance()->GetAccount(pCalendar->GetAccountId()); - pBitmapIcon = ResourceManager::GetBitmapN(account.GetAccountProvider().GetIconPath(), true); + pIconBitmap = ResourceManager::GetBitmapN(account.GetAccountProvider().GetIconPath(), true); accountName = account.GetUserName(); - AppLogDebug("%ls - %ls", accountName.GetPointer(), account.GetAccountProvider().GetIconPath().GetPointer()); } else { - pBitmapIcon = ResourceManager::GetBitmapN(IDB_ICON_PHONE_CALENDAR); + pIconBitmap = ResourceManager::GetBitmapN(IDB_ICON_PHONE_CALENDAR); accountName = ResourceManager::GetString(IDS_CLD_POP_MY_PHONE); - AppLogDebug("%ls - %ls", accountName.GetPointer(), IDB_ICON_PHONE_CALENDAR); } - int x = 0; - if (pBitmapIcon != null) - { - pItem->AddElement(Rectangle(X_CALENDAR_ICON, Y_CALENDAR_ICON, W_CALENDAR_ICON, H_CALENDAR_ICON), - CALENDAR_ITEM_ELEMENT_ID_ICON, *pBitmapIcon); - delete pBitmapIcon; - x += X_CALENDAR_ICON + W_CALENDAR_ICON + W_CALENDAR_ICON_MARGIN; - } + Panel* pPanel = new (std::nothrow) Panel(); + pPanel->Construct(L"IDL_PANEL_CALENDAR_LIST_ITEM"); + + Label* pLabel = static_cast(pPanel->GetControl(L"IDC_LABEL_ICON")); + pLabel->SetBackgroundBitmap(*pIconBitmap); + delete pIconBitmap; + + pLabel = static_cast(pPanel->GetControl(L"IDC_LABEL_MAIN_TEXT")); + pLabel->SetText(pCalendar->GetName()); - pItem->AddElement(Rectangle(x, Y_CALENDAR_NAME, itemWidth - x, H_CALENDAR_NAME), - CALENDAR_ITEM_ELEMENT_ID_NAME, accountName, FONT_SIZE_DETAIL03, - Color(COLOR_DETAIL03), Color(COLOR_DETAIL03_FOCUS), Color(COLOR_DETAIL03_FOCUS)); + pLabel = static_cast(pPanel->GetControl(L"IDC_LABEL_SUB_TEXT")); + pLabel->SetText(accountName); - pItem->AddElement(Rectangle(x, Y_CALENDAR_ADDRESS, itemWidth - x, H_CALENDAR_ADDRESS), - CALENDAR_ITEM_ELEMENT_ID_ADDRESS, pCalendar->GetName(), FONT_SIZE_DETAIL02, - Color(COLOR_DETAIL02), Color(COLOR_DETAIL02_FOCUS), Color(COLOR_DETAIL02_FOCUS)); + pItem->AddControl(pPanel); + + layout.SetHorizontalFitPolicy(*pPanel, FIT_POLICY_PARENT); + layout.SetVerticalFitPolicy(*pPanel, FIT_POLICY_PARENT); return pItem; } bool -CalendarSelectorPopup::DeleteItem(int index, ListItemBase* pItem, int itemWidth) +CalendarSelectorPopup::DeleteItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem) { + AppLogDebug("itemIndex: %d", itemIndex); delete pItem; return true; } -void -CalendarSelectorPopup::OnListViewItemStateChanged(ListView& listView, int index, int elementId, ListItemStatus status) +int +CalendarSelectorPopup::GetDefaultItemHeight(void) { - if (status == LIST_ITEM_STATUS_SELECTED) - { - if (__pTarget != null) - { - LinkedList* pArgs = new (std::nothrow) LinkedList(); - pArgs->Add(new (std::nothrow) Integer(static_cast(__pCalendars->GetAt(index))->GetRecordId())); - __pTarget->SendUserEvent(IDA_CALENDAR_SELECTOR_POPUP_DONE, pArgs); - } - SetShowState(false); - } + return 0; +} + +int +CalendarSelectorPopup::GetItemCount(void) +{ + return __pCalendars->GetCount(); } void -CalendarSelectorPopup::OnListViewItemSwept(ListView& listView, int index, SweepDirection direction) +CalendarSelectorPopup::UpdateItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem) { } void -CalendarSelectorPopup::OnListViewContextItemStateChanged(ListView& listView, int index, int elementId, ListContextItemStatus status) +CalendarSelectorPopup::OnTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::TableView& tableView, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated) { } void -CalendarSelectorPopup::OnListViewItemLongPressed(ListView& listView, int index, int elementId, bool& invokeListViewItemCallback) +CalendarSelectorPopup::OnTableViewItemReordered(Tizen::Ui::Controls::TableView& tableView, int itemIndexFrom, int itemIndexTo) { } void -CalendarSelectorPopup::OnListViewItemReordered(ListView& listView, int indexFrom, int indexTo) +CalendarSelectorPopup::OnTableViewItemStateChanged(Tizen::Ui::Controls::TableView& tableView, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status) { + if (status == TABLE_VIEW_ITEM_STATUS_SELECTED) + { + if (__pTarget) + { + LinkedList* pArgs = new (std::nothrow) LinkedList(SingleObjectDeleter); + pArgs->Add(new (std::nothrow) Integer(static_cast(__pCalendars->GetAt(itemIndex))->GetRecordId())); + __pTarget->SendUserEvent(IDA_CALENDAR_SELECTOR_POPUP_DONE, pArgs); + } + SetShowState(false); + } } diff --git a/src/ClEventEditorForm.cpp b/src/ClEventEditorForm.cpp index aab941c..8773638 100644 --- a/src/ClEventEditorForm.cpp +++ b/src/ClEventEditorForm.cpp @@ -939,7 +939,6 @@ EventEditorForm::OnActionPerformed(const Control& source, int actionId) AppLogDebugIf(r != E_SUCCESS, "[%s] Unable to return result.", GetErrorMessage(r)); pApp->Terminate(); - AppLogDebug("Exit."); return; } @@ -971,19 +970,13 @@ EventEditorForm::OnActionPerformed(const Control& source, int actionId) } else { - result r = SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT)); - if (IsFailed(r)) - { - MessageBox msgBox; - msgBox.Construct(L"", ResourceManager::GetString(IDS_COM_POP_SAVING_FAILED), MSGBOX_STYLE_OK); - int modalResult; - msgBox.ShowAndWait(modalResult); - } + SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT)); } } } else { + UpdatePm(); String msgString; switch (r) { @@ -1003,7 +996,6 @@ EventEditorForm::OnActionPerformed(const Control& source, int actionId) int modalResult; msgBox.ShowAndWait(modalResult); } - __pTableView->UpdateTableView(); break; case IDA_EVENT_EDITOR_FORM_CANCEL: SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT)); @@ -1037,7 +1029,6 @@ EventEditorForm::OnActionPerformed(const Control& source, int actionId) break; } } - AppLogDebug("Exit."); } TableViewItem* @@ -1081,16 +1072,12 @@ TableViewItem* EventEditorForm::CreateStartTimeItemN(int itemWidth, const DateTime& start, bool isAllDayEvent) { TableViewItem* pItem = new (std::nothrow) TableViewItem(); - - EditDate* pStartDate = null; - EditTime* pStartTime = null; - pItem->Construct(Dimension(itemWidth, H_ITEM)); pItem->SetBackgroundColor(Color(COLOR_ITEM_BACKGROUND), TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL); pItem->SetBackgroundColor(Color(COLOR_ITEM_BACKGROUND), TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED); pItem->SetBackgroundColor(Color(COLOR_ITEM_BACKGROUND), TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED); - pStartDate = new (std::nothrow) EditDate(); + EditDate* pStartDate = new (std::nothrow) EditDate(); pStartDate->Construct(Point(0, Y_DATE_SELECTOR), ResourceManager::GetString(IDS_EVENT_EDITOR_FROM)); pItem->AddControl(pStartDate); @@ -1101,7 +1088,7 @@ EventEditorForm::CreateStartTimeItemN(int itemWidth, const DateTime& start, bool __pEditDateStartDate = pStartDate; - pStartTime = new (std::nothrow) EditTime(); + EditTime* pStartTime = new (std::nothrow) EditTime(); pStartTime->Construct(Point(X_DATE_SELECTOR, Y_DATE_SELECTOR), L" "); pItem->AddControl(pStartTime); @@ -1109,13 +1096,9 @@ EventEditorForm::CreateStartTimeItemN(int itemWidth, const DateTime& start, bool pStartTime->SetTime(start); pItem->SetIndividualSelectionEnabled(pStartTime, true); - bool is24HourNotationEnabled = false; - SettingInfo::GetValue(KEY_SYSTEM_24_HOUR_NOTATION_ENABLED, is24HourNotationEnabled); - pStartTime->Set24HourNotationEnabled(is24HourNotationEnabled); - __pEditTimeStartTime = pStartTime; - if (isAllDayEvent == true) + if (isAllDayEvent) { __pEditTimeStartTime->SetShowState(false); } @@ -1155,10 +1138,6 @@ EventEditorForm::CreateEndTimeItemN(int itemWidth, const DateTime& end, bool isA pEndTime->SetTime(end); pItem->SetIndividualSelectionEnabled(pEndTime, true); - bool is24HourNotationEnabled = false; - SettingInfo::GetValue(KEY_SYSTEM_24_HOUR_NOTATION_ENABLED, is24HourNotationEnabled); - pEndTime->Set24HourNotationEnabled(is24HourNotationEnabled); - __pEditTimeEndTime = pEndTime; if (isAllDayEvent == true) diff --git a/src/ClEventPresentationModel.cpp b/src/ClEventPresentationModel.cpp index 35f294e..da7525a 100644 --- a/src/ClEventPresentationModel.cpp +++ b/src/ClEventPresentationModel.cpp @@ -761,7 +761,7 @@ EventPresentationModel::Update(void) { AppLogDebug("Enter."); String subject = __pEvent->GetSubject(); - if (subject.IsEmpty() == true) + if (subject.IsEmpty()) { __pEvent->SetSubject(ResourceManager::GetString(IDS_CLD_BODY_NO_TITLE)); } diff --git a/src/ClImportForm.cpp b/src/ClImportForm.cpp index bc85d06..045c5eb 100644 --- a/src/ClImportForm.cpp +++ b/src/ClImportForm.cpp @@ -92,13 +92,16 @@ ImportForm::OnInitializing(void) __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup(); __pCalendarSelectorPopup->Initialize(); + __pProgressPopup = new (std::nothrow) ProgressPopup(); + __pProgressPopup->Construct(false, false); + return E_SUCCESS; } result ImportForm::OnTerminating(void) { - if (__pThread != null) + if (__pThread) { __pThread->Join(); delete __pThread; @@ -109,11 +112,11 @@ ImportForm::OnTerminating(void) delete __pDateFormatter; delete __pTimeFormatter; delete __pCalendarbook; - if (__pCalendarSelectorPopup != null) + if (__pCalendarSelectorPopup) { __pCalendarSelectorPopup->Destroy(); } - if (__pProgressPopup != null) + if (__pProgressPopup) { __pProgressPopup->Destroy(); } @@ -126,21 +129,17 @@ ImportForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs) switch (requestId) { case IDA_CALENDAR_SELECTOR_POPUP_DONE: - if (pArgs != null) + if (pArgs) { __calendarId = static_cast(pArgs->GetAt(0))->value; - if (__pThread != null) + if (__pThread) { __pThread->Join(); delete __pThread; + __pThread = null; } - if (__pProgressPopup == null) - { - __pProgressPopup = new (std::nothrow) ProgressPopup(); - __pProgressPopup->Construct(false, false); - } __pProgressPopup->SetShowState(true); __pProgressPopup->Show(); @@ -155,20 +154,20 @@ ImportForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs) __pThread = null; __pProgressPopup->SetShowState(false); - if (IsTodoItemChecked() == true) + if (IsTodoItemChecked()) { __pCalendarSelectorPopup->RequestCalendar(CALENDAR_SELECTOR_POPUP_STYLE_TODO, this); } __pListViewContents->UpdateList(); - if (IsNoItemChecked() == true) + if (IsNoItemChecked()) { GetFooter()->SetItemEnabled(0, false); GetFooter()->Invalidate(true); } - if (IsAllItemAdded() == true) + if (IsAllItemAdded()) { GetHeader()->RemoveAllButtons(); GetHeader()->Invalidate(true); @@ -178,7 +177,7 @@ ImportForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs) break; } - if (pArgs != null) + if (pArgs) { pArgs->RemoveAll(true); delete pArgs; @@ -188,6 +187,9 @@ ImportForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs) Object* ImportForm::Run(void) { + // Todo: temporary solution for lock-up. + Thread::Sleep(300); + Calendar* pCalendar = __pCalendarbook->GetCalendarN(__calendarId); if (pCalendar != null) { @@ -250,7 +252,7 @@ ImportForm::OnActionPerformed(const Control& source, int actionId) { case IDA_IMPORT_FORM_SELECT_ALL: { - bool checkFlag = IsAllItemChecked() == false; + bool checkFlag = (IsAllItemChecked() == false); int count = __pList->GetCount(); for (int i = 0; i < count; ++i) { @@ -263,11 +265,11 @@ ImportForm::OnActionPerformed(const Control& source, int actionId) break; } case IDA_IMPORT_FORM_ADD_TO_CALENDAR: - if (IsEventItemChecked() == true) + if (IsEventItemChecked()) { __pCalendarSelectorPopup->RequestCalendar(CALENDAR_SELECTOR_POPUP_STYLE_EVENT, this); } - else if (IsTodoItemChecked() == true) + else if (IsTodoItemChecked()) { __pCalendarSelectorPopup->RequestCalendar(CALENDAR_SELECTOR_POPUP_STYLE_TODO, this); } @@ -285,18 +287,17 @@ ImportForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source) IEnumerator* pEnum = __pList->GetEnumeratorN(); while (pEnum->MoveNext() == E_SUCCESS) { - if (dynamic_cast(pEnum->GetCurrent()) != null) + if (dynamic_cast(pEnum->GetCurrent())) { pArgs->Add(new (std::nothrow) CalEvent(static_cast(*pEnum->GetCurrent()))); } - else if (dynamic_cast(pEnum->GetCurrent()) != null) + else if (dynamic_cast(pEnum->GetCurrent())) { pArgs->Add(new (std::nothrow) CalTodo(static_cast(*pEnum->GetCurrent()))); } } delete pEnum; SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), pArgs); - AppLogDebug("Exit."); } void @@ -333,7 +334,7 @@ ImportForm::OnListViewContextItemStateChanged(ListView& listView, int index, int int ImportForm::GetItemCount(void) { - if (__pList == null) + if (!__pList) { return 0; } @@ -357,7 +358,6 @@ ImportForm::CreateItem(int index, int itemWidth) pItem->SetReminder(pEvent->GetAllReminders().GetCount() > 0); pItem->SetRepeat(pEvent->IsRecurring()); pItem->SetPriority(pEvent->GetPriority()); - // pItem->SetFacebookEvent(false); pItem->UpdateElements(); return pItem; } @@ -372,7 +372,6 @@ ImportForm::CreateItem(int index, int itemWidth) pItem->SetLocation(pTodo->GetLocation()); pItem->SetDueDate(ResourceManager::ConvertUtcTimeToWallTime(pTodo->GetDueDate()), __pDateTimeFormatter); pItem->SetReminder(pTodo->GetAllReminders().GetCount() > 0); - // pItem->SetFacebookEvent(false); switch (pTodo->GetPriority()) { @@ -428,7 +427,7 @@ ImportForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& cur } __pListViewContents->UpdateList(); - if (IsAllItemAdded() == true) + if (IsAllItemAdded()) { GetHeader()->RemoveAllButtons(); GetFooter()->RemoveAllItems(); @@ -444,7 +443,6 @@ void ImportForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId) { AppLogDebug("Enter."); - AppLogDebug("Exit."); } Color -- 2.7.4