m_AddressList.reset();
setMode(m_ThreadId.isValid() ? ConversationMode : NewMessageMode);
- showMsgInputPanel(!isHiddenAddress());
+ isHiddenAddress() ? destroyMsgInputPanel() : showMsgInputPanelIfNeeded(true);
if(m_pBody)
m_pBody->setMmsRecipFlag(getMsgEngine().getStorage().hasEmail(m_ThreadId));
m_Mode = NewMessageMode;
m_pLayout->showRecipEditMode(true);
- showMsgInputPanel(true);
+ showMsgInputPanelIfNeeded(true);
showRecipPanel(true);
showContactList(true);
m_pRecipPanel->update(m_ThreadId);
}
}
-void Conversation::showMsgInputPanel(bool show)
+void Conversation::createMsgInputPanel()
{
- if(show)
+ if(!m_pMsgInputPanel)
{
- if(!m_pMsgInputPanel)
- {
- m_pMsgInputPanel = new MessageInputPanel(*m_pConvList);
- m_pMsgInputPanel->setListener(this);
- m_pLayout->setMsgInputPanel(*m_pMsgInputPanel);
- }
- if(!m_pBody && m_pConvList)
- {
- m_pBody = new Body(*m_pMsgInputPanel, getApp(), m_WorkingDir, *m_pConvList);
- m_pBody->setListener(this);
+ m_pMsgInputPanel = new MessageInputPanel(*m_pConvList);
+ m_pMsgInputPanel->setListener(this);
+ m_pLayout->setMsgInputPanel(*m_pMsgInputPanel);
+ }
+ if(!m_pBody && m_pConvList)
+ {
+ m_pBody = new Body(*m_pMsgInputPanel, getApp(), m_WorkingDir, *m_pConvList);
+ m_pBody->setListener(this);
+ m_pMsgInputPanel->setEntry(*m_pBody);
+ updateMsgInputPanel();
+ }
+}
+
+void Conversation::destroyMsgInputPanel()
+{
+ if(m_pBody)
+ {
+ m_pBody->setListener(this);
+ m_pBody->destroy();
+ m_pBody = nullptr;
+ }
+ if(m_pMsgInputPanel)
+ {
+ m_pMsgInputPanel->setListener(this);
+ m_pMsgInputPanel->destroy();
+ m_pMsgInputPanel = nullptr;
+ }
+ m_pLayout->showMsgInputPanel(false);
+}
+
+void Conversation::showMsgInputPanelIfNeeded(bool show)
+{
+ if(show && !isHiddenAddress())
+ {
+ createMsgInputPanel();
+ if(m_pBody)
m_pBody->show();
- m_pMsgInputPanel->setEntry(*m_pBody);
- updateMsgInputPanel();
- }
+ if(m_pMsgInputPanel)
+ m_pMsgInputPanel->show();
}
else
{
if(m_pBody)
- {
- m_pBody->setListener(this);
- m_pBody->destroy();
- m_pBody = nullptr;
- }
+ m_pBody->hide();
if(m_pMsgInputPanel)
- {
- m_pMsgInputPanel->setListener(this);
- m_pMsgInputPanel->destroy();
- m_pMsgInputPanel = nullptr;
- }
+ m_pMsgInputPanel->hide();
}
m_pLayout->showMsgInputPanel(show);
+ if(m_pConvList)
+ m_pConvList->getComposeItem().show(show);
}
void Conversation::write(const Message &msg)
{
m_pConvList->setMode(ConvList::NormalMode);
updateNavibar();
+ showMsgInputPanelIfNeeded(true);
return;
}
m_pConvList->deleteSelectedItems();
m_pConvList->setMode(ConvList::NormalMode);
updateNavibar();
+ showMsgInputPanelIfNeeded(true);
}
}
m_AttachPanel.show(false);
m_pConvList->setMode(ConvList::SelectMode);
updateNavibar();
+ showMsgInputPanelIfNeeded(false);
}
void Conversation::onAddRecipientsItemPressed(PopupListItem &item)