diff options
author | jan Iversen <jan@casacondor.com> | 2019-12-09 13:52:34 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-11 12:36:43 -0500 |
commit | 5a4128a8f2878a5e3b0906c8d0e58ba3fe3d4666 (patch) | |
tree | e672bc698d5eec099d0ff36ff4383ec4dac220b5 /core | |
parent | 9fd95c18bd08dd6d197c9e02a302dc97bd221f44 (diff) | |
download | subsurface-5a4128a8f2878a5e3b0906c8d0e58ba3fe3d4666.tar.gz |
core: add uploadStatus signal to uploadDiveLogsDE
The uploadStatus signal can be used to inform the user about
the process e.g.
- preparing zip file
- starting actual upload
It is a suplement to uploadProgress, that only informs about
the network part.
Signed-off-by: Jan Iversen <jan@casacondor.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/uploadDiveLogsDE.cpp | 4 | ||||
-rw-r--r-- | core/uploadDiveLogsDE.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/core/uploadDiveLogsDE.cpp b/core/uploadDiveLogsDE.cpp index 29877af70..5e614d168 100644 --- a/core/uploadDiveLogsDE.cpp +++ b/core/uploadDiveLogsDE.cpp @@ -74,6 +74,8 @@ bool uploadDiveLogsDE::prepareDives(const QString &tempfile, const bool selected xsltStylesheetPtr xslt = NULL; struct zip *zip; + emit uploadStatus(tr("building zip file to upload")); + xslt = get_stylesheet("divelogs-export.xslt"); if (!xslt) { qDebug() << errPrefix << "missing stylesheet"; @@ -214,6 +216,8 @@ void uploadDiveLogsDE::uploadDives(const QString &filename, const QString &useri } multipart = new QHttpMultiPart(QHttpMultiPart::FormDataType); + emit uploadStatus(tr("Uploading dives")); + // prepare header with filename (of all dives) and pointer to file args = "form-data; name=\"userfile\"; filename=\"" + filename + "\""; part1.setRawHeader("Content-Disposition", args.toLatin1()); diff --git a/core/uploadDiveLogsDE.h b/core/uploadDiveLogsDE.h index 48491d06e..88022b734 100644 --- a/core/uploadDiveLogsDE.h +++ b/core/uploadDiveLogsDE.h @@ -25,6 +25,7 @@ private slots: signals: void uploadFinish(bool success, const QString &text); void uploadProgress(qreal percentage, qreal total); + void uploadStatus(const QString &text); private: uploadDiveLogsDE(); |