Removed automatic "show" when popup is to avoid issues in derived classes. 63/84563/1
authorEugene Kurzberg <i.kurtsberg@samsung.com>
Fri, 19 Aug 2016 08:34:32 +0000 (11:34 +0300)
committerEugene Kurzberg <i.kurtsberg@samsung.com>
Fri, 19 Aug 2016 08:34:32 +0000 (11:34 +0300)
Change-Id: Iae45e9529856e69b090589099bc6b609b1a6d722
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
25 files changed:
lib-apps-common/inc/Ui/Popup.h
lib-apps-common/inc/Ui/ProgressPopup.h
lib-apps-common/src/Ui/Popup.cpp
lib-apps-common/src/Ui/ProcessPopup.cpp
lib-apps-common/src/Ui/ProgressController.cpp
lib-apps-common/src/Ui/ProgressPopup.cpp
lib-contacts/src/Contacts/Chooser/ChooserView.cpp
lib-contacts/src/Contacts/Chooser/ContactsGroupsNavigator.cpp
lib-contacts/src/Contacts/Details/DetailsView.cpp
lib-contacts/src/Contacts/Groups/CreateGroupItem.cpp
lib-contacts/src/Contacts/Groups/GroupsView.cpp
lib-contacts/src/Contacts/Input/AddFieldsItem.cpp
lib-contacts/src/Contacts/Input/ContactDateFieldControl.cpp
lib-contacts/src/Contacts/Input/ContactImageFieldControl.cpp
lib-contacts/src/Contacts/Input/ContactTypedFieldControl.cpp
lib-contacts/src/Contacts/Input/InputView.cpp
lib-contacts/src/Contacts/List/ListView.cpp
lib-contacts/src/Contacts/Settings/ExportItem.cpp
lib-contacts/src/Contacts/Settings/ImportController.cpp
lib-contacts/src/Contacts/Settings/ImportItem.cpp
lib-contacts/src/Contacts/Settings/NameFormatItem.cpp
lib-contacts/src/Contacts/Settings/SortByItem.cpp
lib-logs/src/Logs/List/LogsView.cpp
lib-phone/src/Phone/Dialer/DialerView.cpp
lib-phone/src/Phone/Dialer/SearchResultsControl.cpp

index 52203f4..bf67a06 100644 (file)
@@ -40,11 +40,7 @@ namespace Ui
                 */
                typedef std::function<bool()> 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;
        };
 }
index 95ba395..ad4f9f2 100644 (file)
@@ -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
index a5700a2..c7725f7 100644 (file)
@@ -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;
 }
index f93fbff..aca1458 100644 (file)
@@ -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)
 {
index fefcc53..3b87dd3 100644 (file)
@@ -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);
index bcfab28..aca953f 100644 (file)
@@ -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)
 {
 }
 
index e1b88de..823290f 100644 (file)
@@ -164,6 +164,7 @@ bool ChooserView::onSelectedForAction(SelectResults results)
                        result.type = (long) data;
                        onSelected({ result });
                });
+               popup->show();
 
                return false;
        });
index a5ae625..ffd62b7 100644 (file)
@@ -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();
 }
index 282db66..660678c 100644 (file)
@@ -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) {
index 195a09a..5596264 100644 (file)
@@ -91,4 +91,5 @@ void CreateGroupItem::onButtonPressed(Evas_Object *button, void *eventInfo)
                }
        });
        popup->create(getParent()->getEvasObject());
+       popup->show();
 }
index 7169873..aa86285 100644 (file)
@@ -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;
                        });
index 6557879..f8d3b75 100644 (file)
@@ -128,4 +128,5 @@ void AddFieldsItem::onMoreButtonPressed(Evas_Object *button, void *eventInfo)
                        popup->addItem(Common::getContactFieldName(fieldId), (void *) fieldId);
                }
        }
+       popup->show();
 }
index c3abe1e..2d09540 100644 (file)
@@ -75,4 +75,5 @@ void ContactDateFieldControl::onButtonPressed(Evas_Object *button, void *eventIn
                update();
        });
        popup->create(getEvasObject());
+       popup->show();
 }
index 29e0d69..9fda6f6 100644 (file)
@@ -75,4 +75,5 @@ void ContactImageFieldControl::onImagePressed(Evas_Object *image, void *eventInf
                        update();
                });
        }
+       popup->show();
 }
index a206417..93a9de9 100644 (file)
@@ -71,6 +71,7 @@ bool ContactTypedFieldControl::onSelected(void *data)
                });
 
                popup->create(getEvasObject());
+               popup->show();
                return false;
        } else {
                if (m_TypeField.hasCustomValue()) {
index 24def3d..4658d28 100644 (file)
@@ -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;
 }
index 62125d8..ad3f54f 100644 (file)
@@ -210,6 +210,7 @@ void ListView::onMenuPressed()
                                                static_cast<ListSection *>(m_Sections[SectionFavorites].m_Item),
                                                static_cast<ListSection *>(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;
                }
 
index 464f9ed..330fe33 100644 (file)
@@ -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<int> ids)
index c174e33..06aee57 100644 (file)
@@ -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");
 
index 1bb4461..35cf35c 100644 (file)
@@ -69,6 +69,7 @@ void ImportItem::onSelected()
                }
 
                popup->setSelectedCallback(std::bind(&ImportItem::onStorageSelected, this, _1));
+               popup->show();
        } else {
                onStorageSelected((void *) ImportStorageDevice);
        }
index 99ef825..e3a6541 100644 (file)
@@ -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)
index 07e99c1..f5bf043 100644 (file)
@@ -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)
index dcdf190..667f585 100644 (file)
@@ -135,6 +135,7 @@ void LogsView::onFilterBySelected()
                        fillLayout();
                }
        });
+       popup->show();
 }
 
 void LogsView::onDeleteSelected()
index ab39c52..bb291a0 100644 (file)
@@ -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();
        }
 }
index b0f8348..d59fb03 100644 (file)
@@ -182,4 +182,5 @@ void SearchResultsControl::onShowResultsPressed()
        popup->setSelectedCallback([this](void *data) {
                m_OnSelected(*(SearchResultPtr *) data);
        });
+       popup->show();
 }