From 93d91b754e80a2510bea93b7b14e5ceb1b5c67b4 Mon Sep 17 00:00:00 2001 From: Denis Dolzhenko Date: Mon, 27 Jun 2016 13:21:40 +0300 Subject: [PATCH] TSAM-5562 Don't focus to Recipients field when share Calendar Change-Id: I966452aeeef7b849e45f2c18f5e289140331f7e7 Signed-off-by: Denis Dolzhenko --- src/Conversation/Body/Controller/inc/Body.h | 2 ++ src/Conversation/Body/Controller/src/Body.cpp | 9 ++++++++- src/Conversation/Main/Controller/src/Conversation.cpp | 15 +++++++++------ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/Conversation/Body/Controller/inc/Body.h b/src/Conversation/Body/Controller/inc/Body.h index 7137f04..2211236 100644 --- a/src/Conversation/Body/Controller/inc/Body.h +++ b/src/Conversation/Body/Controller/inc/Body.h @@ -50,6 +50,7 @@ namespace Msg void create(Evas_Object *parent); void setListener(IBodyListener *listener); + void enableAutoFocusForAttachments(bool focus); void addMedia(const std::list &fileList); void addMedia(const std::string &filePath); @@ -120,6 +121,7 @@ namespace Msg bool m_MmsRecipFlag; AttachmentHandler m_AttachmentHandler; std::queue m_SelectedFiles; + bool m_AutoFocusForAttachments; }; class IBodyListener diff --git a/src/Conversation/Body/Controller/src/Body.cpp b/src/Conversation/Body/Controller/src/Body.cpp index 2978569..2eb5ae3 100644 --- a/src/Conversation/Body/Controller/src/Body.cpp +++ b/src/Conversation/Body/Controller/src/Body.cpp @@ -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 &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()) { diff --git a/src/Conversation/Main/Controller/src/Conversation.cpp b/src/Conversation/Main/Controller/src/Conversation.cpp index 68fb52b..46e9020 100644 --- a/src/Conversation/Main/Controller/src/Conversation.cpp +++ b/src/Conversation/Main/Controller/src/Conversation.cpp @@ -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); } -- 2.7.4