[Job Queue] Overhauled long action handling
Long actions, such as file opening, playlist loading, metadata loading
and refreshing, etc, are now handled through NSProgress. Additionally,
a new status bar change displays the progress of the task instead of
the total duration of the playlist. Finally, app quit is blocked by a
running task, and if the app is quit while a task is running, it will
be delayed until the task completes, at which time the app will
terminate cleanly.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-15 08:01:45 +00:00
|
|
|
//
|
|
|
|
// TotalTimeTransformer.m
|
|
|
|
// Cog
|
|
|
|
//
|
|
|
|
// Created by Christopher Snowhill on 6/15/22.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "TotalTimeTransformer.h"
|
|
|
|
|
|
|
|
@implementation TotalTimeTransformer
|
|
|
|
|
|
|
|
+ (Class)transformedValueClass {
|
|
|
|
return [NSString class];
|
|
|
|
}
|
|
|
|
+ (BOOL)allowsReverseTransformation {
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id)transformedValue:(id)value {
|
|
|
|
if(value == nil) return @"";
|
|
|
|
|
|
|
|
if([value isKindOfClass:[NSString class]]) {
|
|
|
|
NSString *string = (NSString *)value;
|
|
|
|
if([string length] > 0) {
|
2022-07-01 17:54:39 +00:00
|
|
|
//return [@"Total Duration: " stringByAppendingString:string];
|
|
|
|
return [NSString localizedStringWithFormat:NSLocalizedString(@"Total duration: %@", @"Total duration for status"), string];
|
[Job Queue] Overhauled long action handling
Long actions, such as file opening, playlist loading, metadata loading
and refreshing, etc, are now handled through NSProgress. Additionally,
a new status bar change displays the progress of the task instead of
the total duration of the playlist. Finally, app quit is blocked by a
running task, and if the app is quit while a task is running, it will
be delayed until the task completes, at which time the app will
terminate cleanly.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-15 08:01:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return @"";
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|