diff --git a/Config.cc b/Config.cc index 499cce8..d20d517 100644 --- a/Config.cc +++ b/Config.cc @@ -66,7 +66,11 @@ void Config::read(const char * file) } else { - if (parts.first == "on_start") + if (parts.first == "pin") + { + entries[entry_num].pin = atoi(parts.second.c_str()); + } + else if (parts.first == "on_start") { entries[entry_num].on_start = parseAction(parts.second); } diff --git a/pppc.cc b/pppc.cc index afab653..1849bc4 100644 --- a/pppc.cc +++ b/pppc.cc @@ -91,6 +91,11 @@ void addMenuItem(HMENU hMenu, CHAR * itemstr, WORD id) PPPC::PPPC(HINSTANCE hInstance, const char * config_file) { + if (config_file != NULL) + { + m_config.read(config_file); + } + /* Load the application icon */ HICON icon = ::LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1)); if (icon == 0) diff --git a/pppc.h b/pppc.h index 7132532..f2bafca 100644 --- a/pppc.h +++ b/pppc.h @@ -2,6 +2,8 @@ #ifndef PPPC_H #define PPPC_H +#include "Config.h" + #define APP_NAME "Parallel Port Power Controller" #define WM_ICON_NOTIFY (WM_APP + 42) @@ -13,6 +15,7 @@ class PPPC BOOL mainLoop(); protected: + Config m_config; HWND m_hWnd; NOTIFYICONDATA m_nid; };