From 5a4128a8f2878a5e3b0906c8d0e58ba3fe3d4666 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Mon, 9 Dec 2019 13:52:34 +0100 Subject: 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 --- core/uploadDiveLogsDE.cpp | 4 ++++ core/uploadDiveLogsDE.h | 1 + 2 files changed, 5 insertions(+) (limited to 'core') 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(); -- cgit v1.2.3-70-g09d2