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