-rw-r--r-- | PropsServer.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/PropsServer.cpp b/PropsServer.cpp index 6f1e08c..a3948e0 100644 --- a/PropsServer.cpp +++ b/PropsServer.cpp | |||
@@ -1,79 +1,98 @@ | |||
1 | // PropsServer.cpp : implementation file | 1 | // PropsServer.cpp : implementation file |
2 | // | 2 | // |
3 | 3 | ||
4 | #include "stdafx.h" | 4 | #include "stdafx.h" |
5 | #include "PumpKIN.h" | 5 | #include "PumpKIN.h" |
6 | #include "PropsServer.h" | 6 | #include "PropsServer.h" |
7 | 7 | ||
8 | #ifdef _DEBUG | 8 | #ifdef _DEBUG |
9 | #define new DEBUG_NEW | 9 | #define new DEBUG_NEW |
10 | #undef THIS_FILE | 10 | #undef THIS_FILE |
11 | static char THIS_FILE[] = __FILE__; | 11 | static char THIS_FILE[] = __FILE__; |
12 | #endif | 12 | #endif |
13 | 13 | ||
14 | ///////////////////////////////////////////////////////////////////////////// | 14 | ///////////////////////////////////////////////////////////////////////////// |
15 | // CPropsServer property page | 15 | // CPropsServer property page |
16 | 16 | ||
17 | IMPLEMENT_DYNCREATE(CPropsServer, CPropertyPage) | 17 | IMPLEMENT_DYNCREATE(CPropsServer, CPropertyPage) |
18 | 18 | ||
19 | CPropsServer::CPropsServer() : CPropertyPage(CPropsServer::IDD) | 19 | CPropsServer::CPropsServer() : CPropertyPage(CPropsServer::IDD) |
20 | { | 20 | { |
21 | //{{AFX_DATA_INIT(CPropsServer) | 21 | //{{AFX_DATA_INIT(CPropsServer) |
22 | m_RRQMode = -1; | 22 | m_RRQMode = -1; |
23 | m_TFTPRoot = _T(""); | 23 | m_TFTPRoot = _T(""); |
24 | m_TFTPSubdirs = FALSE; | 24 | m_TFTPSubdirs = FALSE; |
25 | m_WRQMode = -1; | 25 | m_WRQMode = -1; |
26 | m_LogFile = _T(""); | ||
26 | //}}AFX_DATA_INIT | 27 | //}}AFX_DATA_INIT |
27 | } | 28 | } |
28 | 29 | ||
29 | CPropsServer::~CPropsServer() | 30 | CPropsServer::~CPropsServer() |
30 | { | 31 | { |
31 | } | 32 | } |
32 | 33 | ||
33 | void CPropsServer::DoDataExchange(CDataExchange* pDX) | 34 | void CPropsServer::DoDataExchange(CDataExchange* pDX) |
34 | { | 35 | { |
35 | CPropertyPage::DoDataExchange(pDX); | 36 | CPropertyPage::DoDataExchange(pDX); |
36 | //{{AFX_DATA_MAP(CPropsServer) | 37 | //{{AFX_DATA_MAP(CPropsServer) |
38 | DDX_Control(pDX, IDC_LOGFILE_BROWSE, m_LogBrowseCtl); | ||
37 | DDX_Control(pDX, IDC_BROWSE, m_BrowseCtl); | 39 | DDX_Control(pDX, IDC_BROWSE, m_BrowseCtl); |
38 | DDX_Control(pDX, IDC_PROMPTTIMEOUT, m_PromptTimeoutCtl); | 40 | DDX_Control(pDX, IDC_PROMPTTIMEOUT, m_PromptTimeoutCtl); |
39 | DDX_Radio(pDX, IDC_RRQ_GIVEALL, m_RRQMode); | 41 | DDX_Radio(pDX, IDC_RRQ_GIVEALL, m_RRQMode); |
40 | DDX_Text(pDX, IDC_TFTPROOT, m_TFTPRoot); | 42 | DDX_Text(pDX, IDC_TFTPROOT, m_TFTPRoot); |
41 | DDX_Check(pDX, IDC_TFTPSUBDIRS, m_TFTPSubdirs); | 43 | DDX_Check(pDX, IDC_TFTPSUBDIRS, m_TFTPSubdirs); |
42 | DDX_Radio(pDX, IDC_WRQ_TAKEALL, m_WRQMode); | 44 | DDX_Radio(pDX, IDC_WRQ_TAKEALL, m_WRQMode); |
45 | DDX_Text(pDX, IDC_LOGFILE, m_LogFile); | ||
43 | //}}AFX_DATA_MAP | 46 | //}}AFX_DATA_MAP |
44 | if(pDX->m_bSaveAndValidate) | 47 | if(pDX->m_bSaveAndValidate) |
45 | m_PromptTimeOut=m_PromptTimeoutCtl.GetPos(); | 48 | m_PromptTimeOut=m_PromptTimeoutCtl.GetPos(); |
46 | else | 49 | else |
47 | m_PromptTimeoutCtl.SetPos(m_PromptTimeOut); | 50 | m_PromptTimeoutCtl.SetPos(m_PromptTimeOut); |
48 | } | 51 | } |
49 | 52 | ||
50 | 53 | ||
51 | BEGIN_MESSAGE_MAP(CPropsServer, CPropertyPage) | 54 | BEGIN_MESSAGE_MAP(CPropsServer, CPropertyPage) |
52 | //{{AFX_MSG_MAP(CPropsServer) | 55 | //{{AFX_MSG_MAP(CPropsServer) |
53 | ON_BN_CLICKED(IDC_BROWSE, OnBrowse) | 56 | ON_BN_CLICKED(IDC_BROWSE, OnBrowse) |
57 | ON_BN_CLICKED(IDC_LOGFILE_BROWSE, OnLogfileBrowse) | ||
54 | //}}AFX_MSG_MAP | 58 | //}}AFX_MSG_MAP |
55 | END_MESSAGE_MAP() | 59 | END_MESSAGE_MAP() |
56 | 60 | ||
57 | ///////////////////////////////////////////////////////////////////////////// | 61 | ///////////////////////////////////////////////////////////////////////////// |
58 | // CPropsServer message handlers | 62 | // CPropsServer message handlers |
59 | 63 | ||
60 | BOOL CPropsServer::OnInitDialog() | 64 | BOOL CPropsServer::OnInitDialog() |
61 | { | 65 | { |
62 | CPropertyPage::OnInitDialog(); | 66 | CPropertyPage::OnInitDialog(); |
63 | 67 | ||
64 | m_PromptTimeoutCtl.SetRange(5,60); | 68 | m_PromptTimeoutCtl.SetRange(5,60); |
65 | m_BrowseCtl.SetIcon(AfxGetApp()->LoadIcon(IDI_BROWSE)); | 69 | m_BrowseCtl.SetIcon(AfxGetApp()->LoadIcon(IDI_BROWSE)); |
70 | m_LogBrowseCtl.SetIcon(AfxGetApp()->LoadIcon(IDI_BROWSE)); | ||
66 | 71 | ||
67 | return TRUE; // return TRUE unless you set the focus to a control | 72 | return TRUE; // return TRUE unless you set the focus to a control |
68 | // EXCEPTION: OCX Property Pages should return FALSE | 73 | // EXCEPTION: OCX Property Pages should return FALSE |
69 | } | 74 | } |
70 | 75 | ||
71 | void CPropsServer::OnBrowse() | 76 | void CPropsServer::OnBrowse() |
72 | { | 77 | { |
73 | CString nr = m_TFTPRoot; | 78 | CString nr = m_TFTPRoot; |
74 | if(Klever::BrowseForFolder(nr,IDS_SELECT_TFTPROOT,this)){ | 79 | if(Klever::BrowseForFolder(nr,IDS_SELECT_TFTPROOT,this)){ |
75 | UpdateData(TRUE); | 80 | UpdateData(TRUE); |
76 | m_TFTPRoot=nr; | 81 | m_TFTPRoot=nr; |
77 | UpdateData(FALSE); | 82 | UpdateData(FALSE); |
78 | } | 83 | } |
79 | } | 84 | } |
85 | |||
86 | void CPropsServer::OnLogfileBrowse() | ||
87 | { | ||
88 | UpdateData(TRUE); | ||
89 | CFileDialog cfd( | ||
90 | FALSE, ".log", (LPCSTR)m_LogFile, | ||
91 | OFN_EXPLORER|OFN_HIDEREADONLY|OFN_LONGNAMES|OFN_NOCHANGEDIR|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST, | ||
92 | "Log files (*.log)|*.log|All Files (*.*)|*.*||", | ||
93 | this); | ||
94 | if(cfd.DoModal()==IDOK) { | ||
95 | m_LogFile = cfd.GetPathName(); | ||
96 | UpdateData(FALSE); | ||
97 | } | ||
98 | } | ||