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,6 +32,10 @@ Config::Config(QObject *parent) : QObject(parent) | ||
| 32 | memcpy(config_format,config_format_kr,MAX_CONFIG_COUNT*64); | 32 | memcpy(config_format,config_format_kr,MAX_CONFIG_COUNT*64); |
| 33 | loadConfig(); | 33 | loadConfig(); |
| 34 | loadFavorite(); | 34 | loadFavorite(); |
| 35 | + qApp->installEventFilter(&watcher); | ||
| 36 | + applyConfig(); | ||
| 37 | + | ||
| 38 | + | ||
| 35 | // m_setFavorite.insert(2); | 39 | // m_setFavorite.insert(2); |
| 36 | // m_setFavorite.insert(3); | 40 | // m_setFavorite.insert(3); |
| 37 | // m_setFavorite.insert(1); | 41 | // m_setFavorite.insert(1); |
| @@ -149,6 +153,9 @@ bool Config::loadConfig(){ | @@ -149,6 +153,9 @@ bool Config::loadConfig(){ | ||
| 149 | return false; | 153 | return false; |
| 150 | } | 154 | } |
| 151 | 155 | ||
| 156 | +void Config::applyConfig(){ | ||
| 157 | + watcher.setDelay(configlist.items.set_auto_darkness.d32); | ||
| 158 | +} | ||
| 152 | 159 | ||
| 153 | Define::config_item Config::getConfigValue(Define::ConfigType idx){ | 160 | Define::config_item Config::getConfigValue(Define::ConfigType idx){ |
| 154 | return configlist.values[idx]; | 161 | return configlist.values[idx]; |
| @@ -325,7 +332,6 @@ QString Config::getTempString(int cel_temp){ | @@ -325,7 +332,6 @@ QString Config::getTempString(int cel_temp){ | ||
| 325 | 332 | ||
| 326 | void Config::execConfigWindow(QWidget *parent, Define::ConfigType idx){ | 333 | void Config::execConfigWindow(QWidget *parent, Define::ConfigType idx){ |
| 327 | QDialog *dlg; | 334 | QDialog *dlg; |
| 328 | - bool bUsbDetect = false; | ||
| 329 | QString usbPath = ""; | 335 | QString usbPath = ""; |
| 330 | switch(idx){ | 336 | switch(idx){ |
| 331 | case config_language: | 337 | case config_language: |
app/gui/oven_control/config.h
| @@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
| 4 | 4 | ||
| 5 | #include <QObject> | 5 | #include <QObject> |
| 6 | #include <QSet> | 6 | #include <QSet> |
| 7 | +#include "inputoverwatcher.h" | ||
| 7 | 8 | ||
| 8 | #define STRUCT_PACK __attribute__ ((packed)) | 9 | #define STRUCT_PACK __attribute__ ((packed)) |
| 9 | 10 | ||
| @@ -257,7 +258,7 @@ class Config : public QObject | @@ -257,7 +258,7 @@ class Config : public QObject | ||
| 257 | ~Config(void); | 258 | ~Config(void); |
| 258 | 259 | ||
| 259 | static Config *instance; | 260 | static Config *instance; |
| 260 | - | 261 | + InputOverwatcher watcher; |
| 261 | 262 | ||
| 262 | 263 | ||
| 263 | 264 | ||
| @@ -388,6 +389,7 @@ public: | @@ -388,6 +389,7 @@ public: | ||
| 388 | //static void init(); | 389 | //static void init(); |
| 389 | void initConfig(void); | 390 | void initConfig(void); |
| 390 | bool loadConfig(void); | 391 | bool loadConfig(void); |
| 392 | + void applyConfig(void); | ||
| 391 | bool saveConfig(void); | 393 | bool saveConfig(void); |
| 392 | Define::config_item getConfigValue(Define::ConfigType idx); | 394 | Define::config_item getConfigValue(Define::ConfigType idx); |
| 393 | void setConfigValue(Define::ConfigType idx, Define::config_item& itemdata); | 395 | void setConfigValue(Define::ConfigType idx, Define::config_item& itemdata); |
app/gui/oven_control/main.cpp
| @@ -11,8 +11,6 @@ int main(int argc, char *argv[]) | @@ -11,8 +11,6 @@ int main(int argc, char *argv[]) | ||
| 11 | { | 11 | { |
| 12 | QApplication a(argc, argv); | 12 | QApplication a(argc, argv); |
| 13 | 13 | ||
| 14 | - InputOverwatcher watcher; | ||
| 15 | - a.installEventFilter(&watcher); | ||
| 16 | 14 | ||
| 17 | Oven *oven = Oven::getInstance(); | 15 | Oven *oven = Oven::getInstance(); |
| 18 | 16 |