Revision: 2657
          http://skim-app.svn.sourceforge.net/skim-app/?rev=2657&view=rev
Author:   hofman
Date:     2007-08-14 05:16:13 -0700 (Tue, 14 Aug 2007)

Log Message:
-----------
Add hidden default to automatically remove finished downloads. Set progress bar 
value when finished.

Modified Paths:
--------------
    trunk/InitialUserDefaults.plist
    trunk/SKDownload.m
    trunk/SKDownloadController.m
    trunk/SKStringConstants.h
    trunk/SKStringConstants.m

Modified: trunk/InitialUserDefaults.plist
===================================================================
--- trunk/InitialUserDefaults.plist     2007-08-14 11:09:16 UTC (rev 2656)
+++ trunk/InitialUserDefaults.plist     2007-08-14 12:16:13 UTC (rev 2657)
@@ -226,6 +226,8 @@
         <real>600.0</real>
         <key>SKAutoOpenDownloadsWindow</key>
         <true/>
+        <key>SKAutoRemoveFinishedDownloads</key>
+        <true/>
         <key>SUScheduledCheckInterval</key>
         <integer>86400</integer>
     </dict>

Modified: trunk/SKDownload.m
===================================================================
--- trunk/SKDownload.m  2007-08-14 11:09:16 UTC (rev 2656)
+++ trunk/SKDownload.m  2007-08-14 12:16:13 UTC (rev 2657)
@@ -48,6 +48,8 @@
         URLDownload = nil;
         filePath = nil;
         fileIcon = nil;
+        expectedContentLength = -1;
+        receivedContentLength = 0;
         progressIndicator = nil;
         status = SKDownloadStatusUndefined;
         delegate = aDelegate;
@@ -294,6 +296,8 @@
 }
 
 - (void)downloadDidFinish:(NSURLDownload *)theDownload {
+    if (expectedContentLength > 0)
+               [progressIndicator 
setDoubleValue:(double)expectedContentLength];
     [self setStatus:SKDownloadStatusFinished];
     if ([delegate respondsToSelector:@selector(downloadDidEnd:)])
         [delegate downloadDidEnd:self];

Modified: trunk/SKDownloadController.m
===================================================================
--- trunk/SKDownloadController.m        2007-08-14 11:09:16 UTC (rev 2656)
+++ trunk/SKDownloadController.m        2007-08-14 12:16:13 UTC (rev 2657)
@@ -40,6 +40,7 @@
 #import "SKDownload.h"
 #import "SKProgressCell.h"
 #import "NSURL_SKExtensions.h"
+#import "SKStringConstants.h"
 
 
 @implementation SKDownloadController
@@ -190,8 +191,10 @@
         else
             [NSApp presentError:error];
         
-        [download cleanupDownload];
-        [downloads removeObject:download];
+        if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKAutoRemoveFinishedDownloadsKey]) {
+            [download cleanupDownload];
+            [downloads removeObject:download];
+        }
     }
     
     [self reloadTableView];

Modified: trunk/SKStringConstants.h
===================================================================
--- trunk/SKStringConstants.h   2007-08-14 11:09:16 UTC (rev 2656)
+++ trunk/SKStringConstants.h   2007-08-14 12:16:13 UTC (rev 2657)
@@ -101,3 +101,4 @@
 extern NSString *SKActivatePresentationNavigationAtBottomKey;
 extern NSString *SKAutoHidePresentationContentsKey;
 extern NSString *SKAutoOpenDownloadsWindowKey;
+extern NSString *SKAutoRemoveFinishedDownloadsKey;

Modified: trunk/SKStringConstants.m
===================================================================
--- trunk/SKStringConstants.m   2007-08-14 11:09:16 UTC (rev 2656)
+++ trunk/SKStringConstants.m   2007-08-14 12:16:13 UTC (rev 2657)
@@ -102,3 +102,4 @@
 NSString *SKActivatePresentationNavigationAtBottomKey = 
@"SKActivatePresentationNavigationAtBottom";
 NSString *SKAutoHidePresentationContentsKey = 
@"SKAutoHidePresentationContents";
 NSString *SKAutoOpenDownloadsWindowKey = @"SKAutoOpenDownloadsWindow";
+NSString *SKAutoRemoveFinishedDownloadsKey = @"SKAutoRemoveFinishedDownloads";


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to