From 95cd7248f56bd844ad44c2bd099f4126c6a536b1 Mon Sep 17 00:00:00 2001 From: Dmytro Dragan Date: Tue, 12 Jan 2016 16:36:08 +0200 Subject: [PATCH] TizenRefApp-5430 Recipient is not Added when Composing Message from Contact Details Screen Change-Id: If7a13904befc59305d184c86b4c50e4462c2bd11 Signed-off-by: Dmytro Dragan --- src/Conversation/Body/Controller/inc/Body.h | 3 +-- src/Conversation/Body/Controller/src/Body.cpp | 7 ------ .../Main/Controller/inc/Conversation.h | 4 ++-- .../Main/Controller/src/Conversation.cpp | 25 ++++++++++++++++------ .../Recipients/Controller/inc/RecipientsPanel.h | 3 +-- .../Recipients/Controller/src/RecipientsPanel.cpp | 9 ++------ 6 files changed, 24 insertions(+), 27 deletions(-) diff --git a/src/Conversation/Body/Controller/inc/Body.h b/src/Conversation/Body/Controller/inc/Body.h index da2122f..63875ea 100644 --- a/src/Conversation/Body/Controller/inc/Body.h +++ b/src/Conversation/Body/Controller/inc/Body.h @@ -43,7 +43,6 @@ namespace Msg { public: Body(Evas_Object *parent, MsgEngine &msgEngine); - Body(Evas_Object *parent, MsgEngine &msgEngine, const AppControlComposeRef &cmd); virtual ~Body(); void setListener(IBodyListener *listener); @@ -56,6 +55,7 @@ namespace Msg long long getMmsSize() const; void read(Message &msg); void write(const Message &msg); + void execCmd(const AppControlComposeRef &cmd); private: void read(MessageSMS &msg); @@ -68,7 +68,6 @@ namespace Msg void write(const MessageMms &msg); bool isMms(const PageView &page) const; void writeTextToFile(TextPageViewItem &item); - void execCmd(const AppControlComposeRef &cmd); // BodyView: virtual void onContentChanged(); diff --git a/src/Conversation/Body/Controller/src/Body.cpp b/src/Conversation/Body/Controller/src/Body.cpp index cf2bc8b..3b95e3d 100644 --- a/src/Conversation/Body/Controller/src/Body.cpp +++ b/src/Conversation/Body/Controller/src/Body.cpp @@ -47,13 +47,6 @@ Body::Body(Evas_Object *parent, MsgEngine &msgEngine) { } -Body::Body(Evas_Object *parent, MsgEngine &msgEngine, const AppControlComposeRef &cmd) - : Body(parent, msgEngine) -{ - if(cmd) - execCmd(cmd); -} - Body::~Body() { if(m_pOnChangedIdler) diff --git a/src/Conversation/Main/Controller/inc/Conversation.h b/src/Conversation/Main/Controller/inc/Conversation.h index 1071beb..44171d9 100644 --- a/src/Conversation/Main/Controller/inc/Conversation.h +++ b/src/Conversation/Main/Controller/inc/Conversation.h @@ -99,7 +99,8 @@ namespace Msg private: // Empty initializer constructor: - Conversation(NaviFrameController &parent, const AppControlComposeRef &cmd, bool dummy); + Conversation(NaviFrameController &parent, bool dummy); + void execCmd(const AppControlComposeRef &cmd); void create(); void setMode(Mode mode); void setNewMessageMode(); @@ -143,7 +144,6 @@ namespace Msg ThreadId m_ThreadId; bool m_IsMms; // Compose message type ConvList *m_pConvList; - const AppControlComposeRef m_ComposeCmd; }; } diff --git a/src/Conversation/Main/Controller/src/Conversation.cpp b/src/Conversation/Main/Controller/src/Conversation.cpp index da18573..deb2dda 100644 --- a/src/Conversation/Main/Controller/src/Conversation.cpp +++ b/src/Conversation/Main/Controller/src/Conversation.cpp @@ -32,7 +32,7 @@ using namespace Msg; -Conversation::Conversation(NaviFrameController &parent, const AppControlComposeRef &cmd, bool dummy) +Conversation::Conversation(NaviFrameController &parent, bool dummy) : FrameController(parent) , m_Mode(InitMode) , m_pLayout(nullptr) @@ -43,21 +43,21 @@ Conversation::Conversation(NaviFrameController &parent, const AppControlComposeR , m_ThreadId() , m_IsMms(false) , m_pConvList(nullptr) - , m_ComposeCmd(cmd) { } Conversation::Conversation(NaviFrameController &parent, const AppControlComposeRef &cmd) - : Conversation(parent, cmd, false) + : Conversation(parent, false) { if(cmd) - m_ThreadId = getMsgEngine().getStorage().getThreadId(m_ComposeCmd->getRecipientList()); + m_ThreadId = getMsgEngine().getStorage().getThreadId(cmd->getRecipientList()); create(); + execCmd(cmd); } Conversation::Conversation(NaviFrameController &parent,ThreadId threadId) - : Conversation(parent, nullptr, false) + : Conversation(parent, false) { m_ThreadId = threadId; create(); @@ -77,6 +77,17 @@ Conversation::~Conversation() m_pContactsList->setListener(nullptr); } +void Conversation::execCmd(const AppControlComposeRef &cmd) +{ + if(cmd) + { + if(m_pRecipPanel) + m_pRecipPanel->execCmd(cmd); + if(m_pBody) + m_pBody->execCmd(cmd); + } +} + void Conversation::create() { createMainLayout(getParent()); @@ -192,7 +203,7 @@ void Conversation::createRecipPanel(Evas_Object *parent) { if(!m_pRecipPanel) { - m_pRecipPanel = new RecipientsPanel(parent, getApp(), m_ComposeCmd); + m_pRecipPanel = new RecipientsPanel(parent, getApp()); m_pRecipPanel->setListener(this); m_pRecipPanel->show(); m_pRecipPanel->setRecipientRect(m_pLayout->getRecipientRect()); @@ -241,7 +252,7 @@ void Conversation::createBody(Evas_Object *parent) { if(!m_pBody) { - m_pBody = new Body(*m_pMsgInputPanel, getMsgEngine(), m_ComposeCmd); + m_pBody = new Body(*m_pMsgInputPanel, getMsgEngine()); m_pBody->setListener(this); m_pBody->show(); } diff --git a/src/Conversation/Recipients/Controller/inc/RecipientsPanel.h b/src/Conversation/Recipients/Controller/inc/RecipientsPanel.h index 405d4db..ed87515 100644 --- a/src/Conversation/Recipients/Controller/inc/RecipientsPanel.h +++ b/src/Conversation/Recipients/Controller/inc/RecipientsPanel.h @@ -37,7 +37,6 @@ namespace Msg { public: RecipientsPanel(Evas_Object *parent, App &app); - RecipientsPanel(Evas_Object *parent, App &app, const AppControlComposeRef &cmd); virtual ~RecipientsPanel(); void read(Message &msg); @@ -46,6 +45,7 @@ namespace Msg void update(const ThreadId &threadId); bool appendItem(const std::string &address, const std::string &dispName, MsgAddress::AddressType addressType = MsgAddress::UnknownAddressType); + void execCmd(const AppControlComposeRef &cmd); private: // RecipientsPanelView: @@ -63,7 +63,6 @@ namespace Msg void onPopupDel(Evas_Object *popup, void *eventInfo); void addRecipients(); - void execCmd(const AppControlComposeRef &cmd); void showDuplicatedRecipientPopup(); void showTooManyRecipientsPopup(); bool recipientExists(const std::string& address) const; diff --git a/src/Conversation/Recipients/Controller/src/RecipientsPanel.cpp b/src/Conversation/Recipients/Controller/src/RecipientsPanel.cpp index 381bba7..5e4d6fe 100644 --- a/src/Conversation/Recipients/Controller/src/RecipientsPanel.cpp +++ b/src/Conversation/Recipients/Controller/src/RecipientsPanel.cpp @@ -28,14 +28,7 @@ RecipientsPanel::RecipientsPanel(Evas_Object *parent, App &app) , m_App(app) , m_pListener(nullptr) { -} - -RecipientsPanel::RecipientsPanel(Evas_Object *parent, App &app, const AppControlComposeRef &cmd) - : RecipientsPanel(parent, app) -{ m_Picker.setListener(this); - if(cmd) - execCmd(cmd); } RecipientsPanel::~RecipientsPanel() @@ -129,10 +122,12 @@ bool RecipientsPanel::appendItem(const std::string &address, const std::string & void RecipientsPanel::execCmd(const AppControlComposeRef &cmd) { + clearMbe(); for(auto item: cmd->getRecipientList()) { appendItem(item, item, MsgAddress::UnknownAddressType); } + showMbe(!isMbeEmpty()); } void RecipientsPanel::onKeyDown(Evas_Event_Key_Down *ev) -- 2.7.4