TSAM-5562 Don't focus to Recipients field when share Calendar 15/76815/2 submit/tizen/20160627.114847
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Mon, 27 Jun 2016 10:21:40 +0000 (13:21 +0300)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Mon, 27 Jun 2016 11:17:49 +0000 (14:17 +0300)
Change-Id: I966452aeeef7b849e45f2c18f5e289140331f7e7
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
src/Conversation/Body/Controller/inc/Body.h
src/Conversation/Body/Controller/src/Body.cpp
src/Conversation/Main/Controller/src/Conversation.cpp

index 7137f04..2211236 100644 (file)
@@ -50,6 +50,7 @@ namespace Msg
             void create(Evas_Object *parent);
             void setListener(IBodyListener *listener);
 
+            void enableAutoFocusForAttachments(bool focus);
             void addMedia(const std::list<std::string> &fileList);
             void addMedia(const std::string &filePath);
 
@@ -120,6 +121,7 @@ namespace Msg
             bool m_MmsRecipFlag;
             AttachmentHandler m_AttachmentHandler;
             std::queue<std::string> m_SelectedFiles;
+            bool m_AutoFocusForAttachments;
     };
 
     class IBodyListener
index 2978569..2eb5ae3 100644 (file)
@@ -74,6 +74,7 @@ Body::Body(App &app, WorkingDirRef workingDir)
     , m_ResizingPopupShow(false)
     , m_MmsRecipFlag(false)
     , m_AttachmentHandler(workingDir)
+    , m_AutoFocusForAttachments(true)
 {
     m_AttachmentHandler.setListener(this);
 }
@@ -110,6 +111,11 @@ void Body::setListener(IBodyListener *listener)
     m_pListener = listener;
 }
 
+void Body::enableAutoFocusForAttachments(bool focus)
+{
+    m_AutoFocusForAttachments = focus;
+}
+
 void Body::addMedia(const std::list<std::string> &fileList)
 {
     for(auto& file : fileList)
@@ -570,8 +576,9 @@ void Body::onFileReady(const std::string &filePath)
         page = &getDefaultPage();
     }
 
-    if(page)
+    if(page && m_AutoFocusForAttachments)
         BodyView::setFocus(*page, true); // TODO: check for multi insertion
+
     m_SelectedFiles.pop();
     if(!m_SelectedFiles.empty())
     {
index 68fb52b..46e9020 100644 (file)
@@ -100,18 +100,20 @@ void Conversation::execCmd(const AppControlComposeRef &cmd)
     }
 
     setThreadId(ThreadId());
+
     if(m_pRecipPanel)
-    {
         m_pRecipPanel->execCmd(cmd);
-        if(!isRecipExists())
-            m_pRecipPanel->setEntryFocus(true);
-    }
+
     if(m_pBody)
     {
+        m_pBody->enableAutoFocusForAttachments(isRecipExists());
         m_pBody->execCmd(cmd);
-        if(isRecipExists())
-            m_pBody->setFocus(true);
     }
+
+    if(isRecipExists())
+        m_pBody->setFocus(true);
+    else if(m_pRecipPanel)
+        m_pRecipPanel->setEntryFocus(true);
 }
 
 void Conversation::execCmd(const AppControlDefaultRef &cmd)
@@ -1074,6 +1076,7 @@ void Conversation::onConvListItemChecked()
 void Conversation::onFileSelected(AttachPanel &panel, const AttachPanel::FileList &files)
 {
     MSG_LOG("");
+    m_pBody->enableAutoFocusForAttachments(true);
     m_pBody->addMedia(files);
 }