Implemented a way to update the queue UI with a description of the current action.

This commit is contained in:
Damiano Galassi committed 2014-12-12 13:38:27 +01:00
1 parent a218dc8aae
commit 5219a73a7a
6 files changed
+42 -11

No files matched your search

+6 -1
View File
@@ -249,7 +249,12 @@ NSString *SBQueueCancelledNotification = @"SBQueueCancelledNotification";
* sends SBQueueWorkingNotification.
*/
- (void)handleSBStatusWorking:(CGFloat)progress index:(NSInteger)index {
NSString *info = [NSString stringWithFormat:@"Processing file %ld of %lu.",(long)self.currentIndex + 1, (unsigned long)[self.items count]];
NSString *description = self.currentItem.localizedWorkingDescription;
if (!description) {
description = NSLocalizedString(@"Working", @"");
}
NSString *info = [NSString stringWithFormat:@"%@, item %ld of %lu.", description, (long)self.currentIndex + 1, (unsigned long)self.items.count];
[[NSNotificationCenter defaultCenter] postNotificationName:SBQueueWorkingNotification object:self userInfo:@{@"ProgressString": info,
@"Progress": @(progress),
@"ItemIndex": @(index)}];