00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "StdAfx.h"
00023 #include "Shareaza.h"
00024 #include "PageSettingsProtocols.h"
00025
00026 #ifdef _DEBUG
00027 #define new DEBUG_NEW
00028 #undef THIS_FILE
00029 static char THIS_FILE[] = __FILE__;
00030 #endif
00031
00032 IMPLEMENT_DYNCREATE(CProtocolsSettingsPage, CSettingsPage)
00033
00034 BEGIN_MESSAGE_MAP(CProtocolsSettingsPage, CSettingsPage)
00035
00036
00037 END_MESSAGE_MAP()
00038
00039
00041
00042
00043 CProtocolsSettingsPage::CProtocolsSettingsPage() : CSettingsPage(CProtocolsSettingsPage::IDD)
00044 {
00045
00046
00047 }
00048
00049 CProtocolsSettingsPage::~CProtocolsSettingsPage()
00050 {
00051 }
00052
00053 void CProtocolsSettingsPage::DoDataExchange(CDataExchange* pDX)
00054 {
00055 CSettingsPage::DoDataExchange(pDX);
00056
00057 DDX_Control(pDX, IDC_PROTOCOLS, m_wndTree);
00058
00059 }
00060
00062
00063
00064 BOOL CProtocolsSettingsPage::OnInitDialog()
00065 {
00066 CSettingsPage::OnInitDialog();
00067
00068 HTREEITEM hNetworks = AddItem( NULL, _T("Peer-to-Peer Network Protocols") );
00069
00070 HTREEITEM hG2 = AddItem( hNetworks, _T("Gnutella2 Network") );
00071 AddItem( hG2, _T("Name"), _T("Gnutella2") );
00072 AddItem( hG2, _T("Type"), _T("Decentralised") );
00073 AddItem( hG2, _T("PrimaryURN"), _T("sha1") );
00074 AddItem( hG2, _T("NodeClass"), _T("Hub, Leaf") );
00075 AddItem( hG2, _T("ProtocolVersion"), _T("1.0") );
00076 AddItem( hG2, _T("ComponentVersion"), _T("2.0.0.0") );
00077
00078 HTREEITEM hG1 = AddItem( hNetworks, _T("Gnutella1 Network") );
00079 AddItem( hG1, _T("Name"), _T("Gnutella1") );
00080 AddItem( hG1, _T("Type"), _T("Decentralised") );
00081 AddItem( hG1, _T("PrimaryURN"), _T("sha1") );
00082 AddItem( hG1, _T("NodeClass"), _T("Leaf, Ultrapeer, Peer") );
00083 AddItem( hG1, _T("ProtocolVersion"), _T("0.6") );
00084 AddItem( hG1, _T("ComponentVersion"), _T("2.0.0.0") );
00085
00086 HTREEITEM hED = AddItem( hNetworks, _T("eDonkey2000 Network") );
00087 AddItem( hED, _T("Name"), _T("eDonkey2000") );
00088 AddItem( hED, _T("Type"), _T("Server-Based") );
00089 AddItem( hED, _T("PrimaryURN"), _T("ed2k (compound md4)") );
00090 AddItem( hED, _T("NodeClass"), _T("Client") );
00091 AddItem( hED, _T("ProtocolVersion"), _T("1.0") );
00092 AddItem( hED, _T("ComponentVersion"), _T("2.2.0.0") );
00093
00094 HTREEITEM hTransfers = AddItem( NULL, _T("File Transfer Protocols") );
00095
00096 HTREEITEM hHTTP = AddItem( hTransfers, _T("Hypertext Transfer Protocol (HTTP)") );
00097 AddItem( hHTTP, _T("Name"), _T("Hypertext Transfer Protocol (HTTP)") );
00098 AddItem( hHTTP, _T("Prefix"), _T("http://") );
00099 AddItem( hHTTP, _T("TransferMode"), _T("Stream") );
00100 AddItem( hHTTP, _T("Directions"), _T("Download, Upload") );
00101 AddItem( hHTTP, _T("Capabilities"), _T("THEX, PFS, Metadata, HUGE, Browse") );
00102 AddItem( hHTTP, _T("Encodings"), _T("Deflate, Backwards") );
00103 AddItem( hHTTP, _T("ProtocolVersion"), _T("1.1") );
00104 AddItem( hHTTP, _T("ComponentVersion"), _T("2.0.0.0") );
00105
00106 HTREEITEM hFTP = AddItem( hTransfers, _T("File Transfer Protocol (FTP)") );
00107 AddItem( hFTP, _T("Name"), _T("File Transfer Protocol (FTP)") );
00108 AddItem( hFTP, _T("Prefix"), _T("ftp://") );
00109 AddItem( hFTP, _T("TransferMode"), _T("Stream") );
00110 AddItem( hFTP, _T("Directions"), _T("Download") );
00111 AddItem( hFTP, _T("Capabilities"), _T("Passive") );
00112 AddItem( hFTP, _T("ProtocolVersion"), _T("1.0") );
00113 AddItem( hFTP, _T("ComponentVersion"), _T("2.2.0.0") );
00114
00115 HTREEITEM hEFTP = AddItem( hTransfers, _T("eDonkey2000 Client Link (EFTP)") );
00116 AddItem( hEFTP, _T("Name"), _T("eDonkey2000 Client Link FTP (EFTP)") );
00117 AddItem( hEFTP, _T("Prefix"), _T("ed2kftp://") );
00118 AddItem( hEFTP, _T("TransferMode"), _T("Block") );
00119 AddItem( hEFTP, _T("Directions"), _T("Download, Upload") );
00120 AddItem( hEFTP, _T("Capabilities"), _T("Hashset, SourceExchange, Deflate") );
00121 AddItem( hEFTP, _T("ProtocolVersion"), _T("1.0") );
00122 AddItem( hEFTP, _T("ComponentVersion"), _T("2.2.0.0") );
00123
00124 HTREEITEM hBT = AddItem( hTransfers, _T("BitTorrent Coupling (BT)") );
00125 AddItem( hBT, _T("Name"), _T("BitTorrent Coupling (BT)") );
00126 AddItem( hBT, _T("Prefix"), _T("btc://") );
00127 AddItem( hBT, _T("TransferMode"), _T("Block") );
00128 AddItem( hBT, _T("Directions"), _T("Download, Upload") );
00129
00130 AddItem( hBT, _T("ProtocolVersion"), _T("1.0") );
00131 AddItem( hBT, _T("ComponentVersion"), _T("2.2.0.0") );
00132
00133 return TRUE;
00134 }
00135
00136 HTREEITEM CProtocolsSettingsPage::AddItem(HTREEITEM hParent, LPCTSTR pszText, LPCTSTR pszValue)
00137 {
00138 if ( theApp.m_bRTL ) m_wndTree.ModifyStyleEx( 0, TVS_RTLREADING, 0 );
00139 if ( pszValue != NULL )
00140 {
00141 CString str;
00142 str.Format( _T("%s = %s"), pszText, pszValue );
00143 if ( theApp.m_bRTL ) str = _T("\x202A") + str;
00144 return m_wndTree.InsertItem( TVIF_TEXT|TVIF_STATE,
00145 str, 0, 0, 0, 0, 0, hParent, TVI_LAST );
00146 }
00147 else
00148 {
00149 CString str(pszText);
00150 if ( theApp.m_bRTL ) str = _T("\x202A") + str;
00151 return m_wndTree.InsertItem( TVIF_TEXT|TVIF_STATE,
00152 str, 0, 0, TVIS_EXPANDED|TVIS_BOLD,
00153 TVIS_EXPANDED|TVIS_BOLD, 0, hParent, TVI_LAST );
00154 }
00155 }