Commit 52465a2dfa9959bbfe1031e09c4a2ec68ed70f75
1 parent
1f685a2a55
Exists in
master
and in
2 other branches
백라이트 자동 감소 기능 수정
- Config 쪽으로 이동
Showing
3 changed files
with
10 additions
and
4 deletions
Show diff stats
app/gui/oven_control/config.cpp
| ... | ... | @@ -32,6 +32,10 @@ Config::Config(QObject *parent) : QObject(parent) |
| 32 | 32 | memcpy(config_format,config_format_kr,MAX_CONFIG_COUNT*64); |
| 33 | 33 | loadConfig(); |
| 34 | 34 | loadFavorite(); |
| 35 | + qApp->installEventFilter(&watcher); | |
| 36 | + applyConfig(); | |
| 37 | + | |
| 38 | + | |
| 35 | 39 | // m_setFavorite.insert(2); |
| 36 | 40 | // m_setFavorite.insert(3); |
| 37 | 41 | // m_setFavorite.insert(1); |
| ... | ... | @@ -149,6 +153,9 @@ bool Config::loadConfig(){ |
| 149 | 153 | return false; |
| 150 | 154 | } |
| 151 | 155 | |
| 156 | +void Config::applyConfig(){ | |
| 157 | + watcher.setDelay(configlist.items.set_auto_darkness.d32); | |
| 158 | +} | |
| 152 | 159 | |
| 153 | 160 | Define::config_item Config::getConfigValue(Define::ConfigType idx){ |
| 154 | 161 | return configlist.values[idx]; |
| ... | ... | @@ -325,7 +332,6 @@ QString Config::getTempString(int cel_temp){ |
| 325 | 332 | |
| 326 | 333 | void Config::execConfigWindow(QWidget *parent, Define::ConfigType idx){ |
| 327 | 334 | QDialog *dlg; |
| 328 | - bool bUsbDetect = false; | |
| 329 | 335 | QString usbPath = ""; |
| 330 | 336 | switch(idx){ |
| 331 | 337 | case config_language: | ... | ... |
app/gui/oven_control/config.h
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | |
| 5 | 5 | #include <QObject> |
| 6 | 6 | #include <QSet> |
| 7 | +#include "inputoverwatcher.h" | |
| 7 | 8 | |
| 8 | 9 | #define STRUCT_PACK __attribute__ ((packed)) |
| 9 | 10 | |
| ... | ... | @@ -257,7 +258,7 @@ class Config : public QObject |
| 257 | 258 | ~Config(void); |
| 258 | 259 | |
| 259 | 260 | static Config *instance; |
| 260 | - | |
| 261 | + InputOverwatcher watcher; | |
| 261 | 262 | |
| 262 | 263 | |
| 263 | 264 | |
| ... | ... | @@ -388,6 +389,7 @@ public: |
| 388 | 389 | //static void init(); |
| 389 | 390 | void initConfig(void); |
| 390 | 391 | bool loadConfig(void); |
| 392 | + void applyConfig(void); | |
| 391 | 393 | bool saveConfig(void); |
| 392 | 394 | Define::config_item getConfigValue(Define::ConfigType idx); |
| 393 | 395 | void setConfigValue(Define::ConfigType idx, Define::config_item& itemdata); | ... | ... |