13 |
NSString *BSDownloadTaskCanceledNotification = @"BSDownloadTaskCanceledNotification"; |
NSString *BSDownloadTaskCanceledNotification = @"BSDownloadTaskCanceledNotification"; |
14 |
NSString *BSDownloadTaskInternalErrorNotification = @"BSDownloadTaskInternalErrorNotification"; |
NSString *BSDownloadTaskInternalErrorNotification = @"BSDownloadTaskInternalErrorNotification"; |
15 |
NSString *BSDownloadTaskAbortDownloadNotification = @"BSDownloadTaskAbortDownloadNotification"; |
NSString *BSDownloadTaskAbortDownloadNotification = @"BSDownloadTaskAbortDownloadNotification"; |
16 |
NSString *BSDownloadTaskServerResponseKey = @"BSDownloadTaskServerResponseKey"; // NSURLResponse |
NSString *BSDownloadTaskServerResponseKey = @"BSDownloadTaskServerResponseKey"; // NSURLResponse |
17 |
NSString *BSDownloadTaskStatusCodeKey = @"BSDownloadTaskStatusCodeKey"; // NSNumber (int) |
NSString *BSDownloadTaskStatusCodeKey = @"BSDownloadTaskStatusCodeKey"; // NSNumber (int) |
18 |
NSString *BSDownloadTaskFailDownloadNotification = @"BSDownloadTaskFailDownloadNotification"; |
NSString *BSDownloadTaskFailDownloadNotification = @"BSDownloadTaskFailDownloadNotification"; |
19 |
|
|
20 |
|
|
121 |
[self postNotificationWithName:BSDownloadTaskInternalErrorNotification]; |
[self postNotificationWithName:BSDownloadTaskInternalErrorNotification]; |
122 |
return; |
return; |
123 |
} |
} |
124 |
[request setValue:[NSBundle monazillaUserAgent]//@"Monazilla/1.0 (Starlight Breaker/1.5 SBx)" |
[request setValue:[NSBundle monazillaUserAgent] forHTTPHeaderField:@"User-Agent"]; |
|
forHTTPHeaderField:@"User-Agent"]; |
|
125 |
if(method) { |
if(method) { |
126 |
[request setHTTPMethod : method]; |
[request setHTTPMethod : method]; |
127 |
} |
} |
168 |
} |
} |
169 |
- (NSString *)title |
- (NSString *)title |
170 |
{ |
{ |
171 |
return NSLocalizedString(@"Download.", @"Download."); |
return NSLocalizedStringFromTable(@"Download.", @"Downloader", @""); |
172 |
} |
} |
173 |
- (NSString *) messageInProgress |
- (NSString *) messageInProgress |
174 |
{ |
{ |
175 |
return [NSString stringWithFormat:NSLocalizedString(@"Download url(%@) (%.1fk)", "Download url(%@) (%.1fk)"), |
return [NSString stringWithFormat:NSLocalizedStringFromTable(@"Download url(%@) (%.1fk)", @"Downloader", @""), |
176 |
[self url], [self currentLength] / 1024.0]; |
[self url], [self currentLength] / 1024.0]; |
177 |
} |
} |
178 |
- (double) amount |
- (double) amount |