summaryrefslogtreecommitdiff
path: root/ui/batchStatusHandler.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:00:50 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:00:50 +0200
commit4ecfd41e36533d858c98d051ef70cab80e69e972 (patch)
treeca07d8745967d2c6a7123a5d32269cfbfaa7bd6c /ui/batchStatusHandler.cpp
parent2.2 (diff)
downloadFreeFileSync-4ecfd41e36533d858c98d051ef70cab80e69e972.tar.gz
FreeFileSync-4ecfd41e36533d858c98d051ef70cab80e69e972.tar.bz2
FreeFileSync-4ecfd41e36533d858c98d051ef70cab80e69e972.zip
2.3
Diffstat (limited to 'ui/batchStatusHandler.cpp')
-rw-r--r--ui/batchStatusHandler.cpp48
1 files changed, 31 insertions, 17 deletions
diff --git a/ui/batchStatusHandler.cpp b/ui/batchStatusHandler.cpp
index 294613dd..4abc49eb 100644
--- a/ui/batchStatusHandler.cpp
+++ b/ui/batchStatusHandler.cpp
@@ -4,10 +4,11 @@
#include "../algorithm.h"
#include <wx/ffile.h>
#include <wx/msgdlg.h>
-#include "../shared/globalFunctions.h"
+#include "../shared/systemConstants.h"
#include "../shared/standardPaths.h"
#include "../shared/fileHandling.h"
#include "../library/resources.h"
+#include "../shared/globalFunctions.h"
class LogFile
@@ -259,12 +260,14 @@ private:
//##############################################################################################################################
BatchStatusHandlerSilent::BatchStatusHandlerSilent(const xmlAccess::OnError handleError, const wxString& logfileDirectory, int& returnVal) :
- m_handleError(handleError),
+ m_handleError(xmlAccess::ON_ERROR_POPUP),
currentProcess(StatusHandler::PROCESS_NONE),
returnValue(returnVal),
trayIcon(new FfsTrayIcon(this)),
m_log(new LogFile(logfileDirectory))
{
+ setErrorStrategy(handleError);
+
//test if log was instantiated successfully
if (!m_log->isOkay())
{ //handle error: file load
@@ -446,6 +449,12 @@ void BatchStatusHandlerSilent::addFinalInfo(const wxString& infoMessage)
}
+void BatchStatusHandlerSilent::setErrorStrategy(xmlAccess::OnError handleError)
+{
+ m_handleError = handleError;
+}
+
+
void BatchStatusHandlerSilent::forceUiRefresh()
{
trayIcon->updateSysTray(); //needed by sys-tray icon only
@@ -466,21 +475,7 @@ BatchStatusHandlerGui::BatchStatusHandlerGui(const xmlAccess::OnError handleErro
currentProcess(StatusHandler::PROCESS_NONE),
returnValue(returnVal)
{
- switch (handleError)
- {
- case xmlAccess::ON_ERROR_POPUP:
- showPopups = true;
- break;
-
- case xmlAccess::ON_ERROR_EXIT: //doesn't make much sense for "batch gui"-mode
- showPopups = true;
- break;
-
- case xmlAccess::ON_ERROR_IGNORE:
- showPopups = false;
- break;
- }
-
+ setErrorStrategy(handleError);
syncStatusFrame = new SyncStatus(this, NULL);
syncStatusFrame->Show();
@@ -684,3 +679,22 @@ void BatchStatusHandlerGui::addFinalInfo(const wxString& infoMessage)
{
finalInfo = infoMessage;
}
+
+
+void BatchStatusHandlerGui::setErrorStrategy(xmlAccess::OnError handleError) //change error handling during process
+{
+ switch (handleError)
+ {
+ case xmlAccess::ON_ERROR_POPUP:
+ showPopups = true;
+ break;
+
+ case xmlAccess::ON_ERROR_EXIT: //doesn't make much sense for "batch gui"-mode
+ showPopups = true;
+ break;
+
+ case xmlAccess::ON_ERROR_IGNORE:
+ showPopups = false;
+ break;
+ }
+}
bgstack15