From 0e279295fda7fa6d3b3eb7bd3dd8acb686782c6c Mon Sep 17 00:00:00 2001
From: victor <taehoon@falinux.com>
Date: Thu, 1 Jun 2017 16:58:09 +0900
Subject: [PATCH] =?UTF-8?q?=EC=88=98=EB=8F=99=20=EC=9A=94=EB=A6=AC=20?=
 =?UTF-8?q?=EA=B5=AC=ED=98=84=20-=20=EC=9A=94=EB=A6=AC=20=EC=98=88?=
 =?UTF-8?q?=EC=95=BD=20-=20=EC=9A=94=EB=A6=AC=20=EB=B0=98=EB=B3=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/gui/oven_control/manualcookwindow.cpp  |  31 +--
 app/gui/oven_control/oven_control.pro      |  12 +-
 app/gui/oven_control/reservedtimepopup.cpp |  44 +++
 app/gui/oven_control/reservedtimepopup.h   |  34 +++
 app/gui/oven_control/reservedtimepopup.ui  | 130 +++++++++
 app/gui/oven_control/reservetimepopup.cpp  |  51 ++++
 app/gui/oven_control/reservetimepopup.h    |  31 +++
 app/gui/oven_control/reservetimepopup.ui   | 434 +++++++++++++++++++++++++++++
 app/gui/oven_control/stringer.cpp          |  26 ++
 app/gui/oven_control/stringer.h            |   5 +-
 10 files changed, 773 insertions(+), 25 deletions(-)
 create mode 100644 app/gui/oven_control/reservedtimepopup.cpp
 create mode 100644 app/gui/oven_control/reservedtimepopup.h
 create mode 100644 app/gui/oven_control/reservedtimepopup.ui
 create mode 100644 app/gui/oven_control/reservetimepopup.cpp
 create mode 100644 app/gui/oven_control/reservetimepopup.h
 create mode 100644 app/gui/oven_control/reservetimepopup.ui

diff --git a/app/gui/oven_control/manualcookwindow.cpp b/app/gui/oven_control/manualcookwindow.cpp
index cf7bb2f..d1c1bde 100644
--- a/app/gui/oven_control/manualcookwindow.cpp
+++ b/app/gui/oven_control/manualcookwindow.cpp
@@ -14,6 +14,8 @@
 #include "stringer.h"
 #include "config.h"
 #include "coretempsettingpopup.h"
+#include "reservetimepopup.h"
+#include "reservedtimepopup.h"
 
 #include <QTime>
 
@@ -505,26 +507,15 @@ void ManualCookWindow::on_cooldownButton_clicked()
 
 void ManualCookWindow::on_reserveButton_clicked()
 {
-//    if (isReserved)
-//    {
-//        isReserved = false;
-//        ui->reserveButton->setStyleSheet("\
-//QPushButton { background-image: url(:/images/manual_button/reserve.png); }\
-//QPushButton:pressed { background-image: url(:/images/manual_button/reserve_ov.png); }");
-//    }
-//    else
-//    {
-//        isReserved = true;
-//        ui->reserveButton->setStyleSheet("\
-//QPushButton { background-image: url(:/images/manual_button/reserve_ov.png); }\
-//QPushButton:pressed { background-image: url(:/images/manual_button/reserve.png); }");
-//        reserved.mode = oven->mode();
-//        reserved.humidity = oven->humidity();
-//        reserved.temp= oven->temp();
-//        reserved.time = oven->time();
-//        reserved.coreTempEnabled = oven->interTempEnabled();
-//        reserved.coreTemp = oven->interTemp();
-//    }
+    if (oven->time() > 0)
+    {
+        startCookingTimer.stop();
+
+        ReserveTimePopup *p = new ReserveTimePopup(this);
+        connect(p, SIGNAL(timeout()), SLOT(start()));
+        connect(p, SIGNAL(canceled()), &startCookingTimer, SLOT(start()));
+        p->showFullScreen();
+    }
 }
 
 void ManualCookWindow::on_favoriteButton_clicked()
diff --git a/app/gui/oven_control/oven_control.pro b/app/gui/oven_control/oven_control.pro
index 9db4aea..d8764ca 100644
--- a/app/gui/oven_control/oven_control.pro
+++ b/app/gui/oven_control/oven_control.pro
@@ -113,7 +113,9 @@ SOURCES += main.cpp\
     cookprogram.cpp \
     programmingautoselectionwindow.cpp \
     programmingautoconfigwindow.cpp \
