home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 217 / DPCS0306DVD.ISO / Toolkit / Internet / FileZilla / Server / FileZilla_Server-0.9.11.exe / source / interface / OptionsMiscPage.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2005-06-26  |  3.3 KB  |  94 lines

  1. // FileZilla Server - a Windows ftp server
  2.  
  3. // Copyright (C) 2002-2004 - Tim Kosse <tim.kosse@gmx.de>
  4.  
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9.  
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14.  
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18.  
  19. // OptionsMisc.cpp: Implementierungsdatei
  20. //
  21.  
  22. #include "stdafx.h"
  23. #include "filezilla server.h"
  24. #include "OptionsDlg.h"
  25. #include "Options.h"
  26. #include "OptionsPage.h"
  27. #include "OptionsMiscPage.h"
  28.  
  29. #if defined(_DEBUG) && !defined(MMGR)
  30. #define new DEBUG_NEW
  31. #undef THIS_FILE
  32. static char THIS_FILE[] = __FILE__;
  33. #endif
  34.  
  35. /////////////////////////////////////////////////////////////////////////////
  36. // Dialogfeld COptionsMisc 
  37.  
  38.  
  39. COptionsMiscPage::COptionsMiscPage(COptionsDlg *pOptionsDlg, CWnd* pParent /*=NULL*/)
  40.     : COptionsPage(pOptionsDlg, COptionsMiscPage::IDD, pParent)
  41. {
  42.     //{{AFX_DATA_INIT(COptionsMiscPage)
  43.     m_bDontShowPass = FALSE;
  44.     m_bStartMinimized = FALSE;
  45.     m_TransferBufferSize = _T("");
  46.     //}}AFX_DATA_INIT
  47. }
  48.  
  49.  
  50. void COptionsMiscPage::DoDataExchange(CDataExchange* pDX)
  51. {
  52.     COptionsPage::DoDataExchange(pDX);
  53.     //{{AFX_DATA_MAP(COptionsMiscPage)
  54.     DDX_Check(pDX, IDC_OPTIONS_MISC_DONTSHOWPASS, m_bDontShowPass);
  55.     DDX_Check(pDX, IDC_OPTIONS_MISC_STARTMINIMIZED, m_bStartMinimized);
  56.     DDX_Text(pDX, IDC_OPTIONS_TRANSFERBUFFERSIZE, m_TransferBufferSize);
  57.     DDV_MaxChars(pDX, m_TransferBufferSize, 6);
  58.     DDX_Text(pDX, IDC_OPTIONS_TRANSFERBUFFERSIZE2, m_TransferBufferSize2);
  59.     DDV_MaxChars(pDX, m_TransferBufferSize2, 6);
  60.     //}}AFX_DATA_MAP
  61. }
  62.  
  63.  
  64. BEGIN_MESSAGE_MAP(COptionsMiscPage, COptionsPage)
  65.     //{{AFX_MSG_MAP(COptionsMiscPage)
  66.     //}}AFX_MSG_MAP
  67. END_MESSAGE_MAP()
  68.  
  69. /////////////////////////////////////////////////////////////////////////////
  70. // Behandlungsroutinen fⁿr Nachrichten COptionsMiscPage
  71.  
  72. BOOL COptionsMiscPage::OnInitDialog() 
  73. {
  74.     COptionsPage::OnInitDialog();
  75.     
  76.     return TRUE;  // return TRUE unless you set the focus to a control
  77.                   // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurⁿckgeben
  78. }
  79.  
  80. void COptionsMiscPage::LoadData()
  81. {
  82.     m_bDontShowPass = m_pOptionsDlg->GetOptionVal(OPTION_LOGSHOWPASS) == 0;
  83.     m_bStartMinimized = m_pOptionsDlg->m_pInterfaceOptions->GetOptionVal(IOPTION_STARTMINIMIZED) != 0;
  84.     m_TransferBufferSize.Format("%d", m_pOptionsDlg->GetOptionVal(OPTION_BUFFERSIZE));
  85.     m_TransferBufferSize2.Format("%d", m_pOptionsDlg->GetOptionVal(OPTION_BUFFERSIZE2));
  86. }
  87.  
  88. void COptionsMiscPage::SaveData()
  89. {
  90.     m_pOptionsDlg->SetOption(OPTION_LOGSHOWPASS, m_bDontShowPass?0:1);
  91.     m_pOptionsDlg->m_pInterfaceOptions->SetOption(IOPTION_STARTMINIMIZED, m_bStartMinimized);
  92.     m_pOptionsDlg->SetOption(OPTION_BUFFERSIZE, _ttoi(m_TransferBufferSize));
  93.     m_pOptionsDlg->SetOption(OPTION_BUFFERSIZE2, _ttoi(m_TransferBufferSize2));
  94. }