summaryrefslogtreecommitdiff
path: root/Application.h
diff options
context:
space:
mode:
Diffstat (limited to 'Application.h')
-rw-r--r--Application.h78
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
bgstack15