From d4af25c52a28b93484ffb55e0a8027bc4ce7856f Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:21:59 +0200 Subject: 5.9 --- ui/batch_status_handler.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'ui/batch_status_handler.cpp') diff --git a/ui/batch_status_handler.cpp b/ui/batch_status_handler.cpp index 594ffb7a..b33b0d80 100644 --- a/ui/batch_status_handler.cpp +++ b/ui/batch_status_handler.cpp @@ -135,7 +135,8 @@ BatchStatusHandler::BatchStatusHandler(bool showProgress, BatchStatusHandler::~BatchStatusHandler() { - const int totalErrors = errorLog.getItemCount(TYPE_ERROR | TYPE_FATAL_ERROR); //evaluate before finalizing log + const int totalErrors = errorLog.getItemCount(TYPE_ERROR | TYPE_FATAL_ERROR); //evaluate before finalizing log + const int totalWarnings = errorLog.getItemCount(TYPE_WARNING); //finalize error log std::wstring finalStatus; @@ -149,6 +150,12 @@ BatchStatusHandler::~BatchStatusHandler() { raiseReturnCode(returnCode_, FFS_RC_FINISHED_WITH_ERRORS); finalStatus = _("Synchronization completed with errors!"); + errorLog.logMsg(finalStatus, TYPE_ERROR); + } + else if (totalWarnings > 0) + { + raiseReturnCode(returnCode_, FFS_RC_FINISHED_WITH_WARNINGS); + finalStatus = _("Synchronization completed with warnings!"); errorLog.logMsg(finalStatus, TYPE_WARNING); } else @@ -190,7 +197,7 @@ BatchStatusHandler::~BatchStatusHandler() switchBatchToGui_.execute(); //open FreeFileSync GUI } catch (...) {} - syncStatusFrame.closeWindowDirectly(); //syncStatusFrame is main window => program will quit directly + syncStatusFrame.closeWindowDirectly(); //syncStatusFrame is not main window anymore } else { @@ -220,6 +227,8 @@ BatchStatusHandler::~BatchStatusHandler() syncStatusFrame.processHasFinished(SyncStatus::RESULT_ABORTED, errorLog); //enable okay and close events else if (totalErrors > 0) syncStatusFrame.processHasFinished(SyncStatus::RESULT_FINISHED_WITH_ERROR, errorLog); + else if (totalWarnings > 0) + syncStatusFrame.processHasFinished(SyncStatus::RESULT_FINISHED_WITH_WARNINGS, errorLog); else syncStatusFrame.processHasFinished(SyncStatus::RESULT_FINISHED_WITH_SUCCESS, errorLog); } -- cgit