Commit e161e8d40318ce82786f6e44b041415c7ae87376
1 parent
89f0ad175e
Exists in
master
and in
2 other branches
버그 수정
- 체크된 버튼을 다시 눌렀을 때 체크가 풀리는 문제 수정
Showing
1 changed file
with
33 additions
and
15 deletions
Show diff stats
app/gui/oven_control/primewindow.cpp
@@ -140,29 +140,47 @@ void PrimeWindow::keyReleaseEvent(QKeyEvent *event) | @@ -140,29 +140,47 @@ void PrimeWindow::keyReleaseEvent(QKeyEvent *event) | ||
140 | 140 | ||
141 | void PrimeWindow::on_mostCookedButton_toggled(bool checked) | 141 | void PrimeWindow::on_mostCookedButton_toggled(bool checked) |
142 | { | 142 | { |
143 | - if (!checked) | ||
144 | - return; | ||
145 | - | ||
146 | -// listButtons(CookHistory::listMostCooked()); | ||
147 | - listMostCooked(); | 143 | + if (checked) |
144 | + listMostCooked(); | ||
145 | + else | ||
146 | + { | ||
147 | + if (!ui->recentsButton->isChecked() && !ui->favoritesButton->isChecked()) | ||
148 | + { | ||
149 | + ui->mostCookedButton->blockSignals(true); | ||
150 | + ui->mostCookedButton->setChecked(true); | ||
151 | + ui->mostCookedButton->blockSignals(false); | ||
152 | + } | ||
153 | + } | ||
148 | } | 154 | } |
149 | 155 | ||
150 | void PrimeWindow::on_recentsButton_toggled(bool checked) | 156 | void PrimeWindow::on_recentsButton_toggled(bool checked) |
151 | { | 157 | { |
152 | - if (!checked) | ||
153 | - return; | ||
154 | - | ||
155 | -// listButtons(CookHistory::listRecents()); | ||
156 | - listRecents(); | 158 | + if (checked) |
159 | + listRecents(); | ||
160 | + else | ||
161 | + { | ||
162 | + if (!ui->mostCookedButton->isChecked() && !ui->favoritesButton->isChecked()) | ||
163 | + { | ||
164 | + ui->recentsButton->blockSignals(true); | ||
165 | + ui->recentsButton->setChecked(true); | ||
166 | + ui->recentsButton->blockSignals(false); | ||
167 | + } | ||
168 | + } | ||
157 | } | 169 | } |
158 | 170 | ||
159 | void PrimeWindow::on_favoritesButton_toggled(bool checked) | 171 | void PrimeWindow::on_favoritesButton_toggled(bool checked) |
160 | { | 172 | { |
161 | - if (!checked) | ||
162 | - return; | ||
163 | - | ||
164 | -// listButtons(CookHistory::listFavorites()); | ||
165 | - listFavorites(); | 173 | + if (checked) |
174 | + listFavorites(); | ||
175 | + else | ||
176 | + { | ||
177 | + if (!ui->mostCookedButton->isChecked() && !ui->recentsButton->isChecked()) | ||
178 | + { | ||
179 | + ui->favoritesButton->blockSignals(true); | ||
180 | + ui->favoritesButton->setChecked(true); | ||
181 | + ui->favoritesButton->blockSignals(false); | ||
182 | + } | ||
183 | + } | ||
166 | } | 184 | } |
167 | 185 | ||
168 | void PrimeWindow::listButtons(QList<CookRecord> records) | 186 | void PrimeWindow::listButtons(QList<CookRecord> records) |