[haiku-webkit-commits] r519 - webkit/trunk/WebKit/haiku/WebPositive

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Sun, 23 May 2010 13:21:44 +0000

Author: stippi
Date: Sun May 23 13:21:43 2010
New Revision: 519
URL: http://mmlr.dyndns.org/changeset/519

Log:
When the expected size of a download is unknown, at least set the progress
bar to 100% when it finished.

Modified:
   webkit/trunk/WebKit/haiku/WebPositive/DownloadProgressView.cpp

Modified: webkit/trunk/WebKit/haiku/WebPositive/DownloadProgressView.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/DownloadProgressView.cpp      Sun May 
23 12:56:24 2010        (r518)
+++ webkit/trunk/WebKit/haiku/WebPositive/DownloadProgressView.cpp      Sun May 
23 13:21:43 2010        (r519)
@@ -372,7 +372,7 @@
                                = fProcessStartTime = fLastSpeedReferenceTime
                                = fEstimatedFinishReferenceTime = system_time();
                        break;
-               };
+               }
                case B_DOWNLOAD_PROGRESS:
                {
                        int64 currentSize;
@@ -383,6 +383,12 @@
                        }
                        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:
                {
                        // TODO: In case of executable files, ask the user 
first!
@@ -414,12 +420,6 @@
                        // TOAST!
                        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:
                {
                        int32 opCode;
@@ -610,6 +610,10 @@
 DownloadProgressView::DownloadFinished()
 {
        fDownload = NULL;
+       if (fExpectedSize == -1) {
+               fStatusBar->SetTo(100.0);
+               fExpectedSize = fCurrentSize;
+       }
        fTopButton->SetEnabled(true);
        fBottomButton->SetLabel("Remove");
        fBottomButton->SetMessage(new BMessage(REMOVE_DOWNLOAD));

Other related posts:

  • » [haiku-webkit-commits] r519 - webkit/trunk/WebKit/haiku/WebPositive - webkit