-    programmingnamepopup.cpp
+    programmingnamepopup.cpp \
+    reservetimepopup.cpp \
+    reservedtimepopup.cpp
 
 HEADERS  += mainwindow.h \
     cook.h \
@@ -216,7 +218,9 @@ HEADERS  += mainwindow.h \
     cookprogram.h \
     programmingautoselectionwindow.h \
     programmingautoconfigwindow.h \
-    programmingnamepopup.h
+    programmingnamepopup.h \
+    reservetimepopup.h \
+    reservedtimepopup.h
 
 FORMS    += mainwindow.ui \
     manualcookwindow.ui \
@@ -286,7 +290,9 @@ FORMS    += mainwindow.ui \
     programmingmanualcoretemppopup.ui \
     programmingautoselectionwindow.ui \
     programmingautoconfigwindow.ui \
-    programmingnamepopup.ui
+    programmingnamepopup.ui \
+    reservetimepopup.ui \
+    reservedtimepopup.ui
 
 RESOURCES += \
     resources.qrc
diff --git a/app/gui/oven_control/reservedtimepopup.cpp b/app/gui/oven_control/reservedtimepopup.cpp
new file mode 100644
index 0000000..24135e7
--- /dev/null
+++ b/app/gui/oven_control/reservedtimepopup.cpp
@@ -0,0 +1,44 @@
+#include "reservedtimepopup.h"
+#include "ui_reservedtimepopup.h"
+
+#include <QDebug>
+
+#include "stringer.h"
+
+ReservedTimePopup::ReservedTimePopup(QWidget *parent, QDateTime target) :
+    QWidget(parent),
+    ui(new Ui::ReservedTimePopup),
+    target(target)
+{
+    ui->setupUi(this);
+
+    setAttribute(Qt::WA_DeleteOnClose);
+
+    connect(&checkTimeTimer, SIGNAL(timeout()), SLOT(checkTime()));
+    checkTimeTimer.start(100);
+
+    checkTime();
+}
+
+ReservedTimePopup::~ReservedTimePopup()
+{
+    delete ui;
+}
+
+void ReservedTimePopup::checkTime()
+{
+    qint64 remaining = QDateTime::currentDateTime().msecsTo(target);
+    if (remaining > 0)
+        ui->timeLabel->setText(Stringer::remainingTime(remaining));
+    else
+    {
+        emit timeout();
+        close();
+    }
+}
+
+void ReservedTimePopup::on_cancelButton_clicked()
+{
+    emit canceled();
+    close();
+}
diff --git a/app/gui/oven_control/reservedtimepopup.h b/app/gui/oven_control/reservedtimepopup.h
new file mode 100644
index 0000000..23cc4b6
--- /dev/null
+++ b/app/gui/oven_control/reservedtimepopup.h
@@ -0,0 +1,34 @@
+#ifndef RESERVEDTIMEPOPUP_H
+#define RESERVEDTIMEPOPUP_H
+
+#include <QWidget>
+#include <QTimer>
+#include <QDateTime>
+
+namespace Ui {
+class ReservedTimePopup;
+}
+
+class ReservedTimePopup : public QWidget
+{
+    Q_OBJECT
+
+public:
+    explicit ReservedTimePopup(QWidget *parent, QDateTime target);
+    ~ReservedTimePopup();
+
+private:
+    Ui::ReservedTimePopup *ui;
+    QDateTime target;
+    QTimer checkTimeTimer;
+
+private slots:
+    void checkTime();
+    void on_cancelButton_clicked();
+
+signals:
+    void timeout();
+    void canceled();
+};
+
+#endif // RESERVEDTIMEPOPUP_H
diff --git a/app/gui/oven_control/reservedtimepopup.ui b/app/gui/oven_control/reservedtimepopup.ui
new file mode 100644
index 0000000..70d44ab
--- /dev/null
+++ b/app/gui/oven_control/reservedtimepopup.ui
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ReservedTimePopup</class>
+ <widget class="QWidget" name="ReservedTimePopup">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>900</width>
+    <height>1600</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <property name="styleSheet">
+   <string notr="true">#background { background-image: url(:/images/background/popup/503.png); }
+QLabel, QPushButton, QLineEdit { color: white; }
+QLineEdit { background : transparent; border: none; }
+QPushButton { border: none; }
+QPushButton:pressed { color: yellow; }
+QSpinBox{
+	background-color : transparent; 
+	color : white;
+}</string>
+  </property>
+  <widget class="QWidget" name="background" native="true">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>426</y>
+     <width>900</width>
+     <height>424</height>
+    </rect>
+   </property>
+   <widget class="Line" name="line">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>95</y>
+      <width>900</width>
+      <height>3</height>
+     </rect>
+    </property>
+    <property name="styleSheet">
+     <string notr="true">color: rgb(255, 255, 255);</string>
+    </property>
+    <property name="orientation">
+     <enum>Qt::Horizontal</enum>
+    </property>
+   </widget>
+   <widget class="QLabel" name="titleLabel">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>0</y>
+      <width>900</width>
+      <height>95</height>
+     </rect>
+    </property>
+    <property name="font">
+     <font>
+      <pointsize>14</pointsize>
+     </font>
+    </property>
+    <property name="text">
+     <string>예약 시간</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignCenter</set>
+    </property>
+   </widget>
+   <widget class="QLabel" name="timeLabel">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>100</y>
+      <width>900</width>
+      <height>199</height>
+     </rect>
+    </property>
+    <property name="font">
+     <font>
+      <family>나눔고딕</family>
+      <pointsize>18</pointsize>
+      <weight>75</weight>
+      <bold>true</bold>
+     </font>
+    </property>
+    <property name="text">
+     <string>0</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignCenter</set>
+    </property>
+   </widget>
+   <widget class="QPushButton" name="cancelButton">
+    <property name="geometry">
+     <rect>
+      <x>649</x>
+      <y>321</y>
+      <width>181</width>
+      <height>99</height>
+     </rect>
+    </property>
+    <property name="sizePolicy">
+     <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+      <horstretch>0</horstretch>
+      <verstretch>0</verstretch>
+     </sizepolicy>
+    </property>
+    <property name="font">
+     <font>
+      <family>나눔고딕</family>
+      <pointsize>12</pointsize>
+      <underline>true</underline>
+     </font>
+    </property>
+    <property name="text">
+     <string>취소</string>
+    </property>
+    <property name="flat">
+     <bool>true</bool>
+    </property>
+   </widget>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/app/gui/oven_control/reservetimepopup.cpp b/app/gui/oven_control/reservetimepopup.cpp
new file mode 100644
index 0000000..c36720e
--- /dev/null
+++ b/app/gui/oven_control/reservetimepopup.cpp
@@ -0,0 +1,51 @@
+#include "reservetimepopup.h"
+#include "ui_reservetimepopup.h"
+
+#include <QDateTime>
+
+#include "reservedtimepopup.h"
+
+ReserveTimePopup::ReserveTimePopup(QWidget *parent) :
+    QWidget(parent),
+    ui(new Ui::ReserveTimePopup)
+{
+    ui->setupUi(this);
+
+    setAttribute(Qt::WA_DeleteOnClose);
+
+    QDateTime dt = QDateTime::currentDateTime();
+    ui->month->setValue(dt.date().month());
+    ui->day->setValue(dt.date().day());
+    ui->hour->setValue(dt.time().hour());
+    ui->min->setValue(dt.time().minute());
+}
+
+ReserveTimePopup::~ReserveTimePopup()
+{
+    delete ui;
+}
+
+void ReserveTimePopup::on_okButton_clicked()
+{
+    QDateTime current = QDateTime::currentDateTime();
+    QDateTime target;
+    target.setDate(QDate(current.date().year(), ui->month->value(), ui->day->value()));
+    target.setTime(QTime(ui->hour->value(), ui->min->value()));
+
+    if (current >= target)
+        target = target.addYears(1);
+
+    ReservedTimePopup *p = new ReservedTimePopup(parentWidget(), target);
+    connect(p, SIGNAL(timeout()), SIGNAL(timeout()));
+    connect(p, SIGNAL(canceled()), SIGNAL(canceled()));
+    connect(p, SIGNAL(destroyed(QObject*)), SLOT(deleteLater()));
+    p->showFullScreen();
+
+    hide();
+}
+
+void ReserveTimePopup::on_cancelButton_clicked()
+{
+    emit canceled();
+    close();
+}
diff --git a/app/gui/oven_control/reservetimepopup.h b/app/gui/oven_control/reservetimepopup.h
new file mode 100644
index 0000000..e9be12e
--- /dev/null
+++ b/app/gui/oven_control/reservetimepopup.h
@@ -0,0 +1,31 @@
+#ifndef RESERVETIMEPOPUP_H
+#define RESERVETIMEPOPUP_H
+
+#include <QWidget>
+
+namespace Ui {
+class ReserveTimePopup;
+}
+
+class ReserveTimePopup : public QWidget
+{
+    Q_OBJECT
+
+public:
+    explicit ReserveTimePopup(QWidget *parent = 0);
+    ~ReserveTimePopup();
+
+private slots:
+    void on_okButton_clicked();
+
+    void on_cancelButton_clicked();
+
+private:
+    Ui::ReserveTimePopup *ui;
+
+signals:
+    void timeout();
+    void canceled();
+};
+
+#endif // RESERVETIMEPOPUP_H
diff --git a/app/gui/oven_control/reservetimepopup.ui b/app/gui/oven_control/reservetimepopup.ui
new file mode 100644
index 0000000..0e26ceb
--- /dev/null
+++ b/app/gui/oven_control/reservetimepopup.ui
@@ -0,0 +1,434 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ReserveTimePopup</class>
+ <widget class="QWidget" name="ReserveTimePopup">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>900</width>
+    <height>1600</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <property name="styleSheet">
+   <string notr="true">#background { background-image: url(:/images/background/popup/503.png); }
+QLabel, QPushButton, QLineEdit { color: white; }
+QLineEdit { background : transparent; border: none; }
+QPushButton { border: none; }
+QPushButton:pressed { color: yellow; }
+QSpinBox{
+	background-color : transparent; 
+	color : white;
+}</string>
+  </property>
+  <widget class="QWidget" name="background" native="true">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>426</y>
+     <width>900</width>
+     <height>1024</height>
+    </rect>
+   </property>
+   <widget class="Line" name="line">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>95</y>
+      <width>900</width>
+      <height>3</height>
+     </rect>
+    </property>
+    <property name="styleSheet">
+     <string notr="true">color: rgb(255, 255, 255);</string>
+    </property>
+    <property name="orientation">
+     <enum>Qt::Horizontal</enum>
+    </property>
+   </widget>
+   <widget class="QWidget" name="horizontalLayoutWidget">
+    <property name="geometry">
+     <rect>
+      <x>460</x>
+      <y>320</y>
+      <width>371</width>
+      <height>101</height>
+     </rect>
+    </property>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QPushButton" name="okButton">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="font">
+        <font>
+         <family>나눔고딕</family>
+         <pointsize>12</pointsize>
+         <underline>true</underline>
+        </font>
+       </property>
+       <property name="text">
+        <string>확인</string>
+       </property>
+       <property name="flat">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="cancelButton">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="font">
+        <font>
+         <family>나눔고딕</family>
+         <pointsize>12</pointsize>
+         <underline>true</underline>
+        </font>
+       </property>
+       <property name="text">
+        <string>취소</string>
+       </property>
+       <property name="flat">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </widget>
+   <widget class="QLabel" name="titleLabel">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>0</y>
+      <width>900</width>
+      <height>95</height>
+     </rect>
+    </property>
+    <property name="font">
+     <font>
+      <pointsize>14</pointsize>
+     </font>
+    </property>
+    <property name="text">
+     <string>예약 시간 설정</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignCenter</set>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_4">
+    <property name="geometry">
+     <rect>
+      <x>246</x>
+      <y>100</y>
+      <width>44</width>
+      <height>199</height>
+     </rect>
+    </property>
+    <property name="font">
+     <font>
+      <family>나눔고딕</family>
+      <pointsize>18</pointsize>
+      <weight>75</weight>
+      <bold>true</bold>
+     </font>
+    </property>
+    <property name="text">
+     <string>월</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_5">
+    <property name="geometry">
+     <rect>
+      <x>575</x>
+      <y>100</y>
+      <width>44</width>
+      <height>199</height>
+     </rect>
+    </property>
+    <property name="font">
+     <font>
+      <family>나눔고딕</family>
+      <pointsize>18</pointsize>
+      <weight>75</weight>
+      <bold>true</bold>
+     </font>
+    </property>
+    <property name="text">
+     <string>시</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_6">
+    <property name="geometry">
+     <rect>
+      <x>739</x>
+      <y>100</y>
+      <width>44</width>
+      <height>199</height>
+     </rect>
+    </property>
+    <property name="font">
+     <font>
+      <family>나눔고딕</family>
+      <pointsize>18</pointsize>
+      <weight>75</weight>
+      <bold>true</bold>
+     </font>
+    </property>
+    <property name="text">
+     <string>분</string>
+    </property>
+   </widget>
+   <widget class="FormatterSpinBox" name="month">
+    <property name="geometry">
+     <rect>
+      <x>141</x>
+      <y>100</y>
+      <width>90</width>
+      <height>199</height>
+     </rect>
+    </property>
+    <property name="sizePolicy">
+     <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+      <horstretch>0</horstretch>
+      <verstretch>0</verstretch>
+     </sizepolicy>
+    </property>
+    <property name="font">
+     <font>
+      <family>나눔고딕</family>
+      <pointsize>18</pointsize>
+      <underline>true</underline>
+     </font>
+    </property>
+    <property name="focusPolicy">
+     <enum>Qt::StrongFocus</enum>
+    </property>
+    <property name="frame">
+     <bool>false</bool>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+    </property>
+    <property name="buttonSymbols">
+     <enum>QAbstractSpinBox::NoButtons</enum>
+    </property>
+    <property name="minimum">
+     <number>1</number>
+    </property>
+    <property name="maximum">
+     <number>12</number>
+    </property>
+    <property name="value">
+     <number>12</number>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_3">
+    <property name="geometry">
+     <rect>
+      <x>410</x>
+      <y>100</y>
+      <width>45</width>
+      <height>199</height>
+     </rect>
+    </property>
+    <property name="font">
+     <font>
+      <family>나눔고딕</family>
+      <pointsize>18</pointsize>
+      <weight>75</weight>
+      <bold>true</bold>
+     </font>
+    </property>
+    <property name="text">
+     <string>일</string>
+    </property>
+   </widget>
+   <widget class="FormatterSpinBox" name="min">
+    <property name="geometry">
+     <rect>
+      <x>634</x>
+      <y>100</y>
+      <width>90</width>
+      <height>199</height>
+     </rect>
+    </property>
+    <property name="sizePolicy">
+     <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+      <horstretch>0</horstretch>
+      <verstretch>0</verstretch>
+     </sizepolicy>
+    </property>
+    <property name="minimumSize">
+     <size>
+      <width>86</width>
+      <height>0</height>
+     </size>
+    </property>
+    <property name="font">
+     <font>
+      <family>나눔고딕</family>
+      <pointsize>18</pointsize>
+      <underline>true</underline>
+      <kerning>true</kerning>
+     </font>
+    </property>
+    <property name="mouseTracking">
+     <bool>false</bool>
+    </property>
+    <property name="focusPolicy">
+     <enum>Qt::StrongFocus</enum>
+    </property>
+    <property name="frame">
+     <bool>false</bool>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+    </property>
+    <property name="buttonSymbols">
+     <enum>QAbstractSpinBox::NoButtons</enum>
+    </property>
+    <property name="suffix">
+     <string notr="true"/>
+    </property>
+    <property name="prefix">
+     <string notr="true"/>
+    </property>
+    <property name="minimum">
+     <number>0</number>
+    </property>
+    <property name="maximum">
+     <number>60</number>
+    </property>
+    <property name="value">
+     <number>20</number>
+    </property>
+   </widget>
+   <widget class="FormatterSpinBox" name="day">
+    <property name="geometry">
+     <rect>
+      <x>305</x>
+      <y>100</y>
+      <width>90</width>
+      <height>199</height>
+     </rect>
+    </property>
+    <property name="sizePolicy">
+     <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+      <horstretch>0</horstretch>
+      <verstretch>0</verstretch>
+     </sizepolicy>
+    </property>
+    <property name="font">
+     <font>
+      <family>나눔고딕</family>
+      <pointsize>18</pointsize>
+      <underline>true</underline>
+     </font>
+    </property>
+    <property name="focusPolicy">
+     <enum>Qt::StrongFocus</enum>
+    </property>
+    <property name="frame">
+     <bool>false</bool>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+    </property>
+    <property name="buttonSymbols">
+     <enum>QAbstractSpinBox::NoButtons</enum>
+    </property>
+    <property name="minimum">
+     <number>1</number>
+    </property>
+    <property name="maximum">
+     <number>31</number>
+    </property>
+    <property name="value">
+     <number>20</number>
+    </property>
+   </widget>
+   <widget class="FormatterSpinBox" name="hour">
+    <property name="geometry">
+     <rect>
+      <x>470</x>
+      <y>100</y>
+      <width>90</width>
+      <height>199</height>
+     </rect>
+    </property>
+    <property name="sizePolicy">
+     <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+      <horstretch>0</horstretch>
+      <verstretch>0</verstretch>
+     </sizepolicy>
+    </property>
+    <property name="font">
+     <font>
+      <family>나눔고딕</family>
+      <pointsize>18</pointsize>
+      <underline>true</underline>
+     </font>
+    </property>
+    <property name="focusPolicy">
+     <enum>Qt::StrongFocus</enum>
+    </property>
+    <property name="frame">
+     <bool>false</bool>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+    </property>
+    <property name="buttonSymbols">
+     <enum>QAbstractSpinBox::NoButtons</enum>
+    </property>
+    <property name="minimum">
+     <number>0</number>
+    </property>
+    <property name="maximum">
+     <number>23</number>
+    </property>
+    <property name="value">
+     <number>20</number>
+    </property>
+   </widget>
+  </widget>
+  <widget class="KeyboardWidget" name="keyboard" native="true">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>850</y>
+     <width>900</width>
+     <height>600</height>
+    </rect>
+   </property>
+  </widget>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>KeyboardWidget</class>
+   <extends>QWidget</extends>
+   <header>keyboardwidget.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>FormatterSpinBox</class>
+   <extends>QSpinBox</extends>
+   <header>formatterspinbox.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/app/gui/oven_control/stringer.cpp b/app/gui/oven_control/stringer.cpp
index 1826b1d..ca58764 100644
--- a/app/gui/oven_control/stringer.cpp
+++ b/app/gui/oven_control/stringer.cpp
@@ -118,6 +118,32 @@ QString Stringer::remainingTime(int msecs, QString style)
     return QString();
 }
 
