Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /XspfManager/XspfMListViewController.m

Parent Directory Parent Directory | Revision Log Revision Log


Revision 204 - (hide annotations) (download)
Sun Jan 3 17:20:20 2010 UTC (14 years, 3 months ago) by masaki
File size: 1830 byte(s)
[New] XSSPFMXspfObjectにlabelプロパティを追加。ラベルを一部実装。
1 masaki 21 //
2     // XspfMListViewController.m
3     // XspfManager
4     //
5     // Created by Hori,Masaki on 09/11/07.
6     // Copyright 2009 masakih. All rights reserved.
7     //
8    
9     #import "XspfMListViewController.h"
10    
11 masaki 192 #import "XspfManager.h"
12 masaki 21
13 masaki 192
14 masaki 21 @implementation XspfMListViewController
15    
16 masaki 24 - (id)init
17     {
18     [super initWithNibName:@"ListView" bundle:nil];
19    
20     return self;
21     }
22    
23 masaki 32 - (void)awakeFromNib
24     {
25     [tableView setDoubleAction:@selector(openXspf:)];
26 masaki 111 [tableView registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType, nil]];
27 masaki 32 }
28    
29 masaki 111
30 masaki 192 - (void)tableView:(NSTableView *)table sortDescriptorsDidChange:(NSArray *)oldDescriptors
31     {
32 masaki 204 // HMLog(HMLogLevelDebug, @"Enter %@, desc-> %@", NSStringFromSelector(_cmd), [table sortDescriptors]);
33 masaki 192 id controller = [self representedObject];
34     [controller willChangeValueForKey:@"selectionIndexes"];
35     [controller didChangeValueForKey:@"selectionIndexes"];
36     }
37    
38    
39 masaki 111 - (NSDragOperation)tableView:(NSTableView*)table
40     validateDrop:(id <NSDraggingInfo>)info
41     proposedRow:(NSInteger)row
42     proposedDropOperation:(NSTableViewDropOperation)dropOperation
43     {
44     id pb = [info draggingPasteboard];
45     id plist = [pb propertyListForType:NSFilenamesPboardType];
46    
47     NSWorkspace *ws = [NSWorkspace sharedWorkspace];
48     NSError *error = nil;
49     for(NSString *filePath in plist) {
50     NSString *type = [ws typeOfFile:filePath error:&error];
51     if(![ws type:type conformsToType:@"com.masakih.xspf"]) {
52     return NSDragOperationNone;
53     }
54     }
55     [table setDropRow:row dropOperation:NSTableViewDropAbove];
56    
57     return NSDragOperationCopy;
58     }
59    
60     - (BOOL)tableView:(NSTableView*)table
61     acceptDrop:(id <NSDraggingInfo>)info
62     row:(NSInteger)row
63     dropOperation:(NSTableViewDropOperation)dropOperation
64     {
65     id pb = [info draggingPasteboard];
66     id plist = [pb propertyListForType:NSFilenamesPboardType];
67    
68 masaki 184 [[NSApp delegate] registerFilePaths:plist];
69 masaki 111
70     return YES;
71     }
72    
73 masaki 21 @end

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26