本文整理汇总了C++中CDownload::Resume方法的典型用法代码示例。如果您正苦于以下问题:C++ CDownload::Resume方法的具体用法?C++ CDownload::Resume怎么用?C++ CDownload::Resume使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDownload
的用法示例。
在下文中一共展示了CDownload::Resume方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Add
CDownload* CDownloads::Add(CQueryHit* pHit, BOOL bAddToHead)
{
CSingleLock pLock( &Transfers.m_pSection, TRUE );
CDownload* pDownload = NULL;
if ( pDownload == NULL && pHit->m_bSHA1 )
pDownload = FindBySHA1( &pHit->m_pSHA1 );
if ( pDownload == NULL && pHit->m_bTiger )
pDownload = FindByTiger( &pHit->m_pTiger );
if ( pDownload == NULL && pHit->m_bED2K )
pDownload = FindByED2K( &pHit->m_pED2K );
if ( pDownload != NULL )
{
theApp.Message( MSG_DOWNLOAD, IDS_DOWNLOAD_ALREADY, (LPCTSTR)pHit->m_sName );
pDownload->AddSourceHit( pHit );
pDownload->Resume();
}
else
{
pDownload = new CDownload();
pDownload->AddSourceHit( pHit, TRUE );
if ( bAddToHead ) m_pList.AddHead( pDownload );
else m_pList.AddTail( pDownload );
theApp.Message( MSG_DOWNLOAD, IDS_DOWNLOAD_ADDED,
(LPCTSTR)pDownload->GetDisplayName(), pDownload->GetSourceCount() );
if( pDownload->m_bSHA1 ) pDownload->m_bSHA1Trusted = TRUE;
else if( pDownload->m_bED2K ) pDownload->m_bED2KTrusted = TRUE;
}
pHit->m_bDownload = TRUE;
DownloadGroups.Link( pDownload );
Transfers.StartThread();
if ( ( (pDownload->GetSourceCount() == 0 ) || ( pDownload->m_bED2K && ! pDownload->m_bSHA1 ) )
&&( (GetTryingCount() < Settings.Downloads.MaxFiles ) || ( bAddToHead ) ) )
{
pDownload->SetStartTimer();
}
return pDownload;
}
示例2: PageDownloads
void CRemote::PageDownloads()
{
if ( CheckCookie() ) return;
m_nTab = tabDownloads;
CString str;
str.Format( L"%i", GetRandomNum( 0i32, _I32_MAX ) );
CSingleLock pLock( &DownloadGroups.m_pSection, TRUE );
Prepare(); // Header
Add( L"random", str );
Output( L"downloadsHeader" );
BOOL bExclusive = ! GetKey( L"group_exclusive" ).IsEmpty();
BOOL bReveal = ! GetKey( L"group_reveal" ).IsEmpty();
for ( POSITION posGroup = DownloadGroups.GetIterator(); posGroup != NULL; )
{
CDownloadGroup* pGroup = DownloadGroups.GetNext( posGroup );
CString strGroupID;
strGroupID.Format( L"%p", pGroup );
Add( L"group_id", strGroupID );
if ( bExclusive )
pGroup->m_bRemoteSelected = ( GetKey( L"group_exclusive" ) == strGroupID );
else if ( bReveal )
pGroup->m_bRemoteSelected = TRUE;
else if ( GetKey( L"group_select" ) == strGroupID )
pGroup->m_bRemoteSelected = TRUE;
else if ( GetKey( L"group_deselect" ) == strGroupID )
pGroup->m_bRemoteSelected = FALSE;
Add( L"group_caption", pGroup->m_sName );
if ( pGroup->m_bRemoteSelected )
Add( L"group_selected", L"true" );
Output( L"downloadsTab" );
Prepare( L"group_" );
}
if ( ! GetKey( L"filter_set" ).IsEmpty() )
{
Settings.Downloads.FilterMask &= ~( DLF_ACTIVE | DLF_PAUSED | DLF_QUEUED | DLF_SOURCES | DLF_SEED );
if ( GetKey( L"filter_active" ) == L"1" ) Settings.Downloads.FilterMask |= DLF_ACTIVE;
if ( GetKey( L"filter_paused" ) == L"1" ) Settings.Downloads.FilterMask |= DLF_PAUSED;
if ( GetKey( L"filter_queued" ) == L"1" ) Settings.Downloads.FilterMask |= DLF_QUEUED;
if ( GetKey( L"filter_sources" ) == L"1" ) Settings.Downloads.FilterMask |= DLF_SOURCES;
if ( GetKey( L"filter_seeds" ) == L"1" ) Settings.Downloads.FilterMask |= DLF_SEED;
Settings.Downloads.ShowSources = ( GetKey( L"filter_show_all" ) == L"1" );
}
Add( L"filter_active", ( Settings.Downloads.FilterMask & DLF_ACTIVE ) ? L"checked=\"checked\"" : L"" );
Add( L"filter_paused", ( Settings.Downloads.FilterMask & DLF_PAUSED ) ? L"checked=\"checked\"" : L"" );
Add( L"filter_queued", ( Settings.Downloads.FilterMask & DLF_QUEUED ) ? L"checked=\"checked\"" : L"" );
Add( L"filter_sources", ( Settings.Downloads.FilterMask & DLF_SOURCES ) ? L"checked=\"checked\"" : L"" );
Add( L"filter_seeds", ( Settings.Downloads.FilterMask & DLF_PAUSED ) ? L"checked=\"checked\"" : L"" );
Add( L"filter_show_all", Settings.Downloads.ShowSources ? L"checked=\"checked\"" : L"" );
Output( L"downloadsTop" );
for ( POSITION posDownload = Downloads.GetIterator(); posDownload != NULL; )
{
CDownload* pDownload = Downloads.GetNext( posDownload );
CString strDownloadID;
strDownloadID.Format( L"%p", pDownload );
if ( GetKey( L"modify_id" ) == strDownloadID )
{
CString strAction = GetKey( L"modify_action" );
strAction.MakeLower();
if ( strAction == L"expand" )
{
if ( CDownloadsCtrl::IsExpandable( pDownload ) )
pDownload->m_bExpanded = TRUE;
}
else if ( strAction == L"collapse" )
{
if ( CDownloadsCtrl::IsExpandable( pDownload ) )
pDownload->m_bExpanded = FALSE;
}
else if ( strAction == L"resume" )
{
pDownload->Resume();
}
else if ( strAction == L"pause" )
{
if ( ! pDownload->IsPaused() && ! pDownload->IsTasking() )
pDownload->Pause();
}
else if ( strAction == L"cancel" )
{
if ( ! pDownload->IsTasking() )
pDownload->Remove();
continue;
}
else if ( strAction == L"clear" )
{
if ( pDownload->IsCompleted() && ! pDownload->IsPreviewVisible() )
//.........这里部分代码省略.........