Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

PageSettingsCommunity.cpp

Go to the documentation of this file.
00001 //
00002 // PageSettingsCommunity.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 "PageSettingsCommunity.h"
00026 #include "DlgProfileManager.h"
00027 
00028 #ifdef _DEBUG
00029 #define new DEBUG_NEW
00030 #undef THIS_FILE
00031 static char THIS_FILE[] = __FILE__;
00032 #endif
00033 
00034 IMPLEMENT_DYNCREATE(CCommunitySettingsPage, CSettingsPage)
00035 
00036 BEGIN_MESSAGE_MAP(CCommunitySettingsPage, CSettingsPage)
00037         //{{AFX_MSG_MAP(CCommunitySettingsPage)
00038         ON_BN_CLICKED(IDC_EDIT_PROFILE, OnEditProfile)
00039         //}}AFX_MSG_MAP
00040 END_MESSAGE_MAP()
00041 
00042 
00044 // CCommunitySettingsPage property page
00045 
00046 CCommunitySettingsPage::CCommunitySettingsPage() : CSettingsPage(CCommunitySettingsPage::IDD)
00047 {
00048         //{{AFX_DATA_INIT(CCommunitySettingsPage)
00049         m_bChatEnable = FALSE;
00050         m_bChatAllNetworks = FALSE;
00051         m_bChatFilter = FALSE;
00052         m_bChatCensor = FALSE;
00053         //}}AFX_DATA_INIT
00054 }
00055 
00056 CCommunitySettingsPage::~CCommunitySettingsPage()
00057 {
00058 }
00059 
00060 void CCommunitySettingsPage::DoDataExchange(CDataExchange* pDX)
00061 {
00062         CSettingsPage::DoDataExchange(pDX);
00063         //{{AFX_DATA_MAP(CCommunitySettingsPage)
00064         DDX_Check(pDX, IDC_CHAT_ENABLE, m_bChatEnable);
00065         DDX_Check(pDX, IDC_CHAT_ALLNETWORKS, m_bChatAllNetworks);
00066         DDX_Check(pDX, IDC_CHAT_FILTER, m_bChatFilter);
00067         DDX_Check(pDX, IDC_CHAT_CENSOR, m_bChatCensor);
00068         //}}AFX_DATA_MAP
00069 }
00070 
00072 // CCommunitySettingsPage message handlers
00073 
00074 BOOL CCommunitySettingsPage::OnInitDialog()
00075 {
00076         CSettingsPage::OnInitDialog();
00077 
00078         m_bChatEnable           = Settings.Community.ChatEnable;
00079         m_bChatAllNetworks      = Settings.Community.ChatAllNetworks;
00080         m_bChatFilter           = Settings.Community.ChatFilter;
00081         m_bChatCensor           = Settings.Community.ChatCensor;
00082 
00083         UpdateData( FALSE );
00084 
00085         return TRUE;
00086 }
00087 
00088 void CCommunitySettingsPage::OnEditProfile()
00089 {
00090         CProfileManagerDlg dlg;
00091         dlg.DoModal();
00092 }
00093 
00094 void CCommunitySettingsPage::OnOK()
00095 {
00096         UpdateData();
00097 
00098         Settings.Community.ChatEnable           = m_bChatEnable;
00099         Settings.Community.ChatAllNetworks      = m_bChatAllNetworks;
00100         Settings.Community.ChatFilter           = m_bChatFilter;
00101         Settings.Community.ChatCensor           = m_bChatCensor;
00102 
00103         CSettingsPage::OnOK();
00104 }
00105 

Generated on Thu Dec 15 10:39:45 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2