TizenRefApp-7640 Navigate to selected (from activ notif.) conversation works worong... 95/97995/2 submit/tizen_3.0/20161115.144109
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Tue, 15 Nov 2016 13:43:18 +0000 (15:43 +0200)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Tue, 15 Nov 2016 13:49:02 +0000 (15:49 +0200)
Change-Id: I8ae56dd96ce8535af283190c68db2f46c8c60530
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
src/Common/View/inc/NaviFrameItem.h
src/Common/View/src/NaviFrameItem.cpp
src/Common/View/src/NaviFrameView.cpp
src/Conversation/Main/Controller/inc/Conversation.h
src/Conversation/Main/Controller/src/Conversation.cpp
src/Conversation/Main/View/src/MessageInputPanel.cpp

index 6b3d85e..c74d4b1 100644 (file)
@@ -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;
     };
 
     /**
index 9bcbb89..2a98e44 100644 (file)
@@ -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)
index b25e363..5444a99 100644 (file)
@@ -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);
index ae7425d..6a2a344 100644 (file)
@@ -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);
index 8003923..9a523f4 100644 (file)
@@ -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)
index 20920e8..81f22d9 100644 (file)
@@ -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);