From: Eugene Kurzberg Date: Fri, 19 Aug 2016 08:34:32 +0000 (+0300) Subject: Removed automatic "show" when popup is to avoid issues in derived classes. X-Git-Tag: submit/tizen/20160826.132643~1^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F63%2F84563%2F1;p=profile%2Fmobile%2Fapps%2Fnative%2Fphone-contacts.git Removed automatic "show" when popup is to avoid issues in derived classes. Change-Id: Iae45e9529856e69b090589099bc6b609b1a6d722 Signed-off-by: Eugene Kurzberg --- diff --git a/lib-apps-common/inc/Ui/Popup.h b/lib-apps-common/inc/Ui/Popup.h index 52203f4..bf67a06 100644 --- a/lib-apps-common/inc/Ui/Popup.h +++ b/lib-apps-common/inc/Ui/Popup.h @@ -40,11 +40,7 @@ namespace Ui */ typedef std::function BackCallback; - /** - * @brief Create popup - * @param[in] isVisible Popup visibility on start - */ - Popup(bool isVisible = true); + Popup(); /** * @brief Allows method overload instead of shadowing @@ -95,6 +91,11 @@ namespace Ui void setBackCallback(BackCallback callback); /** + * @brief Show popup with animation. + */ + void show(); + + /** * @brief Close popup with animation. */ void close(); @@ -108,7 +109,6 @@ namespace Ui ButtonCallback m_ButtonCbs[POPUP_BUTTON_MAX_COUNT]; size_t m_ButtonCount; - bool m_IsVisible; BackCallback m_OnBack; }; } diff --git a/lib-apps-common/inc/Ui/ProgressPopup.h b/lib-apps-common/inc/Ui/ProgressPopup.h index 95ba395..ad4f9f2 100644 --- a/lib-apps-common/inc/Ui/ProgressPopup.h +++ b/lib-apps-common/inc/Ui/ProgressPopup.h @@ -28,9 +28,8 @@ namespace Ui /** * @brief Create progress popup. * @param[in] maxValue Max value of progressbar - * @param[in] isVisible Popup visibility on start */ - ProgressPopup(size_t maxValue, bool isVisible = true); + ProgressPopup(size_t maxValue); /** * @brief Set progress of the progressbar diff --git a/lib-apps-common/src/Ui/Popup.cpp b/lib-apps-common/src/Ui/Popup.cpp index a5700a2..c7725f7 100644 --- a/lib-apps-common/src/Ui/Popup.cpp +++ b/lib-apps-common/src/Ui/Popup.cpp @@ -30,8 +30,8 @@ namespace const char *buttonParts[POPUP_BUTTON_MAX_COUNT] = { "button1", "button2", "button3" }; } -Popup::Popup(bool isVisible) - : m_ButtonCount(0), m_IsVisible(isVisible) +Popup::Popup() + : m_ButtonCount(0) { } @@ -86,6 +86,11 @@ void Popup::setBackCallback(BackCallback callback) m_OnBack = std::move(callback); } +void Popup::show() +{ + evas_object_show(getEvasObject()); +} + void Popup::close() { evas_object_hide(getEvasObject()); @@ -106,9 +111,6 @@ Evas_Object *Popup::onCreate(Evas_Object *parent) elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0); eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, makeCallback(&Popup::onBackPressed), this); - if (m_IsVisible) { - evas_object_show(popup); - } return popup; } diff --git a/lib-apps-common/src/Ui/ProcessPopup.cpp b/lib-apps-common/src/Ui/ProcessPopup.cpp index f93fbff..aca1458 100644 --- a/lib-apps-common/src/Ui/ProcessPopup.cpp +++ b/lib-apps-common/src/Ui/ProcessPopup.cpp @@ -25,8 +25,7 @@ using namespace Ui; ProcessPopup::ProcessPopup(Size size, double showDelayTime, double showMinTime) - : Popup(false), - m_Size(size), m_Layout(nullptr), + : m_Size(size), m_Layout(nullptr), m_ShowDelayTimer(nullptr), m_ShowMinTimer(nullptr), m_IsDestroyPending(false) { diff --git a/lib-apps-common/src/Ui/ProgressController.cpp b/lib-apps-common/src/Ui/ProgressController.cpp index fefcc53..3b87dd3 100644 --- a/lib-apps-common/src/Ui/ProgressController.cpp +++ b/lib-apps-common/src/Ui/ProgressController.cpp @@ -72,7 +72,7 @@ bool ProgressController::onProgress(size_t value) void ProgressController::createProgressPopup(Evas_Object *parent, const char *title, int maxValue) { - m_ProgressPopup = new Ui::ProgressPopup(maxValue, false); + m_ProgressPopup = new Ui::ProgressPopup(maxValue); RETM_IF(!m_ProgressPopup, "m_ProgressPopup is NULL"); m_ProgressPopup->create(parent); diff --git a/lib-apps-common/src/Ui/ProgressPopup.cpp b/lib-apps-common/src/Ui/ProgressPopup.cpp index bcfab28..aca953f 100644 --- a/lib-apps-common/src/Ui/ProgressPopup.cpp +++ b/lib-apps-common/src/Ui/ProgressPopup.cpp @@ -32,8 +32,8 @@ namespace const std::string layoutFilePath = App::getResourcePath(APPS_COMMON_PROGRESSBAR_LAYOUT_EDJ); } -ProgressPopup::ProgressPopup(size_t maxValue, bool isVisible) - : Popup(isVisible), m_MaxValue(maxValue), m_Progressbar(nullptr) +ProgressPopup::ProgressPopup(size_t maxValue) + : m_MaxValue(maxValue), m_Progressbar(nullptr) { } diff --git a/lib-contacts/src/Contacts/Chooser/ChooserView.cpp b/lib-contacts/src/Contacts/Chooser/ChooserView.cpp index e1b88de..823290f 100644 --- a/lib-contacts/src/Contacts/Chooser/ChooserView.cpp +++ b/lib-contacts/src/Contacts/Chooser/ChooserView.cpp @@ -164,6 +164,7 @@ bool ChooserView::onSelectedForAction(SelectResults results) result.type = (long) data; onSelected({ result }); }); + popup->show(); return false; }); diff --git a/lib-contacts/src/Contacts/Chooser/ContactsGroupsNavigator.cpp b/lib-contacts/src/Contacts/Chooser/ContactsGroupsNavigator.cpp index a5ae625..ffd62b7 100644 --- a/lib-contacts/src/Contacts/Chooser/ContactsGroupsNavigator.cpp +++ b/lib-contacts/src/Contacts/Chooser/ContactsGroupsNavigator.cpp @@ -129,4 +129,5 @@ void ContactsGroupsNavigator::onButtonPressed(Evas_Object *obj, Elm_Object_Item auto item = (Ux::SelectItem *) elm_object_item_data_get(button); item->setChecked(false); }); + popup->show(); } diff --git a/lib-contacts/src/Contacts/Details/DetailsView.cpp b/lib-contacts/src/Contacts/Details/DetailsView.cpp index 282db66..660678c 100644 --- a/lib-contacts/src/Contacts/Details/DetailsView.cpp +++ b/lib-contacts/src/Contacts/Details/DetailsView.cpp @@ -153,6 +153,7 @@ void DetailsView::onMenuPressed() getPage()->close(); return true; }); + popup->show(); }); menu->addItem("IDS_PB_OPT_SHARE", [this] { if (m_Contact.getSubType() == ObjectTypeContact) { diff --git a/lib-contacts/src/Contacts/Groups/CreateGroupItem.cpp b/lib-contacts/src/Contacts/Groups/CreateGroupItem.cpp index 195a09a..5596264 100644 --- a/lib-contacts/src/Contacts/Groups/CreateGroupItem.cpp +++ b/lib-contacts/src/Contacts/Groups/CreateGroupItem.cpp @@ -91,4 +91,5 @@ void CreateGroupItem::onButtonPressed(Evas_Object *button, void *eventInfo) } }); popup->create(getParent()->getEvasObject()); + popup->show(); } diff --git a/lib-contacts/src/Contacts/Groups/GroupsView.cpp b/lib-contacts/src/Contacts/Groups/GroupsView.cpp index 7169873..aa86285 100644 --- a/lib-contacts/src/Contacts/Groups/GroupsView.cpp +++ b/lib-contacts/src/Contacts/Groups/GroupsView.cpp @@ -121,6 +121,7 @@ void GroupsView::onMenuPressed() popup->addItem("IDS_PB_OPT_GROUPS_AND_MEMBERS_ABB", (void *)true); popup->setSelectedCallback(std::bind(&GroupsView::onDeleteSelected, this, std::move(results), _1)); + popup->show(); return false; }); diff --git a/lib-contacts/src/Contacts/Input/AddFieldsItem.cpp b/lib-contacts/src/Contacts/Input/AddFieldsItem.cpp index 6557879..f8d3b75 100644 --- a/lib-contacts/src/Contacts/Input/AddFieldsItem.cpp +++ b/lib-contacts/src/Contacts/Input/AddFieldsItem.cpp @@ -128,4 +128,5 @@ void AddFieldsItem::onMoreButtonPressed(Evas_Object *button, void *eventInfo) popup->addItem(Common::getContactFieldName(fieldId), (void *) fieldId); } } + popup->show(); } diff --git a/lib-contacts/src/Contacts/Input/ContactDateFieldControl.cpp b/lib-contacts/src/Contacts/Input/ContactDateFieldControl.cpp index c3abe1e..2d09540 100644 --- a/lib-contacts/src/Contacts/Input/ContactDateFieldControl.cpp +++ b/lib-contacts/src/Contacts/Input/ContactDateFieldControl.cpp @@ -75,4 +75,5 @@ void ContactDateFieldControl::onButtonPressed(Evas_Object *button, void *eventIn update(); }); popup->create(getEvasObject()); + popup->show(); } diff --git a/lib-contacts/src/Contacts/Input/ContactImageFieldControl.cpp b/lib-contacts/src/Contacts/Input/ContactImageFieldControl.cpp index 29e0d69..9fda6f6 100644 --- a/lib-contacts/src/Contacts/Input/ContactImageFieldControl.cpp +++ b/lib-contacts/src/Contacts/Input/ContactImageFieldControl.cpp @@ -75,4 +75,5 @@ void ContactImageFieldControl::onImagePressed(Evas_Object *image, void *eventInf update(); }); } + popup->show(); } diff --git a/lib-contacts/src/Contacts/Input/ContactTypedFieldControl.cpp b/lib-contacts/src/Contacts/Input/ContactTypedFieldControl.cpp index a206417..93a9de9 100644 --- a/lib-contacts/src/Contacts/Input/ContactTypedFieldControl.cpp +++ b/lib-contacts/src/Contacts/Input/ContactTypedFieldControl.cpp @@ -71,6 +71,7 @@ bool ContactTypedFieldControl::onSelected(void *data) }); popup->create(getEvasObject()); + popup->show(); return false; } else { if (m_TypeField.hasCustomValue()) { diff --git a/lib-contacts/src/Contacts/Input/InputView.cpp b/lib-contacts/src/Contacts/Input/InputView.cpp index 24def3d..4658d28 100644 --- a/lib-contacts/src/Contacts/Input/InputView.cpp +++ b/lib-contacts/src/Contacts/Input/InputView.cpp @@ -305,6 +305,7 @@ void InputView::addEventField() addFieldItem(field); }); popup->create(getEvasObject()); + popup->show(); } void InputView::addRingtoneField() @@ -369,6 +370,7 @@ void InputView::onDonePressed(Evas_Object *button, void *eventInfo) m_Items[Model::FieldName]->focus(); return true; }); + popup->show(); return; } @@ -399,6 +401,7 @@ bool InputView::onCancel() getPage()->close(); return true; }); + popup->show(); return false; } diff --git a/lib-contacts/src/Contacts/List/ListView.cpp b/lib-contacts/src/Contacts/List/ListView.cpp index 62125d8..ad3f54f 100644 --- a/lib-contacts/src/Contacts/List/ListView.cpp +++ b/lib-contacts/src/Contacts/List/ListView.cpp @@ -210,6 +210,7 @@ void ListView::onMenuPressed() static_cast(m_Sections[SectionFavorites].m_Item), static_cast(m_Sections[SectionMfc].m_Item)); popup->create(getEvasObject()); + popup->show(); }); } } @@ -264,6 +265,7 @@ void ListView::onShareSelected() popup->setSelectedCallback([this](void *data) { onSelectFinished(); }); + popup->show(); return false; } diff --git a/lib-contacts/src/Contacts/Settings/ExportItem.cpp b/lib-contacts/src/Contacts/Settings/ExportItem.cpp index 464f9ed..330fe33 100644 --- a/lib-contacts/src/Contacts/Settings/ExportItem.cpp +++ b/lib-contacts/src/Contacts/Settings/ExportItem.cpp @@ -63,6 +63,7 @@ void ExportItem::onPickResult(app_control_h request, app_control_h reply, popup->addItem("IDS_PB_OPT_SD_CARD", (void *) StorageSdCard); popup->addItem("IDS_PB_OPT_DEVICE", (void *) StorageDevice); popup->setSelectedCallback(std::bind(&ExportItem::runExporter, this, _1, std::move(ids))); + popup->show(); return; } @@ -81,6 +82,7 @@ void ExportItem::onExportFinish(ExportController *exporter) finishPopup->setTitle("IDS_PB_HEADER_CONTACTS_EXPORTED_ABB"); finishPopup->setText(text); finishPopup->addButton("IDS_PB_BUTTON_OK_ABB2"); + finishPopup->show(); } void ExportItem::runExporter(void *data, std::vector ids) diff --git a/lib-contacts/src/Contacts/Settings/ImportController.cpp b/lib-contacts/src/Contacts/Settings/ImportController.cpp index c174e33..06aee57 100644 --- a/lib-contacts/src/Contacts/Settings/ImportController.cpp +++ b/lib-contacts/src/Contacts/Settings/ImportController.cpp @@ -45,7 +45,7 @@ size_t ImportController::getTotalCount() const void ImportController::createCancelPopup(Evas_Object *parent) { - m_CancelPopup = new Ui::Popup(false); + m_CancelPopup = new Ui::Popup(); m_CancelPopup->create(parent); m_CancelPopup->setTitle("IDS_PB_HEADER_CANCEL_IMPORTING_ABB"); diff --git a/lib-contacts/src/Contacts/Settings/ImportItem.cpp b/lib-contacts/src/Contacts/Settings/ImportItem.cpp index 1bb4461..35cf35c 100644 --- a/lib-contacts/src/Contacts/Settings/ImportItem.cpp +++ b/lib-contacts/src/Contacts/Settings/ImportItem.cpp @@ -69,6 +69,7 @@ void ImportItem::onSelected() } popup->setSelectedCallback(std::bind(&ImportItem::onStorageSelected, this, _1)); + popup->show(); } else { onStorageSelected((void *) ImportStorageDevice); } diff --git a/lib-contacts/src/Contacts/Settings/NameFormatItem.cpp b/lib-contacts/src/Contacts/Settings/NameFormatItem.cpp index 99ef825..e3a6541 100644 --- a/lib-contacts/src/Contacts/Settings/NameFormatItem.cpp +++ b/lib-contacts/src/Contacts/Settings/NameFormatItem.cpp @@ -68,6 +68,7 @@ void NameFormatItem::onSelected() popup->setSelectedCallback([](void *data) { contacts_setting_set_name_display_order((contacts_name_display_order_e) (long) data); }); + popup->show(); } void NameFormatItem::onNameOrderChanged(contacts_name_display_order_e order) diff --git a/lib-contacts/src/Contacts/Settings/SortByItem.cpp b/lib-contacts/src/Contacts/Settings/SortByItem.cpp index 07e99c1..f5bf043 100644 --- a/lib-contacts/src/Contacts/Settings/SortByItem.cpp +++ b/lib-contacts/src/Contacts/Settings/SortByItem.cpp @@ -68,6 +68,7 @@ void SortByItem::onSelected() popup->setSelectedCallback([](void *data) { contacts_setting_set_name_sorting_order((contacts_name_sorting_order_e) (long) data); }); + popup->show(); } void SortByItem::onSortOrderChanged(contacts_name_sorting_order_e order) diff --git a/lib-logs/src/Logs/List/LogsView.cpp b/lib-logs/src/Logs/List/LogsView.cpp index dcdf190..667f585 100644 --- a/lib-logs/src/Logs/List/LogsView.cpp +++ b/lib-logs/src/Logs/List/LogsView.cpp @@ -135,6 +135,7 @@ void LogsView::onFilterBySelected() fillLayout(); } }); + popup->show(); } void LogsView::onDeleteSelected() diff --git a/lib-phone/src/Phone/Dialer/DialerView.cpp b/lib-phone/src/Phone/Dialer/DialerView.cpp index ab39c52..bb291a0 100644 --- a/lib-phone/src/Phone/Dialer/DialerView.cpp +++ b/lib-phone/src/Phone/Dialer/DialerView.cpp @@ -253,6 +253,7 @@ void DialerView::onResultSelected(SearchResultPtr result) m_AppControl = App::requestContactEdit(0, m_Entry->getNumber().c_str()); m_AppControl.launch(); }); + popup->show(); } } @@ -329,5 +330,6 @@ void DialerView::launchSpeedDial(int digit) } else { Ui::Popup *popup = new SpeedDialPopup(digit); popup->create(getEvasObject()); + popup->show(); } } diff --git a/lib-phone/src/Phone/Dialer/SearchResultsControl.cpp b/lib-phone/src/Phone/Dialer/SearchResultsControl.cpp index b0f8348..d59fb03 100644 --- a/lib-phone/src/Phone/Dialer/SearchResultsControl.cpp +++ b/lib-phone/src/Phone/Dialer/SearchResultsControl.cpp @@ -182,4 +182,5 @@ void SearchResultsControl::onShowResultsPressed() popup->setSelectedCallback([this](void *data) { m_OnSelected(*(SearchResultPtr *) data); }); + popup->show(); }