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

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Wed, 24 Mar 2010 20:25:55 +0000

Author: stippi
Date: Wed Mar 24 20:25:54 2010
New Revision: 354
URL: http://mmlr.dyndns.org/changeset/354

Log:
Manually removing downloads needs to trigger checking the button enabled status
in the download window.

Modified:
   webkit/trunk/WebKit/haiku/WebPositive/DownloadWindow.cpp
   webkit/trunk/WebKit/haiku/WebPositive/DownloadWindow.h

Modified: webkit/trunk/WebKit/haiku/WebPositive/DownloadWindow.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/DownloadWindow.cpp    Wed Mar 24 
20:21:24 2010        (r353)
+++ webkit/trunk/WebKit/haiku/WebPositive/DownloadWindow.cpp    Wed Mar 24 
20:25:54 2010        (r354)
@@ -250,6 +250,7 @@
                        _RemoveMissingDownloads();
                        break;
                case SAVE_SETTINGS:
+                       _ValidateButtonStatus();
                        _SaveSettings();
                        break;
 
@@ -391,6 +392,27 @@
 
 
 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()
 {
        BFile file;

Modified: webkit/trunk/WebKit/haiku/WebPositive/DownloadWindow.h
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/DownloadWindow.h      Wed Mar 24 
20:21:24 2010        (r353)
+++ webkit/trunk/WebKit/haiku/WebPositive/DownloadWindow.h      Wed Mar 24 
20:25:54 2010        (r354)
@@ -52,6 +52,7 @@
                        void                            
_DownloadFinished(BWebDownload* download);
                        void                            
_RemoveFinishedDownloads();
                        void                            
_RemoveMissingDownloads();
+                       void                            _ValidateButtonStatus();
                        void                            _SaveSettings();
                        void                            _LoadSettings();
                        bool                            
_OpenSettingsFile(BFile& file, uint32 mode);

Other related posts:

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