yet not working button to download offered files

This commit is contained in:
Blue 2019-09-12 23:54:44 +03:00
parent 1df49583fb
commit 59f539c460
10 changed files with 199 additions and 8 deletions

View file

@ -149,6 +149,11 @@ MessageLine::Position MessageLine::message(const Shared::Message& msg)
layout->insertLayout(index, message);
}
if (msg.hasOutOfBandUrl()) {\
emit requestLocalFile(msg.getId(), msg.getOutOfBandUrl());
connect(message, SIGNAL(downloadFile(const QString&, const QString&)), this, SIGNAL(downloadFile(const QString&, const QString&)));
}
return res;
}
@ -217,3 +222,27 @@ void MessageLine::onAnimationValueChanged(const QVariant& value)
{
busyPixmap->setRotation(value.toReal());
}
void MessageLine::responseDownloadProgress(const QString& messageId, qreal progress)
{
Index::const_iterator itr = messageIndex.find(messageId);
if (itr == messageIndex.end()) {
} else {
itr->second->setProgress(progress);
}
}
void MessageLine::responseLocalFile(const QString& messageId, const QString& path)
{
Index::const_iterator itr = messageIndex.find(messageId);
if (itr == messageIndex.end()) {
} else {
if (path.size() > 0) {
itr->second->showFile(path);
} else {
itr->second->addDownloadDialog();
}
}
}