00001 // 00002 // DlgCloseMode.cpp 00003 // 00004 // Copyright (c) Shareaza Development Team, 2002-2005. 00005 // This file is part of SHAREAZA (www.shareaza.com) 00006 // 00007 // Shareaza is free software; you can redistribute it 00008 // and/or modify it under the terms of the GNU General Public License 00009 // as published by the Free Software Foundation; either version 2 of 00010 // the License, or (at your option) any later version. 00011 // 00012 // Shareaza is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with Shareaza; if not, write to the Free Software 00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 // 00021 00022 #include "StdAfx.h" 00023 #include "Shareaza.h" 00024 #include "Settings.h" 00025 #include "DlgCloseMode.h" 00026 00027 #ifdef _DEBUG 00028 #define new DEBUG_NEW 00029 #undef THIS_FILE 00030 static char THIS_FILE[] = __FILE__; 00031 #endif 00032 00033 BEGIN_MESSAGE_MAP(CCloseModeDlg, CSkinDialog) 00034 //{{AFX_MSG_MAP(CCloseModeDlg) 00035 //}}AFX_MSG_MAP 00036 END_MESSAGE_MAP() 00037 00038 00040 // CCloseModeDlg dialog 00041 00042 CCloseModeDlg::CCloseModeDlg(CWnd* pParent) : CSkinDialog( CCloseModeDlg::IDD, pParent ) 00043 { 00044 //{{AFX_DATA_INIT(CCloseModeDlg) 00045 m_nMode = -1; 00046 //}}AFX_DATA_INIT 00047 } 00048 00049 void CCloseModeDlg::DoDataExchange(CDataExchange* pDX) 00050 { 00051 CSkinDialog::DoDataExchange(pDX); 00052 //{{AFX_DATA_MAP(CCloseModeDlg) 00053 DDX_Radio(pDX, IDC_CLOSE_0, m_nMode); 00054 //}}AFX_DATA_MAP 00055 } 00056 00058 // CCloseModeDlg message handlers 00059 00060 BOOL CCloseModeDlg::OnInitDialog() 00061 { 00062 CSkinDialog::OnInitDialog(); 00063 00064 SkinMe( _T("CCloseModeDlg") ); 00065 00066 switch ( Settings.General.CloseMode ) 00067 { 00068 case 0: case 2: 00069 m_nMode = 0; 00070 break; 00071 case 1: 00072 m_nMode = 1; 00073 break; 00074 case 3: 00075 m_nMode = 2; 00076 break; 00077 } 00078 00079 UpdateData( FALSE ); 00080 00081 return TRUE; 00082 } 00083 00084 void CCloseModeDlg::OnOK() 00085 { 00086 UpdateData(); 00087 00088 switch ( m_nMode ) 00089 { 00090 case 0: 00091 Settings.General.CloseMode = 2; 00092 break; 00093 case 1: 00094 Settings.General.CloseMode = 1; 00095 break; 00096 case 2: 00097 Settings.General.CloseMode = 3; 00098 break; 00099 } 00100 00101 CSkinDialog::OnOK(); 00102 }