From 2576fd06a148124bdb04652d06214e66ef35b0cb Mon Sep 17 00:00:00 2001 From: victor Date: Mon, 17 Jul 2017 11:23:23 +0900 Subject: [PATCH] =?UTF-8?q?=EC=88=98=EB=8F=99=20=EC=9A=94=EB=A6=AC=20?= =?UTF-8?q?=EC=98=88=EC=95=BD=20=EB=94=94=EC=9E=90=EC=9D=B8/=EB=8F=99?= =?UTF-8?q?=EC=9E=91=20=EB=B3=80=EA=B2=BD=20-=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EB=8B=A8=EC=9C=84=EB=A5=BC=20=EC=8B=9C/=EB=B6=84=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=ED=95=9C=EC=A0=95=20-=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=8B=9C=EA=B0=84=EC=97=90=20=EC=8B=9C=EC=9E=91=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EA=B2=83=EC=9D=B4=20=EC=95=84=EB=8B=8C=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=ED=95=9C=20=EC=8B=9C=EA=B0=84=EB=A7=8C=ED=81=BC=20?= =?UTF-8?q?=ED=9D=90=EB=A5=B8=20=EB=92=A4=20=EC=8B=9C=EC=9E=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/gui/oven_control/reservedtimepopup.cpp | 7 ++ app/gui/oven_control/reservedtimepopup.ui | 32 +++++-- app/gui/oven_control/reservetimepopup.cpp | 21 ++--- app/gui/oven_control/reservetimepopup.ui | 146 ++--------------------------- 4 files changed, 46 insertions(+), 160 deletions(-) diff --git a/app/gui/oven_control/reservedtimepopup.cpp b/app/gui/oven_control/reservedtimepopup.cpp index 6d42957..816fd63 100644 --- a/app/gui/oven_control/reservedtimepopup.cpp +++ b/app/gui/oven_control/reservedtimepopup.cpp @@ -15,6 +15,10 @@ ReservedTimePopup::ReservedTimePopup(QWidget *parent, QDateTime target) : setAttribute(Qt::WA_DeleteOnClose); + int remainingTime = QDateTime::currentDateTime().msecsTo(target); + ui->remainingTime->setMaximum(remainingTime); + ui->remainingTime->setValue(remainingTime); + connect(&checkTimeTimer, SIGNAL(timeout()), SLOT(checkTime())); checkTimeTimer.start(100); @@ -63,7 +67,10 @@ void ReservedTimePopup::checkTime() { qint64 remaining = QDateTime::currentDateTime().msecsTo(target); if (remaining > 0) + { ui->timeLabel->setText(Stringer::remainingTime(remaining)); + ui->remainingTime->setValue(remaining); + } else { emit timeout(); diff --git a/app/gui/oven_control/reservedtimepopup.ui b/app/gui/oven_control/reservedtimepopup.ui index b553bba..88ac99f 100644 --- a/app/gui/oven_control/reservedtimepopup.ui +++ b/app/gui/oven_control/reservedtimepopup.ui @@ -61,7 +61,7 @@ QSpinBox{ - 예약 시간 + 예약하기 Qt::AlignCenter @@ -70,16 +70,16 @@ QSpinBox{ - 0 - 100 - 900 - 199 + 70 + 190 + 151 + 58 나눔고딕 - 18 + 14 75 true @@ -88,7 +88,7 @@ QSpinBox{ 0 - Qt::AlignCenter + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -120,8 +120,26 @@ QSpinBox{ true + + + + 250 + 190 + 532 + 58 + + + + + + WashStepGauge + QWidget +
washstepgauge.h
+ 1 +
+
diff --git a/app/gui/oven_control/reservetimepopup.cpp b/app/gui/oven_control/reservetimepopup.cpp index cfb9e6d..2ebca42 100644 --- a/app/gui/oven_control/reservetimepopup.cpp +++ b/app/gui/oven_control/reservetimepopup.cpp @@ -17,10 +17,8 @@ ReserveTimePopup::ReserveTimePopup(QWidget *parent) : 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()); + ui->hour->setValue(1); + ui->min->setValue(0); connect(ui->keyboard, SIGNAL(onOkKeyClicked()), ui->keyboard, SLOT(focusOutKeyboard())); connect(ui->keyboard, SIGNAL(onCancelKeyClicked()), ui->keyboard, SLOT(focusOutKeyboard())); @@ -102,13 +100,8 @@ void ReserveTimePopup::revert() 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); + QDateTime target = QDateTime::currentDateTime() + .addSecs(ui->hour->value() * 3600 + ui->min->value() * 60); ReservedTimePopup *p = new ReservedTimePopup(parentWidget(), target); connect(p, SIGNAL(timeout()), SIGNAL(timeout())); @@ -127,7 +120,7 @@ void ReserveTimePopup::on_cancelButton_clicked() void ReserveTimePopup::onEncoderLeft() { - if (focusWidget() == ui->month) + if (focusWidget() == ui->hour) ui->cancelButton->setFocus(); else focusPreviousChild(); @@ -137,8 +130,8 @@ void ReserveTimePopup::onEncoderRight() { if (focusWidget() == ui->cancelButton) { - ui->month->setFocus(); - ui->month->selectAll(); + ui->hour->setFocus(); + ui->hour->selectAll(); } else focusNextChild(); diff --git a/app/gui/oven_control/reservetimepopup.ui b/app/gui/oven_control/reservetimepopup.ui index 88faa19..1a6695b 100644 --- a/app/gui/oven_control/reservetimepopup.ui +++ b/app/gui/oven_control/reservetimepopup.ui @@ -119,37 +119,16 @@ QSpinBox{ - 예약 시간 설정 + 예약하기 Qt::AlignCenter - - - - 246 - 100 - 44 - 199 - - - - - 나눔고딕 - 18 - 75 - true - - - - - - - 575 + 386 100 44 199 @@ -170,9 +149,9 @@ QSpinBox{ - 739 + 550 100 - 44 + 121 199 @@ -185,78 +164,13 @@ QSpinBox{ - - - - - - - 141 - 100 - 90 - 199 - - - - - 0 - 0 - - - - - 나눔고딕 - 18 - true - - - - Qt::StrongFocus - - - false - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - QAbstractSpinBox::NoButtons - - - 1 - - - 12 - - - 12 - - - - - - 410 - 100 - 45 - 199 - - - - - 나눔고딕 - 18 - 75 - true - - - - + 분 후 - 634 + 445 100 90 199 @@ -313,54 +227,10 @@ QSpinBox{ 20 - - - - 305 - 100 - 90 - 199 - - - - - 0 - 0 - - - - - 나눔고딕 - 18 - true - - - - Qt::StrongFocus - - - false - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - QAbstractSpinBox::NoButtons - - - 1 - - - 31 - - - 20 - - - 470 + 281 100 90 199 @@ -427,8 +297,6 @@ QSpinBox{ - month - day hour min okButton -- 2.1.4