From: Denis Dolzhenko Date: Tue, 15 Nov 2016 13:43:18 +0000 (+0200) Subject: TizenRefApp-7640 Navigate to selected (from activ notif.) conversation works worong... X-Git-Tag: submit/tizen_3.0/20161115.144109^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a5d10567b65707c876521741360f16b281457b9;p=profile%2Fmobile%2Fapps%2Fnative%2Fmessage.git TizenRefApp-7640 Navigate to selected (from activ notif.) conversation works worong in some cases. Change-Id: I8ae56dd96ce8535af283190c68db2f46c8c60530 Signed-off-by: Denis Dolzhenko --- diff --git a/src/Common/View/inc/NaviFrameItem.h b/src/Common/View/inc/NaviFrameItem.h index 6b3d85ef..c74d4b1c 100644 --- a/src/Common/View/inc/NaviFrameItem.h +++ b/src/Common/View/inc/NaviFrameItem.h @@ -78,6 +78,12 @@ namespace Msg NaviFrameView &getOwner(); const NaviFrameView &getOwner() const; + /** + * @brief Gets popping status + * @return true if current frame is popping and will be destroyed, false otherwise. + */ + bool isPopping() const; + protected: virtual void onButtonClicked(NaviFrameItem &item, NaviButtonId buttonId) {}; @@ -91,6 +97,7 @@ namespace Msg private: NaviFrameView &m_Owner; NaviBar *m_pNaviBar; + bool m_IsPopping; }; /** diff --git a/src/Common/View/src/NaviFrameItem.cpp b/src/Common/View/src/NaviFrameItem.cpp index 9bcbb898..2a98e443 100644 --- a/src/Common/View/src/NaviFrameItem.cpp +++ b/src/Common/View/src/NaviFrameItem.cpp @@ -50,6 +50,7 @@ namespace NaviFrameItem::NaviFrameItem(NaviFrameView &owner) : ViewItem() , m_Owner(owner) + , m_IsPopping(false) { m_pNaviBar = new NaviBar(*this); } @@ -78,6 +79,11 @@ const NaviFrameView &NaviFrameItem::getOwner() const return m_Owner; } +bool NaviFrameItem::isPopping() const +{ + return m_IsPopping; +} + void NaviFrameItem::setTitleVisibility(bool visible) { if (visible) diff --git a/src/Common/View/src/NaviFrameView.cpp b/src/Common/View/src/NaviFrameView.cpp index b25e3632..5444a99c 100644 --- a/src/Common/View/src/NaviFrameView.cpp +++ b/src/Common/View/src/NaviFrameView.cpp @@ -137,6 +137,7 @@ void NaviFrameView::pop() void NaviFrameView::pop(NaviFrameItem &item) { // Workaround solution to avoid rejected JIRA issue: http://suprem.sec.samsung.net/jira/browse/TSAM-6776 + item.m_IsPopping = true; if(getTransitionStatus()) { m_ItemsToDelete.push_back(&item); diff --git a/src/Conversation/Main/Controller/inc/Conversation.h b/src/Conversation/Main/Controller/inc/Conversation.h index ae7425d6..6a2a3448 100644 --- a/src/Conversation/Main/Controller/inc/Conversation.h +++ b/src/Conversation/Main/Controller/inc/Conversation.h @@ -116,11 +116,10 @@ namespace Msg // Popup callbacks: void onSendReadReportPopupDel(Evas_Object *popup, void *eventInfo); void onSendReadReportPopupButtonClicked(Popup &popup, int buttonId); - void onPopupDel(Evas_Object *popup, void *eventInfo); + void onNoRecipPopupDel(Evas_Object *popup, void *eventInfo); void onRecipPopupDel(Evas_Object *popup, void *eventInfo); void onMsgSendErrorButtonClicked(Popup &popup, int buttonId); void onMsgSettingsButtonClicked(Popup &popup, int buttonId); - void onNoRecipCancelButtonClicked(Popup &popup, int buttonId); void onNoRecipDiscardButtonClicked(Popup &popup, int buttonId); void onDeleteItemPressed(PopupListItem &item); void onAddRecipientsItemPressed(PopupListItem &item); diff --git a/src/Conversation/Main/Controller/src/Conversation.cpp b/src/Conversation/Main/Controller/src/Conversation.cpp index 8003923c..9a523f44 100644 --- a/src/Conversation/Main/Controller/src/Conversation.cpp +++ b/src/Conversation/Main/Controller/src/Conversation.cpp @@ -933,8 +933,8 @@ void Conversation::showSendDpmNotif(const MsgAddressList &addressList) void Conversation::showNoRecipPopup() { Popup &popup = getApp().getPopupManager().getPopup(); - popup.addEventCb(EVAS_CALLBACK_DEL, EVAS_EVENT_CALLBACK(Conversation, onPopupDel), this); - popup.addButton(msgt("IDS_MSG_BUTTON_CANCEL_ABB"), Popup::CancelButtonId, POPUP_BUTTON_CB(Conversation, onNoRecipCancelButtonClicked), this); + popup.addEventCb(EVAS_CALLBACK_DEL, EVAS_EVENT_CALLBACK(Conversation, onNoRecipPopupDel), this); + popup.addButton(msgt("IDS_MSG_BUTTON_CANCEL_ABB"), Popup::CancelButtonId); popup.addButton(msgt("IDS_MSG_BUTTON_DISCARD_ABB"), Popup::OkButtonId, POPUP_BUTTON_CB(Conversation, onNoRecipDiscardButtonClicked), this); popup.setTitle(msgt("IDS_MSG_HEADER_DISCARD_MESSAGE_M_CLOSE_ABB")); popup.setContent(msgt("IDS_MSG_POP_NO_VALID_RECIPIENTS_HAVE_BEEN_ADDED_THIS_MESSAGE_WILL_BE_DISCARDED")); @@ -946,7 +946,6 @@ void Conversation::showMobileDataPopup() auto &popupMngr = getApp().getPopupManager(); Popup &popup = popupMngr.getPopup(); popup.setTitle(msgt("IDS_MSG_HEADER_COULDNT_SEND_MESSAGE_ABB")); - popup.addEventCb(EVAS_CALLBACK_DEL, EVAS_EVENT_CALLBACK(Conversation, onPopupDel), this); popup.addButton(msgt("IDS_MSG_BUTTON_CANCEL_ABB2"), Popup::CancelButtonId, POPUP_BUTTON_CB(Conversation, onMsgSendErrorButtonClicked), this); popup.addButton(msgt("IDS_MSGF_BODY_SETTINGS"), Popup::OkButtonId, POPUP_BUTTON_CB(Conversation, onMsgSettingsButtonClicked), this); popup.setContent(msgt("IDS_MSGC_POP_MOBILE_DATA_IS_DISABLED_ENABLE_MOBILE_DATA_AND_TRY_AGAIN")); @@ -1299,11 +1298,10 @@ void Conversation::onButtonClicked(NaviFrameItem &item, NaviButtonId buttonId) } } -void Conversation::onPopupDel(Evas_Object *popup, void *eventInfo) +void Conversation::onNoRecipPopupDel(Evas_Object *popup, void *eventInfo) { MSG_LOG(""); - if(m_pBody) - m_pBody->setFocus(true); + resetDefferedCmd(); } void Conversation::onSendReadReportPopupDel(Evas_Object *popup, void *eventInfo) @@ -1331,8 +1329,6 @@ void Conversation::onMsgSendErrorButtonClicked(Popup &popup, int buttonId) { MSG_LOG(""); popup.destroy(); - if(m_pBody) - m_pBody->setFocus(true); } void Conversation::onMsgSettingsButtonClicked(Popup &popup, int buttonId) @@ -1342,16 +1338,8 @@ void Conversation::onMsgSettingsButtonClicked(Popup &popup, int buttonId) popup.destroy(); } -void Conversation::onNoRecipCancelButtonClicked(Popup &popup, int buttonId) -{ - popup.destroy(); - if(m_pBody) - m_pBody->setFocus(true); -} - void Conversation::onNoRecipDiscardButtonClicked(Popup &popup, int buttonId) { - popup.destroy(); if(isDefferedCmd()) { if(m_pBody) @@ -1388,6 +1376,9 @@ void Conversation::onNoRecipDiscardButtonClicked(Popup &popup, int buttonId) { pop(); } + + if(!isPopping()) + popup.destroy(); } void Conversation::onDeleteItemPressed(PopupListItem &item) diff --git a/src/Conversation/Main/View/src/MessageInputPanel.cpp b/src/Conversation/Main/View/src/MessageInputPanel.cpp index 20920e85..81f22d99 100644 --- a/src/Conversation/Main/View/src/MessageInputPanel.cpp +++ b/src/Conversation/Main/View/src/MessageInputPanel.cpp @@ -111,6 +111,8 @@ Evas_Object *MessageInputPanel::getButton(ButtonId id) Evas_Object *MessageInputPanel::createButton(Evas_Object *parent, ButtonId buttonId, const char *res) { Evas_Object *button = elm_button_add(parent); + if(buttonId == SendButtonId) + elm_object_focus_allow_set(button, false); elm_object_style_set(button, "transparent"); evas_object_data_set(button, buttonIdKey, (void*)buttonId); evas_object_size_hint_weight_set(button, 0.0, 0.0); @@ -120,6 +122,8 @@ Evas_Object *MessageInputPanel::createButton(Evas_Object *parent, ButtonId butto evas_object_show(button); Evas_Object *icon = elm_icon_add(button); + if(buttonId == SendButtonId) + elm_object_focus_allow_set(icon, false); std::string resPath = PathUtils::getResourcePath(IMAGES_EDJ_PATH); elm_image_file_set(icon, resPath.c_str(), res); evas_object_color_set(icon, BUTTON_COLOR);