forked from solderinskater/C---Port
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecordwidget.h
62 lines (50 loc) · 1.55 KB
/
recordwidget.h
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
61
62
#ifndef RECORDWIDGET_H
#define RECORDWIDGET_H
#include <QWidget>
#include <QtGui>
#include "buttons.h"
#include "trickmanager.h"
class RecordWidget : public QWidget
{
Q_OBJECT
public:
explicit RecordWidget(QWidget *parent = 0);
void newTrickMode();
void editTrickMode(QString trick_name);
/// Can be called after the save() signal to get the trick data which was entered.
TrickManager::Trick getEnteredTrick();
/// Returns true if a new trick was created and false if an existing trick was modified.
bool isNewTrick();
/// Returns the name of the trick that was edited. "" if trick was newly created.
QString getOldTrickName();
signals:
/// save button was pressed
void saveClicked();
/// cancel button was pressed
void cancelClicked();
public slots:
void recordClicked();
protected slots:
/// checks all input data, shows error messages and enables/disables the save button.
void checkInputs();
void addData(QString);
protected:
void trainTrick();
void showEvent ( QShowEvent * event );
void extractTrick();
private:
QGridLayout *capGrid;
QVBoxLayout *vbox;
QHBoxLayout *hbox;
ShinyButton *saveBtn, *cancelBtn;
QPushButton *trainBtn;
QLineEdit *nameEdit, *pointsEdit;
SkateLabel *titleLabel, *patternStatusLabel;
SkateLabel *nameErrorLabel, *pointsErrorLabel, *patternErrorLabel;
QList<QList<int> > recordedData;
TrickManager *trickManager;
bool new_trick_mode;
QString old_trick_name;
QList<int> pattern;
};
#endif // RECORDWIDGET_H