From e161e8d40318ce82786f6e44b041415c7ae87376 Mon Sep 17 00:00:00 2001
From: victor <taehoon@falinux.com>
Date: Wed, 14 Jun 2017 16:36:10 +0900
Subject: [PATCH] =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95=20-=20?=
 =?UTF-8?q?=EC=B2=B4=ED=81=AC=EB=90=9C=20=EB=B2=84=ED=8A=BC=EC=9D=84=20?=
 =?UTF-8?q?=EB=8B=A4=EC=8B=9C=20=EB=88=8C=EB=A0=80=EC=9D=84=20=EB=95=8C=20?=
 =?UTF-8?q?=EC=B2=B4=ED=81=AC=EA=B0=80=20=ED=92=80=EB=A6=AC=EB=8A=94=20?=
 =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/gui/oven_control/primewindow.cpp | 48 +++++++++++++++++++++++++-----------
 1 file changed, 33 insertions(+), 15 deletions(-)

diff --git a/app/gui/oven_control/primewindow.cpp b/app/gui/oven_control/primewindow.cpp
index e1fee28..6412b06 100644
--- a/app/gui/oven_control/primewindow.cpp
+++ b/app/gui/oven_control/primewindow.cpp
@@ -140,29 +140,47 @@ void PrimeWindow::keyReleaseEvent(QKeyEvent *event)
 
 void PrimeWindow::on_mostCookedButton_toggled(bool checked)
 {
-    if (!checked)
-        return;
-
-//    listButtons(CookHistory::listMostCooked());
-    listMostCooked();
+    if (checked)
+        listMostCooked();
+    else
+    {
+        if (!ui->recentsButton->isChecked() && !ui->favoritesButton->isChecked())
+        {
+            ui->mostCookedButton->blockSignals(true);
+            ui->mostCookedButton->setChecked(true);
+            ui->mostCookedButton->blockSignals(false);
+        }
+    }
 }
 
 void PrimeWindow::on_recentsButton_toggled(bool checked)
 {
-    if (!checked)
-        return;
-
-//    listButtons(CookHistory::listRecents());
-    listRecents();
+    if (checked)
+        listRecents();
+    else
+    {
+        if (!ui->mostCookedButton->isChecked() && !ui->favoritesButton->isChecked())
+        {
+            ui->recentsButton->blockSignals(true);
+            ui->recentsButton->setChecked(true);
+            ui->recentsButton->blockSignals(false);
+        }
+    }
 }
 
 void PrimeWindow::on_favoritesButton_toggled(bool checked)
 {
-    if (!checked)
-        return;
-
-//    listButtons(CookHistory::listFavorites());
-    listFavorites();
+    if (checked)
+        listFavorites();
+    else
+    {
+        if (!ui->mostCookedButton->isChecked() && !ui->recentsButton->isChecked())
+        {
+            ui->favoritesButton->blockSignals(true);
+            ui->favoritesButton->setChecked(true);
+            ui->favoritesButton->blockSignals(false);
+        }
+    }
 }
 
 void PrimeWindow::listButtons(QList<CookRecord> records)
-- 
2.1.4