When the expected size of a download is unknown, at least set the progress
bar to 100% when it finished. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@519 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
committed by
Alexandre Deckner
parent
a933ccf28d
commit
4a09831444
@@ -372,7 +372,7 @@ DownloadProgressView::MessageReceived(BMessage* message)
|
|||||||
= fProcessStartTime = fLastSpeedReferenceTime
|
= fProcessStartTime = fLastSpeedReferenceTime
|
||||||
= fEstimatedFinishReferenceTime = system_time();
|
= fEstimatedFinishReferenceTime = system_time();
|
||||||
break;
|
break;
|
||||||
};
|
}
|
||||||
case B_DOWNLOAD_PROGRESS:
|
case B_DOWNLOAD_PROGRESS:
|
||||||
{
|
{
|
||||||
int64 currentSize;
|
int64 currentSize;
|
||||||
@@ -383,6 +383,12 @@ DownloadProgressView::MessageReceived(BMessage* message)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case B_DOWNLOAD_REMOVED:
|
||||||
|
// TODO: This is a bit asymetric. The removed notification
|
||||||
|
// arrives here, but it would be nicer if it arrived
|
||||||
|
// at the window...
|
||||||
|
Window()->PostMessage(message);
|
||||||
|
break;
|
||||||
case OPEN_DOWNLOAD:
|
case OPEN_DOWNLOAD:
|
||||||
{
|
{
|
||||||
// TODO: In case of executable files, ask the user first!
|
// TODO: In case of executable files, ask the user first!
|
||||||
@@ -414,12 +420,6 @@ DownloadProgressView::MessageReceived(BMessage* message)
|
|||||||
// TOAST!
|
// TOAST!
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case B_DOWNLOAD_REMOVED:
|
|
||||||
// TODO: This is a bit asymetric. The removed notification
|
|
||||||
// arrives here, but it would be nicer if it arrived
|
|
||||||
// at the window...
|
|
||||||
Window()->PostMessage(message);
|
|
||||||
break;
|
|
||||||
case B_NODE_MONITOR:
|
case B_NODE_MONITOR:
|
||||||
{
|
{
|
||||||
int32 opCode;
|
int32 opCode;
|
||||||
@@ -610,6 +610,10 @@ void
|
|||||||
DownloadProgressView::DownloadFinished()
|
DownloadProgressView::DownloadFinished()
|
||||||
{
|
{
|
||||||
fDownload = NULL;
|
fDownload = NULL;
|
||||||
|
if (fExpectedSize == -1) {
|
||||||
|
fStatusBar->SetTo(100.0);
|
||||||
|
fExpectedSize = fCurrentSize;
|
||||||
|
}
|
||||||
fTopButton->SetEnabled(true);
|
fTopButton->SetEnabled(true);
|
||||||
fBottomButton->SetLabel("Remove");
|
fBottomButton->SetLabel("Remove");
|
||||||
fBottomButton->SetMessage(new BMessage(REMOVE_DOWNLOAD));
|
fBottomButton->SetMessage(new BMessage(REMOVE_DOWNLOAD));
|
||||||
|
|||||||
Reference in New Issue
Block a user