BubbleDownloadButtonEntity(Message::Direction direction);
virtual ~BubbleDownloadButtonEntity();
+ void disabled(bool status);
virtual BubbleDownloadButtonViewItem *createView(Evas_Object *parent);
+
+ private:
+ bool m_Disabled;
};
inline BubbleDownloadButtonEntity::BubbleDownloadButtonEntity(Message::Direction direction)
: BubbleEntity(DownloadButtonItem, direction)
+ , m_Disabled(false)
{
}
inline BubbleDownloadButtonViewItem *BubbleDownloadButtonEntity::createView(Evas_Object *parent)
{
auto *item = new BubbleDownloadButtonViewItem(*this, parent);
+ item->disabled(m_Disabled);
return item;
}
+
+ inline void BubbleDownloadButtonEntity::disabled(bool status)
+ {
+ m_Disabled = status;
+ }
}
#endif /* BubbleDownloadButtonEntity_h_ */
void updateEntityBgType(BubbleBgViewItem::BgType bgType);
BubbleBgViewItem::BgType getBubbleBgType(const MsgConversationItem &item);
void tryToDownloadMms(bool showToast = true);
+ void updateDownloadButton();
+ BubbleDownloadButtonEntity *findDownloadButton() const;
// Create Popup when message is clicked
void showMainListPopup();
updateItemType(ConvItemType::Received);
updateEntityBgType(BubbleBgViewItem::ReceivedStyle);
}
+ else if(m_NetworkStatus == Message::NS_Retrieving)
+ {
+ updateDownloadButton();
+ }
update();
}
return m_BubbleEntityFactory.createTextEntity(resText, bgType, direction);
}
+BubbleDownloadButtonEntity *ConvListItem::findDownloadButton() const
+{
+ for(BubbleEntity *entity : m_BubbleEntityList)
+ {
+ if(entity->getType() == BubbleEntity::DownloadButtonItem)
+ return static_cast<BubbleDownloadButtonEntity*>(entity);
+ }
+ return nullptr;
+}
+
+void ConvListItem::updateDownloadButton()
+{
+ auto *downloadButton = findDownloadButton();
+ downloadButton->disabled(m_NetworkStatus == Message::NS_Retrieving);
+}
+
void ConvListItem::addEntity(BubbleEntity *entity)
{
if(entity)
std::string text = MessageDetailContent::getMmsNotiConvListItemContent(m_App, m_MsgId);
addEntity(createTextEntity(bgType, direction, text, false, searchWord));
addEntity(m_BubbleEntityFactory.createDownloadButtonEntity(direction));
+ updateDownloadButton();
}
else
{
void ConvListItem::tryToDownloadMms(bool showToast)
{
- if (!m_App.getSysSettingsManager().isMessagingRestrictedByDpm())
+ if(!m_App.getSysSettingsManager().isMessagingRestrictedByDpm())
+ {
m_App.getMsgEngine().getTransport().retrieveMessage(m_MsgId);
- else if (showToast)
+ auto *button = findDownloadButton();
+ if(button)
+ {
+ button->disabled(true);
+ updateContent();
+ }
+ }
+ else if(showToast)
notification_status_message_post(msg("IDS_MSG_TPOP_SECURITY_POLICY_RESTRICTS_DOWNLOADING_MULTIMEDIA_MESSAGES").cStr());
}
BubbleDownloadButtonViewItem(BubbleEntity &entity, Evas_Object *parent);
virtual ~BubbleDownloadButtonViewItem();
+ void disabled(bool status);
+
private:
void onPressed(Evas_Object *obj, void *eventInfo);
};
protected:
Evas_Object *createProgress();
- void updateProgressField();
+ void updateProgress();
+ void updateContent();
void updateItemType(ConvItemType type);
virtual void onRealized(ListItem &item);
virtual void onUnrealized(ListItem &item);
}
+void BubbleDownloadButtonViewItem::disabled(bool status)
+{
+ elm_object_disabled_set(getEo(), status);
+ processSignal();
+}
+
void BubbleDownloadButtonViewItem::onPressed(Evas_Object *obj, void *eventInfo)
{
emitActionEvent();
emitSignal("hide_search", "*");
}
-void ConvListViewItem::updateProgressField()
+void ConvListViewItem::updateContent()
+{
+ updateFields(bubbleContentPart, ELM_GENLIST_ITEM_FIELD_CONTENT);
+}
+
+void ConvListViewItem::updateProgress()
{
updateFields(infoStatus, ELM_GENLIST_ITEM_FIELD_CONTENT);
}