From de8d532adba6597b5c60b7935896b9238f5600d6 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Mon, 9 Dec 2013 16:07:00 +0200 Subject: Divelogs.de: Improve the error handling post DLD creation Only show a filename in the error report if such was previsly set. We also add a string for translation, that is shown in the main window. Signed-off-by: Lubomir I. Ivanov --- qt-ui/subsurfacewebservices.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qt-ui') diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp index 952927e8c..c114c80eb 100644 --- a/qt-ui/subsurfacewebservices.cpp +++ b/qt-ui/subsurfacewebservices.cpp @@ -539,6 +539,7 @@ void DivelogsDeWebServices::downloadDives() void DivelogsDeWebServices::prepareDivesForUpload() { + QString errorText(tr("Cannot create DLD file")); char *filename = prepare_dives_for_divelogs(true); if (filename) { QFile f(filename); @@ -549,8 +550,10 @@ void DivelogsDeWebServices::prepareDivesForUpload() f.remove(); return; } - mainWindow()->showError(QString("Cannot create file: ").append(filename)); + mainWindow()->showError(errorText.append(": ").append(filename)); + return; } + mainWindow()->showError(errorText.append("!")); } void DivelogsDeWebServices::uploadDives(QIODevice *dldContent) -- cgit v1.2.3-70-g09d2