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

PageProfileCertificate.cpp

Go to the documentation of this file.
00001 //
00002 // PageProfileCertificate.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 "GProfile.h"
00026 #include "XML.h"
00027 #include "PageProfileCertificate.h"
00028 
00029 #ifdef _DEBUG
00030 #define new DEBUG_NEW
00031 #undef THIS_FILE
00032 static char THIS_FILE[] = __FILE__;
00033 #endif
00034 
00035 IMPLEMENT_DYNCREATE(CCertificateProfilePage, CSettingsPage)
00036 
00037 BEGIN_MESSAGE_MAP(CCertificateProfilePage, CSettingsPage)
00038         //{{AFX_MSG_MAP(CCertificateProfilePage)
00039         ON_BN_CLICKED(IDC_GUID_CREATE, OnGuidCreate)
00040         //}}AFX_MSG_MAP
00041 END_MESSAGE_MAP()
00042 
00043 
00045 // CCertificateProfilePage property page
00046 
00047 CCertificateProfilePage::CCertificateProfilePage() : CSettingsPage( CCertificateProfilePage::IDD )
00048 {
00049         //{{AFX_DATA_INIT(CCertificateProfilePage)
00050         m_sGUID = _T("");
00051         m_sTime = _T("");
00052         //}}AFX_DATA_INIT
00053 }
00054 
00055 CCertificateProfilePage::~CCertificateProfilePage()
00056 {
00057 }
00058 
00059 void CCertificateProfilePage::DoDataExchange(CDataExchange* pDX)
00060 {
00061         CSettingsPage::DoDataExchange(pDX);
00062         //{{AFX_DATA_MAP(CCertificateProfilePage)
00063         DDX_Text(pDX, IDC_GUID, m_sGUID);
00064         DDX_Text(pDX, IDC_GUID_TIME, m_sTime);
00065         //}}AFX_DATA_MAP
00066 }
00067 
00069 // CCertificateProfilePage message handlers
00070 
00071 BOOL CCertificateProfilePage::OnInitDialog()
00072 {
00073         CSettingsPage::OnInitDialog();
00074 
00075         wchar_t szGUID[39];
00076         GGUID tmp( MyProfile.GUID );
00077         szGUID[ StringFromGUID2( *(GUID*)&tmp, szGUID, 39 ) - 2 ] = 0;
00078         m_sGUID = (CString)&szGUID[1];
00079 
00080         UpdateData( FALSE );
00081 
00082         return TRUE;
00083 }
00084 
00085 void CCertificateProfilePage::OnGuidCreate()
00086 {
00087         MyProfile.Create();
00088 
00089         UpdateData( TRUE );
00090 
00091         wchar_t szGUID[39];
00092         GGUID tmp( MyProfile.GUID );
00093         szGUID[ StringFromGUID2( *(GUID*)&tmp, szGUID, 39 ) - 2 ] = 0;
00094         m_sGUID = (CString)&szGUID[1];
00095 
00096         UpdateData( FALSE );
00097 }
00098 
00099 void CCertificateProfilePage::OnOK()
00100 {
00101         UpdateData();
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