Skip to content

Commit

Permalink
Merge pull request #130 from ansani/106-the-resume-button-should-stay…
Browse files Browse the repository at this point in the history
…-accessible-even-if-there-are-already-resumed-or-completed-downloads-in-the-selection

Enable the resume button when selecting more downloads
  • Loading branch information
ansani committed Sep 25, 2023
2 parents cb1e6ba + 90ce358 commit 9bf4118
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions shareaza/WndDownloads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,14 @@ void CDownloadsWnd::OnUpdateDownloadsResume(CCmdUI* pCmdUI)
{
Prepare();
if ( CCoolBarItem* pcCmdUI = CCoolBarItem::FromCmdUI( pCmdUI ) )
pcCmdUI->Show( m_bSelPaused || ( m_bSelDownload && ! m_bSelTrying && ! m_bSelCompleted ) );
pCmdUI->Enable( m_bSelPaused || ( m_bSelDownload && ! m_bSelTrying && ! m_bSelCompleted ) );
pcCmdUI->Show( m_bSelPaused
|| ( m_bSelDownload && ! m_bSelTrying && ! m_bSelCompleted )
|| ( ( m_nSelectedDownloads > 1 ) && (m_bSelDownload && !m_bSelCompleted) )
);
pCmdUI->Enable( m_bSelPaused
|| ( m_bSelDownload && ! m_bSelTrying && ! m_bSelCompleted )
|| ((m_nSelectedDownloads > 1) && (m_bSelDownload && !m_bSelCompleted))
);
}

void CDownloadsWnd::OnDownloadsResume()
Expand All @@ -703,9 +709,13 @@ void CDownloadsWnd::OnDownloadsResume()
{
CDownload* pDownload = Downloads.GetNext( pos );

if ( pDownload->m_bSelected )
// We must checkexplicitily if the download is Trying (as we ignore the setting in group selection)
if ( pDownload->m_bSelected && !pDownload->IsTrying() )
{
pDownload->Resume();
}
else if (pDownload->IsTrying()) {
theApp.Message(MSG_INFO, _T("Cannot resume an already searching download"));
}
}

Expand Down

0 comments on commit 9bf4118

Please sign in to comment.