Manually removing downloads needs to trigger checking the button enabled status
in the download window. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@354 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
parent
3b7f919fb8
commit
c5d7a6c949
@ -250,6 +250,7 @@ DownloadWindow::MessageReceived(BMessage* message)
|
||||
_RemoveMissingDownloads();
|
||||
break;
|
||||
case SAVE_SETTINGS:
|
||||
_ValidateButtonStatus();
|
||||
_SaveSettings();
|
||||
break;
|
||||
|
||||
@ -390,6 +391,27 @@ DownloadWindow::_RemoveMissingDownloads()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DownloadWindow::_ValidateButtonStatus()
|
||||
{
|
||||
int32 finishedCount = 0;
|
||||
int32 missingCount = 0;
|
||||
for (int32 i = fDownloadViewsLayout->CountItems() - 1;
|
||||
BLayoutItem* item = fDownloadViewsLayout->ItemAt(i); i--) {
|
||||
DownloadProgressView* view = dynamic_cast<DownloadProgressView*>(
|
||||
item->View());
|
||||
if (!view)
|
||||
continue;
|
||||
if (view->IsFinished())
|
||||
finishedCount++;
|
||||
if (view->IsMissing())
|
||||
missingCount++;
|
||||
}
|
||||
fRemoveFinishedButton->SetEnabled(finishedCount > 0);
|
||||
fRemoveMissingButton->SetEnabled(missingCount > 0);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DownloadWindow::_SaveSettings()
|
||||
{
|
||||
|
@ -52,6 +52,7 @@ private:
|
||||
void _DownloadFinished(BWebDownload* download);
|
||||
void _RemoveFinishedDownloads();
|
||||
void _RemoveMissingDownloads();
|
||||
void _ValidateButtonStatus();
|
||||
void _SaveSettings();
|
||||
void _LoadSettings();
|
||||
bool _OpenSettingsFile(BFile& file, uint32 mode);
|
||||
|
Loading…
Reference in New Issue
Block a user