-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose NSArrayController to javascript.
This should Fix #1 (Searching in the playlist). This bindings bridge is still a bit hacky and will need further iteration before it is right.
- Loading branch information
1 parent
9e58e83
commit d67227e
Showing
13 changed files
with
165 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// VLCArrayController.h | ||
// Lunettes | ||
// | ||
// Created by Pierre d'Herbemont on 12/24/09. | ||
// Copyright 2009 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
|
||
@interface VLCArrayController : NSArrayController { | ||
NSString *_searchString; | ||
} | ||
|
||
@property (readwrite, retain) NSString *searchString; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// VLCArrayController.m | ||
// Lunettes | ||
// | ||
// Created by Pierre d'Herbemont on 12/24/09. | ||
// Copyright 2009 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "VLCArrayController.h" | ||
|
||
|
||
@implementation VLCArrayController | ||
- (id)init | ||
{ | ||
self = [super init]; | ||
if (!self) | ||
return nil; | ||
_searchString = [@"" retain]; | ||
return self; | ||
} | ||
|
||
- (void)dealloc | ||
{ | ||
[_searchString release]; | ||
[super dealloc]; | ||
} | ||
|
||
- (NSString *)searchString | ||
{ | ||
return _searchString; | ||
} | ||
|
||
- (void)setSearchString:(NSString *)string | ||
{ | ||
// This method is a hack for now. | ||
// We should only pass the predicate string, and make | ||
// no assumption of the content. | ||
NSPredicate *predicate; | ||
if ([string isEqualToString:@""]) | ||
predicate = [NSPredicate predicateWithValue:YES]; | ||
else | ||
predicate = [NSPredicate predicateWithFormat:@"metaDictionary.title CONTAINS[cd] %@", string]; | ||
[self setFilterPredicate:predicate]; | ||
[_searchString release]; | ||
_searchString = [string copy]; | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters