programmingselectionwindow.cpp
3.23 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#include "programmingselectionwindow.h"
#include "ui_programmingselectionwindow.h"
#include "programmingmanualwindow.h"
#include "programmingautoselectionwindow.h"
#include "soundplayer.h"
ProgrammingSelectionWindow::ProgrammingSelectionWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::ProgrammingSelectionWindow)
{
ui->setupUi(this);
// ui->clockContainer->setParent(ui->upperStack);
setAttribute(Qt::WA_DeleteOnClose);
setFocus();
foreach (QPushButton *button, findChildren<QPushButton *>())
connect(button, &QPushButton::pressed, SoundPlayer::playClick);
}
ProgrammingSelectionWindow::~ProgrammingSelectionWindow()
{
delete ui;
}
void ProgrammingSelectionWindow::setModeEnabled(bool enabled)
{
ui->steamButton->setEnabled(enabled);
ui->combiButton->setEnabled(enabled);
ui->dryheatButton->setEnabled(enabled);
}
void ProgrammingSelectionWindow::setCookTypeEnabled(bool enabled)
{
ui->poultryButton->setEnabled(enabled);
ui->meatButton->setEnabled(enabled);
ui->fishButton->setEnabled(enabled);
ui->dessertButton->setEnabled(enabled);
ui->grainButton->setEnabled(enabled);
ui->breadButton->setEnabled(enabled);
ui->etcButton->setEnabled(enabled);
}
void ProgrammingSelectionWindow::onModeClicked(Define::Mode mode)
{
ProgrammingManualWindow *w = new ProgrammingManualWindow(this, mode);
connect(w, SIGNAL(added()), SIGNAL(added()));
connect(w, SIGNAL(added()), SLOT(hide()));
connect(w, SIGNAL(added()), SLOT(close()));
w->setWindowModality(Qt::WindowModal);
w->showFullScreen();
w->raise();
}
void ProgrammingSelectionWindow::onCookTypeClicked(Define::CookType type)
{
ProgrammingAutoSelectionWindow *w = new ProgrammingAutoSelectionWindow(this, type);
connect(w, SIGNAL(added()), SIGNAL(added()));
connect(w, SIGNAL(added()), SLOT(hide()));
connect(w, SIGNAL(added()), SLOT(close()));
w->setWindowModality(Qt::WindowModal);
w->showFullScreen();
w->raise();
}
void ProgrammingSelectionWindow::on_steamButton_clicked()
{
onModeClicked(Define::SteamMode);
}
void ProgrammingSelectionWindow::on_combiButton_clicked()
{
onModeClicked(Define::CombiMode);
}
void ProgrammingSelectionWindow::on_dryheatButton_clicked()
{
onModeClicked(Define::DryMode);
}
void ProgrammingSelectionWindow::on_poultryButton_clicked()
{
onCookTypeClicked(Define::Poultry);
}
void ProgrammingSelectionWindow::on_meatButton_clicked()
{
onCookTypeClicked(Define::Meat);
}
void ProgrammingSelectionWindow::on_fishButton_clicked()
{
onCookTypeClicked(Define::Fish);
}
void ProgrammingSelectionWindow::on_dessertButton_clicked()
{
onCookTypeClicked(Define::Desert);
}
void ProgrammingSelectionWindow::on_grainButton_clicked()
{
onCookTypeClicked(Define::Vegetable);
}
void ProgrammingSelectionWindow::on_breadButton_clicked()
{
onCookTypeClicked(Define::Bread);
}
void ProgrammingSelectionWindow::on_etcButton_clicked()
{
onCookTypeClicked(Define::Etc);
}
void ProgrammingSelectionWindow::on_backButton_clicked()
{
close();
}
void ProgrammingSelectionWindow::on_configButton_clicked()
{
}
void ProgrammingSelectionWindow::on_helpButton_clicked()
{
}
void ProgrammingSelectionWindow::on_okButton_clicked()
{
close();
}