本文整理汇总了C++中CDownload::IsTorrent方法的典型用法代码示例。如果您正苦于以下问题:C++ CDownload::IsTorrent方法的具体用法?C++ CDownload::IsTorrent怎么用?C++ CDownload::IsTorrent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDownload
的用法示例。
在下文中一共展示了CDownload::IsTorrent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInitDialog
BOOL CTorrentGeneralPage::OnInitDialog()
{
if ( ! CPropertyPageAdv::OnInitDialog() )
return FALSE;
ASSUME_LOCK( Transfers.m_pSection );
CDownload* pDownload = ((CDownloadSheet*)GetParent())->GetDownload();
ASSERT( pDownload && pDownload->IsTorrent() );
CBTInfo& oInfo = pDownload->m_pTorrent;
m_sName = oInfo.m_sName;
m_sComment = oInfo.m_sComment;
m_sCreatedBy = oInfo.m_sCreatedBy;
if ( oInfo.m_tCreationDate > 0 )
{
CTime pTime( (time_t)oInfo.m_tCreationDate );
m_sCreationDate = pTime.Format( _T("%Y-%m-%d %H:%M") );
}
// Assembler 'other' string
if ( oInfo.m_bPrivate )
{
m_sTorrentOther += LoadString( IDS_BT_PRIVATE );
m_sTorrentOther += _T(", ");
}
if ( oInfo.HasEncodingError() )
{
m_sTorrentOther += LoadString( IDS_BT_ENCODING );
m_sTorrentOther += _T(", ");
}
// Cut off last comma
if ( ! m_sTorrentOther.IsEmpty() )
m_sTorrentOther = m_sTorrentOther.Left( m_sTorrentOther.GetLength() - 2 );
m_wndStartDownloads.SetCurSel( oInfo.m_nStartDownloads );
m_sUploadTotal.Format( _T(" %s"),
(LPCTSTR)Settings.SmartVolume( oInfo.m_nTotalUpload ) );
UpdateData( FALSE );
return TRUE;
}
示例2: OnInitDialog
BOOL CTorrentTrackersPage::OnInitDialog()
{
if ( ! CPropertyPageAdv::OnInitDialog() )
return FALSE;
m_wndAdd.SetIcon( CoolInterface.ExtractIcon( ID_MEDIA_ADD ) );
m_wndDel.SetIcon( CoolInterface.ExtractIcon( ID_MEDIA_REMOVE ) );
// m_wndRename.SetIcon( CoolInterface.ExtractIcon( ID_LIBRARY_RENAME ) );
ASSUME_LOCK( Transfers.m_pSection );
CDownloadSheet* pSheet = (CDownloadSheet*)GetParent();
CDownload* pDownload = pSheet->GetDownload();
ASSERT( pDownload && pDownload->IsTorrent() );
CBTInfo& oInfo = pDownload->m_pTorrent;
m_sOriginalTracker = oInfo.GetTrackerAddress();
m_wndTracker.SetWindowText( m_sOriginalTracker );
int nCount = oInfo.GetTrackerCount();
m_nOriginalMode = oInfo.GetTrackerMode();
m_wndTrackerMode.SetCurSel( m_nOriginalMode );
// Remove invalid modes
//if ( nCount < 2 )
//{
// m_wndTrackerMode.DeleteString( CBTInfo::tMultiFound );
// m_wndTrackerMode.DeleteString( CBTInfo::tMultiFinding );
//}
CRect rc;
m_wndTrackers.GetClientRect( &rc );
rc.right -= GetSystemMetrics( SM_CXVSCROLL );
CoolInterface.SetImageListTo( m_wndTrackers, LVSIL_SMALL );
m_wndTrackers.SetExtendedStyle( LVS_EX_DOUBLEBUFFER|LVS_EX_HEADERDRAGDROP|LVS_EX_FULLROWSELECT|LVS_EX_LABELTIP );
m_wndTrackers.InsertColumn( 0, _T("Tracker"), LVCFMT_LEFT, rc.right - 82, -1 );
m_wndTrackers.InsertColumn( 1, _T("Status"), LVCFMT_CENTER, 82, 0 );
m_wndTrackers.InsertColumn( 2, _T("Type"), LVCFMT_CENTER, 0, 0 );
Skin.Translate( _T("CTorrentTrackerList"), m_wndTrackers.GetHeaderCtrl() );
if ( m_wndTrackers.SetBkImage( Skin.GetWatermark( _T("CListCtrl") ) ) ) // || m_wndTrackers.SetBkImage( Images.m_bmSystemWindow.m_hObject ) "System.Windows"
m_wndTrackers.SetExtendedStyle( LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP|LVS_EX_LABELTIP ); // No LVS_EX_DOUBLEBUFFER
else
{
m_wndTrackers.SetBkColor( Colors.m_crWindow );
m_wndTrackers.SetTextBkColor( Colors.m_crWindow );
}
m_wndTrackers.SetTextColor( Colors.m_crText );
for ( int nTracker = 0 ; nTracker < nCount ; nTracker++ )
{
//LV_ITEM pItem = {};
//pItem.mask = LVIF_TEXT|LVIF_IMAGE|LVIF_PARAM;
//pItem.iItem = m_wndTrackers.GetItemCount();
//pItem.lParam = (LPARAM)nTracker;
//
//if ( oInfo.GetTrackerIndex() == nTracker )
// pItem.iImage = CoolInterface.ImageForID( ID_MEDIA_SELECT );
//else if ( oInfo.GetTrackerAddress( nTracker ).GetAt( 0 ) == BAD_TRACKER_TOKEN )
// pItem.iImage = CoolInterface.ImageForID( ID_DISCOVERY_BLOCKED );
//else
// pItem.iImage = CoolInterface.ImageForID( ID_DOWNLOADS_URI );
//
//pItem.pszText = (LPTSTR)(LPCTSTR)oInfo.GetTrackerAddress( nTracker );
//pItem.iItem = m_wndTrackers.InsertItem( &pItem );
CString strTracker = oInfo.GetTrackerAddress( nTracker );
m_sOriginalTrackers.AddTail( strTracker );
// Display status
CString strStatus;
UINT nStatusIcon = ID_DOWNLOADS_URI;
if ( ! StartsWith( oInfo.GetTrackerAddress( nTracker ), _PT("http://") ) &&
! StartsWith( oInfo.GetTrackerAddress( nTracker ), _PT("udp://") ) )
{
// Bad format, or BAD_TRACKER_TOKEN Tagged for display only (*https:// etc.)
LoadString( strStatus, IDS_STATUS_UNSUPPORTED );
nStatusIcon = ID_DISCOVERY_BLOCKED;
}
else
{
switch ( oInfo.GetTrackerStatus( nTracker ) )
{
case TRI_TRUE:
LoadString( strStatus, IDS_STATUS_ACTIVE );
break;
case TRI_FALSE:
LoadString( strStatus, IDS_STATUS_TRACKERDOWN );
break;
case TRI_UNKNOWN:
LoadString( strStatus, IDS_STATUS_UNKNOWN );
// break;
}
}
// pItem.iItem
int nItem = m_wndTrackers.InsertItem( m_wndTrackers.GetItemCount(), strTracker, CoolInterface.ImageForID( nStatusIcon ) );
//.........这里部分代码省略.........