Removing finished or missing downloads may have to disable the respective

other button.

git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@347 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
stippi 2010-03-23 15:13:56 +00:00 committed by Alexandre Deckner
parent f28abe9d24
commit f65c57d54e

View File

@ -748,6 +748,7 @@ DownloadWindow::_DownloadFinished(BWebDownload* download)
void
DownloadWindow::_RemoveFinishedDownloads()
{
int32 missingCount = 0;
for (int32 i = fDownloadViewsLayout->CountItems() - 1;
BLayoutItem* item = fDownloadViewsLayout->ItemAt(i); i--) {
DownloadProgressView* view = dynamic_cast<DownloadProgressView*>(
@ -757,9 +758,11 @@ DownloadWindow::_RemoveFinishedDownloads()
if (view->IsFinished()) {
view->RemoveSelf();
delete view;
}
} else if (view->IsMissing())
missingCount++;
}
fRemoveFinishedButton->SetEnabled(false);
fRemoveMissingButton->SetEnabled(missingCount > 0);
_SaveSettings();
}
@ -767,6 +770,7 @@ DownloadWindow::_RemoveFinishedDownloads()
void
DownloadWindow::_RemoveMissingDownloads()
{
int32 finishedCount = 0;
for (int32 i = fDownloadViewsLayout->CountItems() - 1;
BLayoutItem* item = fDownloadViewsLayout->ItemAt(i); i--) {
DownloadProgressView* view = dynamic_cast<DownloadProgressView*>(
@ -776,9 +780,11 @@ DownloadWindow::_RemoveMissingDownloads()
if (view->IsMissing()) {
view->RemoveSelf();
delete view;
}
} else if (view->IsFinished())
finishedCount++;
}
fRemoveMissingButton->SetEnabled(false);
fRemoveFinishedButton->SetEnabled(finishedCount > 0);
_SaveSettings();
}