summaryrefslogtreecommitdiff
path: root/library/statusHandler.h
diff options
context:
space:
mode:
Diffstat (limited to 'library/statusHandler.h')
-rw-r--r--library/statusHandler.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/library/statusHandler.h b/library/statusHandler.h
index bae1de8e..208a2df8 100644
--- a/library/statusHandler.h
+++ b/library/statusHandler.h
@@ -10,7 +10,7 @@ bool updateUiIsAllowed(); //test if a specific amount of time is over
void updateUiNow(); //do the updating
-//interfaces for status updates (can be implemented by UI or commandline)
+//interfaces for status updates (can be implemented by GUI or Batch mode)
//overwrite virtual methods for respective functionality
class ErrorHandler
@@ -24,15 +24,14 @@ public:
IGNORE_ERROR = 10,
RETRY
};
- virtual Response reportError(const Zstring& text) = 0;
+ virtual Response reportError(const Zstring& errorMessage) = 0;
};
class StatusHandler
{
public:
- StatusHandler() :
- abortRequested(false) {}
+ StatusHandler() : abortRequested(false) {}
virtual ~StatusHandler() {}
//identifiers of different processes
@@ -48,7 +47,6 @@ public:
virtual void updateStatusText(const Zstring& text) = 0;
virtual void initNewProcess(int objectsTotal, double dataTotal, Process processID) = 0; //informs about the total amount of data that will be processed from now on
virtual void updateProcessedData(int objectsProcessed, double dataProcessed) = 0; //called periodically after data was processed
- virtual ErrorHandler::Response reportError(const Zstring& text) = 0;
//this method is triggered repeatedly by requestUiRefresh() and can be used to refresh the ui by dispatching pending events
virtual void forceUiRefresh() = 0;
@@ -66,6 +64,11 @@ public:
abortRequested = true;
}
+ //error handling:
+ virtual ErrorHandler::Response reportError(const Zstring& errorMessage) = 0; //recoverable error situation
+ virtual void reportFatalError(const Zstring& errorMessage) = 0; //non-recoverable error situation, implement abort!
+ virtual void reportWarning(const Zstring& warningMessage, bool& dontShowAgain) = 0;
+
protected:
virtual void abortThisProcess() = 0;
bgstack15