summaryrefslogtreecommitdiffabout
path: root/PropsServer.cpp
Unidiff
Diffstat (limited to 'PropsServer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--PropsServer.cpp19
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
@@ -20,52 +20,57 @@ 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
29CPropsServer::~CPropsServer() 30CPropsServer::~CPropsServer()
30{ 31{
31} 32}
32 33
33void CPropsServer::DoDataExchange(CDataExchange* pDX) 34void 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
51BEGIN_MESSAGE_MAP(CPropsServer, CPropertyPage) 54BEGIN_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
55END_MESSAGE_MAP() 59END_MESSAGE_MAP()
56 60
57///////////////////////////////////////////////////////////////////////////// 61/////////////////////////////////////////////////////////////////////////////
58// CPropsServer message handlers 62// CPropsServer message handlers
59 63
60BOOL CPropsServer::OnInitDialog() 64BOOL 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
71void CPropsServer::OnBrowse() 76void CPropsServer::OnBrowse()
@@ -74,6 +79,20 @@ 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
86void 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}