diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:57:45 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:57:45 +0200 |
commit | 2a3ebac62eb6dd88122c0f447ea90ce368373d3a (patch) | |
tree | fae5c18deaecfb6f39d4d66dd3de8ce730b2025b /ui/batchStatusHandler.h | |
parent | 1.17 (diff) | |
download | FreeFileSync-2a3ebac62eb6dd88122c0f447ea90ce368373d3a.tar.gz FreeFileSync-2a3ebac62eb6dd88122c0f447ea90ce368373d3a.tar.bz2 FreeFileSync-2a3ebac62eb6dd88122c0f447ea90ce368373d3a.zip |
1.18
Diffstat (limited to 'ui/batchStatusHandler.h')
-rw-r--r-- | ui/batchStatusHandler.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/ui/batchStatusHandler.h b/ui/batchStatusHandler.h new file mode 100644 index 00000000..7087d3c9 --- /dev/null +++ b/ui/batchStatusHandler.h @@ -0,0 +1,83 @@ +#ifndef BATCHSTATUSHANDLER_H_INCLUDED +#define BATCHSTATUSHANDLER_H_INCLUDED + +#include "../library/statusHandler.h" +#include <memory> +#include "../library/processXml.h" +#include <wx/arrstr.h> + +class LogFile; +class FfsTrayIcon; +class SyncStatus; + + +class BatchStatusHandler : public StatusHandler +{ +public: + BatchStatusHandler() {} + virtual ~BatchStatusHandler() {} + + virtual void addFinalInfo(const Zstring& infoMessage) = 0; +}; + + +class BatchStatusHandlerSilent : public BatchStatusHandler +{ +public: + BatchStatusHandlerSilent(const xmlAccess::OnError handleError, const wxString& logfileDirectory, int& returnVal); + ~BatchStatusHandlerSilent(); + + + virtual void updateStatusText(const Zstring& text); + virtual void initNewProcess(int objectsTotal, wxLongLong dataTotal, Process processID); + virtual void updateProcessedData(int objectsProcessed, wxLongLong dataProcessed) {} + virtual void forceUiRefresh(); + + virtual ErrorHandler::Response reportError(const Zstring& errorMessage); + virtual void reportFatalError(const Zstring& errorMessage); + virtual void reportWarning(const Zstring& warningMessage, bool& dontShowAgain); + virtual void addFinalInfo(const Zstring& infoMessage); + +private: + virtual void abortThisProcess(); + + xmlAccess::OnError m_handleError; + wxArrayString unhandledErrors; //list of non-resolved errors + Process currentProcess; + int& returnValue; + std::auto_ptr<FfsTrayIcon> trayIcon; + + std::auto_ptr<LogFile> m_log; +}; + + +class BatchStatusHandlerGui : public BatchStatusHandler +{ +public: + BatchStatusHandlerGui(const xmlAccess::OnError handleError, int& returnVal); + ~BatchStatusHandlerGui(); + + virtual void updateStatusText(const Zstring& text); + virtual void initNewProcess(int objectsTotal, wxLongLong dataTotal, Process processID); + virtual void updateProcessedData(int objectsProcessed, wxLongLong dataProcessed); + virtual void forceUiRefresh(); + + virtual ErrorHandler::Response reportError(const Zstring& errorMessage); + virtual void reportFatalError(const Zstring& errorMessage); + virtual void reportWarning(const Zstring& warningMessage, bool& dontShowAgain); + virtual void addFinalInfo(const Zstring& infoMessage); + +private: + virtual void abortThisProcess(); + + xmlAccess::OnError m_handleError; + wxArrayString unhandledErrors; //list of non-resolved errors + Process currentProcess; + int& returnValue; + + SyncStatus* syncStatusFrame; + wxString finalInfo; //workaround to display "Nothing to synchronize..." +}; + + +#endif // BATCHSTATUSHANDLER_H_INCLUDED |