Route and Results buttons updated.
[speedfreak] / Client / helpaccelerationdialog.cpp
1 #include "helpaccelerationdialog.h"
2 #include "ui_helpaccelerationdialog.h"
3
4 HelpAccelerationDialog::HelpAccelerationDialog(QWidget *parent) :
5     QDialog(parent),
6     ui(new Ui::HelpAccelerationDialog)
7 {
8     ui->setupUi(this);
9     pageCounter = 0;
10     ui->labelLast->hide();
11     ui->pushButtonLast->hide();
12
13     ui->labelInfo2->hide();
14     ui->labelStartPic->hide();
15
16     ui->labelInfo3->hide();
17     ui->labelMeasurePic->hide();
18
19     ui->labelInfo4->hide();
20 }
21
22 HelpAccelerationDialog::~HelpAccelerationDialog()
23 {
24     delete ui;
25 }
26
27 void HelpAccelerationDialog::changeEvent(QEvent *e)
28 {
29     QDialog::changeEvent(e);
30     switch (e->type()) {
31     case QEvent::LanguageChange:
32         ui->retranslateUi(this);
33         break;
34     default:
35         break;
36     }
37 }
38
39 void HelpAccelerationDialog::on_pushButtonNext_clicked()
40 {
41     pageCounter ++;
42
43     if(pageCounter == 1)
44     {
45         ui->labelCalibratePic->hide();
46         ui->labelInfo1->hide();
47
48         ui->labelLast->show();
49         ui->pushButtonLast->show();
50         ui->labelInfo2->show();
51         ui->labelStartPic->show();
52     }
53
54     if(pageCounter == 2)
55     {
56         ui->labelCalibratePic->hide();
57         ui->labelInfo1->hide();
58         ui->labelInfo2->hide();
59         ui->labelStartPic->hide();
60
61         ui->labelLast->show();
62         ui->pushButtonLast->show();
63         ui->labelInfo3->show();
64         ui->labelMeasurePic->show();
65     }
66
67     if(pageCounter == 3)
68     {
69         ui->labelCalibratePic->hide();
70         ui->labelInfo1->hide();
71         ui->labelInfo2->hide();
72         ui->labelStartPic->hide();
73
74         //ui->labelLast->hide();
75         //ui->pushButtonLast->hide();
76         ui->labelInfo3->hide();
77         ui->labelMeasurePic->hide();
78
79         ui->pushButtonNext->hide();
80         ui->labelNext->hide();
81
82         ui->labelInfo4->show();
83     }
84 }
85
86 void HelpAccelerationDialog::on_pushButtonLast_clicked()
87 {
88     pageCounter --;
89
90     if(pageCounter == 0)
91     {
92         ui->labelCalibratePic->show();
93         ui->labelInfo1->show();
94         ui->labelStartPic->hide();
95         ui->labelLast->hide();
96         ui->pushButtonLast->hide();
97         ui->labelInfo2->hide();
98         ui->labelInfo3->hide();
99         ui->labelMeasurePic->hide();
100     }
101
102     if(pageCounter == 1)
103     {
104         ui->labelCalibratePic->hide();
105         ui->labelInfo1->hide();
106         ui->labelInfo3->hide();
107         ui->labelMeasurePic->hide();
108
109         ui->labelLast->show();
110         ui->pushButtonLast->show();
111         ui->labelInfo2->show();
112         ui->labelStartPic->show();
113     }
114
115     if(pageCounter == 2)
116     {
117         ui->labelCalibratePic->hide();
118         ui->labelInfo1->hide();
119         ui->labelInfo3->hide();
120         ui->labelMeasurePic->hide();
121         ui->labelInfo4->hide();
122
123         ui->pushButtonNext->show();
124         ui->labelNext->show();
125
126         ui->labelLast->show();
127         ui->pushButtonLast->show();
128         ui->labelInfo2->hide();
129         ui->labelStartPic->hide();
130
131         ui->labelInfo3->show();
132         ui->labelMeasurePic->show();
133     }
134 }