diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:56:14 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:56:14 +0200 |
commit | 1046c195a9bbac24678c06310a4dd56b10347244 (patch) | |
tree | 89ad9f6fe3e538d65ef973b628ed9284b6c99e9f /Application.h | |
parent | 1.14 (diff) | |
download | FreeFileSync-1046c195a9bbac24678c06310a4dd56b10347244.tar.gz FreeFileSync-1046c195a9bbac24678c06310a4dd56b10347244.tar.bz2 FreeFileSync-1046c195a9bbac24678c06310a4dd56b10347244.zip |
1.15
Diffstat (limited to 'Application.h')
-rw-r--r-- | Application.h | 78 |
1 files changed, 58 insertions, 20 deletions
diff --git a/Application.h b/Application.h index fbb46f4b..e1b12172 100644 --- a/Application.h +++ b/Application.h @@ -24,49 +24,87 @@ public: bool OnExceptionInMainLoop(); void initialize(); - bool ProcessIdle(); //virtual method! + + bool ProcessIdle(); //virtual impl. private: void runBatchMode(const wxString& filename, xmlAccess::XmlGlobalSettings& globalSettings); - bool applicationRunsInBatchWithoutWindows; CustomLocale programLanguage; int returnValue; xmlAccess::XmlGlobalSettings globalSettings; //settings used by GUI, batch mode or both }; -class LogFile; -class BatchStatusUpdater : public StatusHandler +class BatchStatusHandler : public StatusHandler +{ +public: + BatchStatusHandler() {} + virtual ~BatchStatusHandler() {} + + enum ExitCode + { + NONE, + ABORTED, + FINISHED + }; + virtual void exitAndSetStatus(const wxString& message, ExitCode code) = 0; //overwrite final status message text +}; + + +class LogFile; +class BatchStatusHandlerSilent : public BatchStatusHandler { public: - BatchStatusUpdater(bool ignoreAllErrors, bool silent, LogFile* log); - ~BatchStatusUpdater(); + BatchStatusHandlerSilent(bool ignoreAllErrors, LogFile* log, int& returnVal); + ~BatchStatusHandlerSilent(); + - virtual void updateStatusText(const wxString& text); - virtual void initNewProcess(int objectsTotal, double dataTotal, Process processID); - virtual void updateProcessedData(int objectsProcessed, double dataProcessed); - virtual ErrorHandler::Response reportError(const wxString& text); - virtual void forceUiRefresh(); + void updateStatusText(const Zstring& text); //virtual impl. + void initNewProcess(int objectsTotal, double dataTotal, Process processID); //virtual impl. + void updateProcessedData(int objectsProcessed, double dataProcessed) {} //virtual impl. + ErrorHandler::Response reportError(const Zstring& text); //virtual impl. + void forceUiRefresh() {} //virtual impl. - wxWindow* getWindow(); - void setFinalStatus(const wxString& message, SyncStatus::SyncStatusID id); //overwrite final status message text + void exitAndSetStatus(const wxString& message, ExitCode code); //abort externally //virtual impl. private: - virtual void abortThisProcess(); + void abortThisProcess(); //virtual impl. - LogFile* m_log; - SyncStatus* syncStatusFrame; bool ignoreErrors; - bool silentMode; - wxArrayString unhandledErrors; //list of non-resolved errors Process currentProcess; + int& returnValue; - wxString customStatusMessage; //final status message written by service consumer - SyncStatus::SyncStatusID customStatusId; + LogFile* m_log; }; +class BatchStatusHandlerGui : public BatchStatusHandler +{ +public: + BatchStatusHandlerGui(bool ignoreAllErrors, int& returnVal); + ~BatchStatusHandlerGui(); + + void updateStatusText(const Zstring& text); //virtual impl. + void initNewProcess(int objectsTotal, double dataTotal, Process processID); //virtual impl. + void updateProcessedData(int objectsProcessed, double dataProcessed); //virtual impl. + ErrorHandler::Response reportError(const Zstring& text); //virtual impl. + void forceUiRefresh(); //virtual impl. + + void exitAndSetStatus(const wxString& message, ExitCode code); //abort externally //virtual impl. + +private: + void abortThisProcess(); //virtual impl. + + bool ignoreErrors; + wxArrayString unhandledErrors; //list of non-resolved errors + Process currentProcess; + int& returnValue; + + SyncStatus* syncStatusFrame; + wxString additionalStatusInfo; //workaround to display "Nothing to synchronize..." +}; + #endif // FREEFILESYNCAPP_H |