Index: sources/storage/TreatmentLog.cpp =================================================================== diff -u -rec7f919fdb70ff29a8de627937e4ad7008e59c1c -r86e9dfbff50cb7e16fd94c16c1c818cef3b47eac --- sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision ec7f919fdb70ff29a8de627937e4ad7008e59c1c) +++ sources/storage/TreatmentLog.cpp (.../TreatmentLog.cpp) (revision 86e9dfbff50cb7e16fd94c16c1c818cef3b47eac) @@ -363,18 +363,29 @@ bool TreatmentLog::exportLog() { bool ok = true; - QString dstPath = Storage::USB_Mount_Point ; - dstPath += Storage::Log_Folder_Treatment ; - QString srcFile = _lastTxInfo.mFileName ; - QString dstFile = dstPath + QFileInfo(srcFile).fileName(); + QString status = ""; + QString dstPath = Storage::USB_Mount_Point ; + dstPath += Storage::Log_Folder_Treatment ; + QString srcFile = _lastTxInfo.mFileName ; + QString srcFileName = QFileInfo(srcFile).fileName() ; + QString dstFile = dstPath + srcFileName; // HERE: expose to the UI dialog as the rejection/notification result - if ( ! Storage::FileHandler::makeFolder ( dstPath ) ) { LOG_DEBUG ( QString( "Couldn't create folder on USB drive to export TxLog" ) ); ok = false; goto lOut; } - if ( ! QFileInfo::exists ( srcFile ) ) { LOG_DEBUG ( QString( "TxLog '%1' doesn't exist" ).arg( srcFile ) ); ok = false; goto lOut; } - if ( QFileInfo::exists ( dstFile ) ) { LOG_DEBUG ( QString( "TxLog '%1' already exists" ).arg( dstFile ) ); ok = false; goto lOut; } - if ( ! QFile::copy (srcFile, dstFile ) ) { LOG_DEBUG ( QString( "Unable to Export TxLog '%1' to '%2'" ).arg( srcFile ).arg( dstFile ) ); ok = false; goto lOut; } + if ( ! Storage::FileHandler::makeFolder ( dstPath ) ) { status = QString( "Couldn't create folder on USB drive to export TxLog" ); ok = false; goto lOut; } + if ( ! QFileInfo::exists ( srcFile ) ) { status = QString( "Treatment Log '%1' doesn't exist" ).arg( srcFile ); ok = false; goto lOut; } + if ( QFileInfo::exists ( dstFile ) ) { status = QString( "Treatment Log '%1' already exists" ).arg( dstFile ); ok = false; goto lOut; } + if ( ! QFile::copy (srcFile, dstFile ) ) { status = QString( "Unable to Export TxLog '%1' to '%2'" ).arg( srcFile ).arg( dstFile ); ok = false; goto lOut; } lOut: - if ( ! ok ) LOG_EVENT_UI ( QString( "Unable to Export TxLog" )); + if ( ! ok ) { + LOG_DEBUG(status); + status = "Unable to export treatment log '" + srcFileName +"'"; + } + else { + status = "Treatment log '" + srcFileName + "' exported successfully"; + LOG_EVENT_UI(status); + } + + emit didNotification(status); return ok; }