summaryrefslogtreecommitdiff
path: root/ui/guiStatusHandler.h
blob: 51a87c98d386c0eae1a157aaca59a505ab459de4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef GUISTATUSHANDLER_H_INCLUDED
#define GUISTATUSHANDLER_H_INCLUDED

#include "../library/statusHandler.h"
#include <wx/arrstr.h>

class SyncStatus;
class MainDialog;
class wxWindow;

//classes handling sync and compare error as well as status information
class CompareStatusHandler : public StatusHandler
{
public:
    CompareStatusHandler(MainDialog* dlg);
    ~CompareStatusHandler();

    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& text);
    virtual void reportFatalError(const Zstring& errorMessage);
    virtual void reportWarning(const Zstring& warningMessage, bool& dontShowAgain);

private:
    virtual void abortThisProcess();

    MainDialog* mainDialog;
    bool ignoreErrors;
    Process currentProcess;
};


class SyncStatusHandler : public StatusHandler
{
public:
    SyncStatusHandler(wxWindow* dlg, bool ignoreAllErrors);
    ~SyncStatusHandler();

    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& text);
    virtual void reportFatalError(const Zstring& errorMessage);
    virtual void reportWarning(const Zstring& warningMessage, bool& dontShowAgain);

private:
    virtual void abortThisProcess();

    SyncStatus* syncStatusFrame;
    bool ignoreErrors;
    wxArrayString unhandledErrors;   //list of non-resolved errors
};


#endif // GUISTATUSHANDLER_H_INCLUDED
bgstack15