00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef BASICDIALOG_H
00023 #define BASICDIALOG_H
00024
00025 #include <QDialog>
00026 #include <QString>
00027 #include <QTime>
00028
00029 class QTimeEdit;
00030 class QSpinBox;
00031 class QCheckBox;
00032 class QLabel;
00033
00047 class BasicDialog : public QDialog
00048 {
00049 Q_OBJECT
00050 public:
00054 BasicDialog(QString timeContolName, QWidget *parent = 0);
00055
00056 void disableAddition();
00057 void disablePerTurns();
00058 void disableUnEquals();
00059
00060 int getWhiteInitial();
00061 int getBlackInitial();
00062 int getWhiteAddition();
00063 int getBlackAddition();
00064 int getWhitePerTurns();
00065 int getBlackPerTurns();
00067 void store();
00069 void init(QTime whiteInitial=QTime(1,30),
00070 QTime blackInitial=QTime(1,30),
00071 QTime whiteAddition=QTime(0,0,30),
00072 QTime blackAddition=QTime(0,0,30),
00073 int whitePerTurns = 1,
00074 int blackPerTurns = 1);
00075 signals:
00076
00077 public slots:
00078 void setEquals();
00079
00080 protected:
00081 static QTimeEdit* initTimeEdit();
00082 static int toMsecs(QTimeEdit* timeEdit);
00083
00084 public:
00085 QTimeEdit *whiteInitial_, *blackInitial_;
00086 QTimeEdit *whiteAddition_, *blackAddition_;
00087 QSpinBox *whiteTurns_, *blackTurns_;
00088 QCheckBox *equals_;
00089
00090 QLabel *initialLabel_, *additionLabel_, *perTurnLabel_, *equalsLabel_;
00091 QLabel *whiteLabel_, *blackLabel_;
00092
00093 protected:
00094 QString timeControlName_;
00095
00096
00097 };
00098
00099 #endif // BASICDIALOG_H