00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef QBANKING_PROGRESSWIDGET_H
00014 #define QBANKING_PROGRESSWIDGET_H
00015
00016
00017 #include "qguiprogresswidget.ui.h"
00018
00019 #include <QCloseEvent>
00020 #include <gwenhywfar/types.h>
00021 #include <gwenhywfar/gui.h>
00022
00023 #include <time.h>
00024
00025
00026 #define QGUI_PROGRESS_SHOWTIMEOUT 5
00027
00028 #define QGUI_PROGRESS_FLAGS_SHOW_TEXT 0x00000001
00029
00030
00031 class QGuiProgress;
00032 class QString;
00033
00034
00035 class QGuiProgressWidget: public QWidget, public Ui_QGuiProgressWidgetUI {
00036 Q_OBJECT
00037 private:
00038 bool _aborted;
00039 bool _shouldStay;
00040 bool _doShowText;
00041 QString _logtext;
00042 time_t _startTime;
00043 time_t _lastTime;
00044 QGuiProgress *_currentSubProgress;
00045
00046 std::list<QGuiProgress*> _progressPtrList;
00047
00048 static int _openCount;
00049
00050 bool _handleTime();
00051 void _selectSublevel();
00052
00053 protected:
00054 virtual void closeEvent(QCloseEvent *e);
00055
00056 public:
00057 QGuiProgressWidget(QGuiProgress *firstProgress,
00058 const QString &title,
00059 const QString &text,
00060 QWidget* parent=0, const char* name=0, Qt::WFlags fl=0);
00061 ~QGuiProgressWidget();
00062
00063 void addProgress(QGuiProgress *pr);
00064 void delProgress(QGuiProgress *pr);
00065
00066 void check();
00067
00068 int log(GWEN_LOGGER_LEVEL level,
00069 const QString& text);
00070
00071 int checkAbort();
00072
00073 bool aborted() const { return _aborted;};
00074 bool shouldStay() const { return _shouldStay;};
00075 bool hasProgresses() const;
00076
00077 protected slots:
00078 void abort();
00079 };
00080
00081
00082
00083
00084
00085
00086
00087 #endif
00088
00089
00090
00091