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
// sort | |
[bookMarks sortUsingComparator:^NSComparisonResult(NSString* path1, NSString* path2) | |
{ | |
return [path1.lastPathComponent compare:path2.lastPathComponent options:NSCaseInsensitiveSearch|NSNumericSearch]; | |
}]; |
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
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView | |
{ | |
if(tableView == bookTableView) | |
return books.count; | |
return clips.count; | |
} | |
- (id)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row | |
{ |
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
NSOpenPanel* panel = [NSOpenPanel openPanel]; | |
[panel setMessage:@"Select Folder"]; | |
[panel setPrompt:@"Select"]; | |
[panel setCanChooseFiles:NO]; | |
[panel setCanChooseDirectories:YES]; | |
[panel beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) { | |
NSString* path = [[panel URL] path]; | |
}]; |
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
- (BOOL)validateInterfaceItem:(id)item | |
{ | |
if(_tableView.selectedRow == -1) | |
return NO; | |
NSPasteboardType type = [clipData.types objectAtIndex:_tableView.selectedRow]; | |
if([item action] == @selector(cmdShowItemFinder:) | |
|| [item action] == @selector(cmdQuickView:)) | |
{ | |
if(fileListView.isHidden || fileListView.selectedRow == -1) |
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
- (BOOL)tableView:(NSTableView *)tableView | |
writeRowsWithIndexes:(NSIndexSet *)rowIndexes | |
toPasteboard:(NSPasteboard*)pboard { | |
// Copy the row numbers to the pasteboard. | |
NSData *zNSIndexSetData = | |
[NSKeyedArchiver archivedDataWithRootObject:rowIndexes]; | |
[pboard declareTypes:[NSArray arrayWithObject:FavoritesDataType] | |
owner:self]; | |
[pboard setData:zNSIndexSetData forType:FavoritesDataType]; | |
return YES; |
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
// | |
// Quicklook | |
// | |
QLPreviewPanel* _previewPanel; | |
NSWindow* _quickLookOwner; | |
NSString* _quickLookItemPath; | |
- (void)showQuickLookPath:(NSString*)itemPath Owner:(NSWindow*)wnd; | |
//--------------------------------------- |
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
NSRunAlertPanel(); | |
NSRunInformationalAlertPanel(); | |
NSRunCriticalAlertPanel(); |
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
void modalSheet(NSWindow* sheet, NSWindow* window) | |
{ | |
[NSApp beginSheet:sheet | |
modalForWindow:window | |
modalDelegate: nil | |
didEndSelector:nil | |
contextInfo:nil]; | |
[NSApp runModalForWindow:sheet]; | |
// Dialog is up here. |
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
PanelClass panel = [[PanelClass new] autorelease]; | |
[panel showWindow:self]; | |
if(IDOK != [NSApp runModalForWindow:[panel window]]) | |
return; |
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
@interface <#PanelClass#> : NSWindowController <NSWindowDelegate> | |
{ | |
NSInteger retCode; | |
@public | |
IBOutlet <#Control#>* <#variable#>; | |
} | |
- (IBAction)cmdOK:(id)sender; | |
- (IBAction)cmdCancel:(id)sender; |