Commit 989d4737 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

MacOSX/VLC_app: Set the representedPath of the main Window.

parent 12a4698c
......@@ -49,6 +49,9 @@
VLCNonNilAsBoolTransformer *nonNilAsBool;
nonNilAsBool = [[[VLCNonNilAsBoolTransformer alloc] init] autorelease];
[NSValueTransformer setValueTransformer:(id)nonNilAsBool forName:@"NonNilAsBoolTransformer"];
VLCURLToRepresentedFileNameTransformer *urlToRepresentedFileName;
urlToRepresentedFileName = [[[VLCURLToRepresentedFileNameTransformer alloc] init] autorelease];
[NSValueTransformer setValueTransformer:(id)urlToRepresentedFileName forName:@"URLToRepresentedFileNameTransformer"];
/***********************************
* categories: Main content
......
......@@ -222,6 +222,7 @@
[NSNumber numberWithBool:NO], NSConditionallySetsEnabledBindingOption, nil ]];
[mediaReadingProgressText bind:@"value" toObject:mediaPlayer withKeyPath:@"time.stringValue" options: nil];
[mediaDescriptionText bind:@"value" toObject:mediaPlayer withKeyPath:@"description" options: nil];
[self bind:@"representedFilename" toObject:mediaPlayer withKeyPath:@"media.url" options: [NSDictionary dictionaryWithObject:@"URLToRepresentedFileNameTransformer" forKey:NSValueTransformerNameBindingOption]];
[self bind:@"title" toObject:mediaPlayer withKeyPath:@"description" options: nil];
[navigatorViewToggleButton bind:@"value" toObject:self withKeyPath:@"navigatorViewVisible" options: nil];
......
......@@ -32,3 +32,7 @@
}
@end
@interface VLCURLToRepresentedFileNameTransformer : NSValueTransformer {
}
@end
......@@ -71,3 +71,26 @@
@end
@implementation VLCURLToRepresentedFileNameTransformer
+ (Class)transformedValueClass
{
return [NSURL class];
}
+ (BOOL)allowsReverseTransformation
{
return NO;
}
- (NSString *)transformedValue:(id)value
{
NSLog(@"%@", value);
if( ![value isKindOfClass:[NSURL class]] || ![value isFileURL] )
return @"";
return [value path];
}
@end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment