PPPC creating a Config object now, added parsing of pin entry field
git-svn-id: http://apu.dw.local/svnusers/JoshHoltrop/pppc/trunk@55 8131a0b2-b21c-1c47-bd6a-f003126495bd
This commit is contained in:
parent
90f46c2917
commit
ff99f698b2
@ -66,7 +66,11 @@ void Config::read(const char * file)
|
|||||||
}
|
}
|
||||||
else
|
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);
|
entries[entry_num].on_start = parseAction(parts.second);
|
||||||
}
|
}
|
||||||
|
5
pppc.cc
5
pppc.cc
@ -91,6 +91,11 @@ void addMenuItem(HMENU hMenu, CHAR * itemstr, WORD id)
|
|||||||
|
|
||||||
PPPC::PPPC(HINSTANCE hInstance, const char * config_file)
|
PPPC::PPPC(HINSTANCE hInstance, const char * config_file)
|
||||||
{
|
{
|
||||||
|
if (config_file != NULL)
|
||||||
|
{
|
||||||
|
m_config.read(config_file);
|
||||||
|
}
|
||||||
|
|
||||||
/* Load the application icon */
|
/* Load the application icon */
|
||||||
HICON icon = ::LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
|
HICON icon = ::LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
|
||||||
if (icon == 0)
|
if (icon == 0)
|
||||||
|
3
pppc.h
3
pppc.h
@ -2,6 +2,8 @@
|
|||||||
#ifndef PPPC_H
|
#ifndef PPPC_H
|
||||||
#define PPPC_H
|
#define PPPC_H
|
||||||
|
|
||||||
|
#include "Config.h"
|
||||||
|
|
||||||
#define APP_NAME "Parallel Port Power Controller"
|
#define APP_NAME "Parallel Port Power Controller"
|
||||||
#define WM_ICON_NOTIFY (WM_APP + 42)
|
#define WM_ICON_NOTIFY (WM_APP + 42)
|
||||||
|
|
||||||
@ -13,6 +15,7 @@ class PPPC
|
|||||||
BOOL mainLoop();
|
BOOL mainLoop();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Config m_config;
|
||||||
HWND m_hWnd;
|
HWND m_hWnd;
|
||||||
NOTIFYICONDATA m_nid;
|
NOTIFYICONDATA m_nid;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user