+QString Stringer::remainingTime(qint64 msecs)
+{
+    switch (::remainingTime())
+    {
+    case RemainingTime:
+        msecs /= 1000;
+        if (msecs >= 3600)
+            return QString("%1시간 %2분").arg(msecs / 3600).arg((msecs % 3600) / 60, 2, 10, QLatin1Char('0'));
+        if (msecs >= 60)
+            return QString("%1분 %2초").arg(msecs / 60).arg(msecs % 60, 2, 10, QLatin1Char('0'));
+
+        return QString("%1초").arg(msecs);
+    case FinishTime:
+        QDateTime dateTime = QDateTime::currentDateTime().addMSecs(msecs);
+        switch (realTimeFormat())
+        {
+        case Hour12:
+            return dateTime.toString("A hh:mm:ss");
+        case Hour24:
+            return dateTime.toString("HH:mm:ss");
+        }
+    }
+
+    return QString();
+}
+
 QString Stringer::temperature(int celsius)
 {
     switch (temperatureFormat())
diff --git a/app/gui/oven_control/stringer.h b/app/gui/oven_control/stringer.h
index 1d874cc..ca296ab 100644
--- a/app/gui/oven_control/stringer.h
+++ b/app/gui/oven_control/stringer.h
@@ -20,8 +20,9 @@ span.light { font-size: 11pt; }\
 span.lightest { font-size: 9pt; }\
 </style>");
 
-QString remainingTime(int secs);
-QString remainingTime(int secs, QString style);
+QString remainingTime(int msecs);
+QString remainingTime(int msecs, QString style);
+QString remainingTime(qint64 msecs);
 QString temperature(int celsius);
 QString temperature(int celsius, QString style);
 QString temperature(int current, int target);
-- 
2.1.4