Commit 991ca774 authored by Martin Straka's avatar Martin Straka

Added attachments saving notification

parent b324da9c
......@@ -383,10 +383,30 @@ void Files::saveAttachmentsToDisk(const QString &userName, qint64 msgId)
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
#endif
QString destPath;
foreach (const FileDb::FileData &file, filelist) {
QByteArray data = QByteArray::fromBase64(file.content.toUtf8());
writeFileToDir(path, file.filename, msgId, data);
destPath = writeFileToDir(path, file.filename, msgId, data);
}
QFileInfo fi(destPath);
QMessageBox msgBox;
msgBox.setWindowTitle(tr("Attachments saving"));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
if (!destPath.isEmpty()) {
msgBox.setIcon(QMessageBox::Information);
msgBox.setText(tr("Attachments have been saved."));
msgBox.setInformativeText(tr("Path: '%1'").arg(fi.absolutePath()));
} else {
msgBox.setIcon(QMessageBox::Critical);
msgBox.setText(tr("Attachments have not been saved!"));
msgBox.setInformativeText(tr("Path: '%1'").arg(fi.absolutePath()));
}
msgBox.exec();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment