Fixes 244214

Made Sparkle display sensible data and use an indeterminate progress bar when the server doesn't report an update's file size.
This commit is contained in:
Andy Matuschak committed 2008-06-30 20:45:54 -07:00
1 parent 50de4d78e5
commit 3d7e8c6c95
5 files changed
+18 -6

No files matched your search

+9 -1
View File
@@ -4,6 +4,14 @@
<dict>
<key>IBClasses</key>
<array>
<dict>
<key>CLASS</key>
<string>SUWindowController</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSWindowController</string>
</dict>
<dict>
<key>CLASS</key>
<string>NSApplication</string>
@@ -39,7 +47,7 @@
<string>NSProgressIndicator</string>
</dict>
<key>SUPERCLASS</key>
<string>NSWindowController</string>
<string>SUWindowController</string>
</dict>
</array>
<key>IBVersion</key>
+3 -3
View File
@@ -3,9 +3,9 @@
<plist version="1.0">
<dict>
<key>IBFramework Version</key>
<string>629</string>
<string>667</string>
<key>IBLastKnownRelativeProjectPath</key>
<string>../Sparkle.xcodeproj</string>
<string>Sparkle.xcodeproj</string>
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
@@ -13,7 +13,7 @@
<integer>6</integer>
</array>
<key>IBSystem Version</key>
<string>9C31</string>
<string>9D34</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
BIN
View File
Binary file not shown.
+2 -1
View File
@@ -104,9 +104,10 @@
- (void)setMaxProgressValue:(double)value
{
if (value < 0) value = 0;
maxProgressValue = value;
[self setProgressValue:0];
[progressBar setIndeterminate:(value == 0)];
[progressBar startAnimation:self];
}
- (void)setStatusText:(NSString *)aStatusText
+4 -1
View File
@@ -75,7 +75,10 @@
- (void)download:(NSURLDownload *)download didReceiveDataOfLength:(NSUInteger)length
{
[statusController setProgressValue:[statusController progressValue] + length];
[statusController setStatusText:[NSString stringWithFormat:SULocalizedString(@"%@ of %@", nil), [NSNumber humanReadableSizeFromDouble:[statusController progressValue]], [NSNumber humanReadableSizeFromDouble:[statusController maxProgressValue]]]];
if ([statusController maxProgressValue] > 0)
[statusController setStatusText:[NSString stringWithFormat:SULocalizedString(@"%@ of %@", nil), [NSNumber humanReadableSizeFromDouble:[statusController progressValue]], [NSNumber humanReadableSizeFromDouble:[statusController maxProgressValue]]]];
else
[statusController setStatusText:[NSString stringWithFormat:SULocalizedString(@"%@ downloaded", nil), [NSNumber humanReadableSizeFromDouble:[statusController progressValue]]]];
}
- (IBAction)cancelDownload:sender