00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef QTFRONTEND_H
00021 #define QTFRONTEND_H
00022
00023 #include "src/config.h"
00024 #include "src/presentation/frontends/frontend.h"
00025 #include "mainwindowgui.h"
00026
00027 #include <qprogressdialog.h>
00028 #include <qprogressbar.h>
00029 #include <qtimer.h>
00030 #include <qobject.h>
00031 #include <qapplication.h>
00032
00033
00039 class QtFrontend : public QObject, public Frontend
00040 {
00041 Q_OBJECT
00042 public:
00043
00049 QtFrontend(int argc, char **argv);
00050
00054 virtual ~QtFrontend();
00055
00062 int run(int argc, char **argv);
00063
00069 void showProgress(const char *infoText, unsigned int numOperations = 0);
00070
00074 void hideProgress();
00075
00080 void updateProgress(int numOperationsDone);
00081
00086 void setProgressInfo(const char *infoText);
00087
00093 bool isOperationAborted();
00094
00099 void processEvents();
00100
00107 void reportError(const char *message, int id);
00108
00114 int askQuestion(const char *question);
00115
00116 protected slots:
00117 void updateProgressBar();
00118
00119 private:
00120 QApplication *stApp;
00121 MainWindowGUI *mw;
00122 QProgressDialog *progressDialog;
00123 QProgressBar *progressBar;
00124 QLabel *infoText;
00125 QTimer *timer;
00126
00127 void initializePreferences();
00128 };
00129
00130 #endif