diff --git a/app/gui/oven_control/demoicon.cpp b/app/gui/oven_control/demoicon.cpp new file mode 100644 index 0000000..e11cba7 --- /dev/null +++ b/app/gui/oven_control/demoicon.cpp @@ -0,0 +1,22 @@ +#include "demoicon.h" + +#include "config.h" + +DemoIcon::DemoIcon(QWidget *parent) : QLabel(parent) +{ + setPixmap(QPixmap(":/images/symbol/demo.png")); + + connect(&timer, SIGNAL(timeout()), SLOT(check())); + timer.start(1000); + + check(); +} + +void DemoIcon::check() +{ + Define::config_item item = Config::getInstance()->getConfigValue(Define::config_demo_mode); + if (item.d32 == 0) + hide(); + else + show(); +} diff --git a/app/gui/oven_control/demoicon.h b/app/gui/oven_control/demoicon.h new file mode 100644 index 0000000..af01d3c --- /dev/null +++ b/app/gui/oven_control/demoicon.h @@ -0,0 +1,20 @@ +#ifndef DEMOICON_H +#define DEMOICON_H + +#include +#include + +class DemoIcon : public QLabel +{ + Q_OBJECT + + QTimer timer; + +public: + explicit DemoIcon(QWidget *parent = 0); + +private slots: + void check(); +}; + +#endif // DEMOICON_H diff --git a/app/gui/oven_control/halfenergyicon.cpp b/app/gui/oven_control/halfenergyicon.cpp new file mode 100644 index 0000000..cc10ecd --- /dev/null +++ b/app/gui/oven_control/halfenergyicon.cpp @@ -0,0 +1,22 @@ +#include "halfenergyicon.h" + +#include "config.h" + +HalfEnergyIcon::HalfEnergyIcon(QWidget *parent) : QLabel(parent) +{ + setPixmap(QPixmap(":/images/symbol/half_energy.png")); + + connect(&timer, SIGNAL(timeout()), SLOT(check())); + timer.start(1000); + + check(); +} + +void HalfEnergyIcon::check() +{ + Define::config_item item = Config::getInstance()->getConfigValue(Define::config_set_half_energy); + if (item.d32 == 0) + hide(); + else + show(); +} diff --git a/app/gui/oven_control/halfenergyicon.h b/app/gui/oven_control/halfenergyicon.h new file mode 100644 index 0000000..c80ecf2 --- /dev/null +++ b/app/gui/oven_control/halfenergyicon.h @@ -0,0 +1,20 @@ +#ifndef HALFENERGYICON_H +#define HALFENERGYICON_H + +#include +#include + +class HalfEnergyIcon : public QLabel +{ + Q_OBJECT + + QTimer timer; + +public: + explicit HalfEnergyIcon(QWidget *parent = 0); + +private slots: + void check(); +}; + +#endif // HALFENERGYICON_H diff --git a/app/gui/oven_control/oven_control.pro b/app/gui/oven_control/oven_control.pro index b8f9da9..f673428 100644 --- a/app/gui/oven_control/oven_control.pro +++ b/app/gui/oven_control/oven_control.pro @@ -122,9 +122,10 @@ SOURCES += main.cpp\ autocookselectionpopup.cpp \ autocookcheckwindow.cpp \ autocookcheckconfigwindow.cpp \ - programmedcookpanelbutton.cpp - configdemomodedlg.cpp - + programmedcookpanelbutton.cpp \ + configdemomodedlg.cpp \ + demoicon.cpp \ + halfenergyicon.cpp HEADERS += mainwindow.h \ cook.h \ @@ -236,8 +237,10 @@ HEADERS += mainwindow.h \ autocookselectionpopup.h \ autocookcheckwindow.h \ autocookcheckconfigwindow.h \ - programmedcookpanelbutton.h - configdemomodedlg.h + programmedcookpanelbutton.h \ + configdemomodedlg.h \ + demoicon.h \ + halfenergyicon.h FORMS += mainwindow.ui \ manualcookwindow.ui \ @@ -315,7 +318,7 @@ FORMS += mainwindow.ui \ autocookselectionpopup.ui \ autocookcheckwindow.ui \ autocookcheckconfigwindow.ui \ - programmedcookpanelbutton.ui + programmedcookpanelbutton.ui \ configdemomodedlg.ui RESOURCES += \