1 |
#ifndef ABSTRACTWIZARD_H |
2 |
#define ABSTRACTWIZARD_H |
3 |
|
4 |
#include "logger.h" |
5 |
|
6 |
#include <QLabel> |
7 |
#include <QVBoxLayout> |
8 |
#include <QLineEdit> |
9 |
#include <QRect> |
10 |
#include <QDesktopWidget> |
11 |
#include <QTextStream> |
12 |
#include <QSettings> |
13 |
#include <QWizard> |
14 |
#include <QIcon> |
15 |
#include <QPushButton> |
16 |
|
17 |
// This abstract class allow us to re-use most of the code used in wizards. |
18 |
// To create wizard use the WizardFactory class available in "wizardfactory.h" |
19 |
class AbstractWizard: public QObject // for signals and slots |
20 |
{ |
21 |
Q_OBJECT // for signals and slots |
22 |
protected: |
23 |
QWizard myWizard; |
24 |
QString workspaceWizardLocation; |
25 |
QSettings *vagoSettings; |
26 |
Logger *myLogger; |
27 |
QString appDir; |
28 |
protected: |
29 |
AbstractWizard(const QString &appDir, const QString &workspaceWizardLocation, QSettings *vagoSettings, Logger *myLogger, const bool hasRestartButton); |
30 |
virtual void exec()=0; |
31 |
void showWizard(const QString &windowsTitle, const QString &windowsIcon); |
32 |
QWizardPage* createIntroPage(const QString &text); |
33 |
virtual void beforeClose(QDialog::DialogCode resultStatus)=0; |
34 |
protected slots: |
35 |
void wizardFinished(int resultStatus); |
36 |
private: |
37 |
bool hasRestartButton; |
38 |
private slots: |
39 |
void pageChanged(int pageId); |
40 |
void restartWizard(); |
41 |
}; |
42 |
|
43 |
#endif // ABSTRACTWIZARD_H |