Changeset 151
- Timestamp:
- Mar 12, 2006, 3:45:55 PM (17 years ago)
- Location:
- branches/new_api/macosx
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_api/macosx/Controller.h
r141 r151 127 127 - (void) notifyGrowl: (NSString *) file; 128 128 - (void) revealFromMenu: (id) sender; 129 - (void) finderReveal: (NSString *) path;130 129 - (void) finderTrash: (NSString *) path; 131 130 - (void) growlRegister: (id) sender; -
branches/new_api/macosx/Controller.m
r148 r151 88 88 [fWindow setDelegate: self]; 89 89 90 [fTableView setTorrents: fTorrents]; 90 91 [[fTableView tableColumnWithIdentifier: @"Torrent"] setDataCell: 91 92 [[TorrentCell alloc] init]]; … … 1105 1106 - (void) revealFromMenu: (id) sender 1106 1107 { 1107 #if 0 1108 int row = [fTableView selectedRow]; 1109 if (row >= 0) 1110 { 1111 [self finderReveal: [NSString stringWithFormat: @"%@/%@", 1112 [NSString stringWithUTF8String: fStat[row].folder], 1113 [NSString stringWithUTF8String: fStat[row].info.name]]]; 1114 } 1115 #endif 1116 } 1117 1118 - (void) finderReveal: (NSString *) path 1119 { 1120 NSString * string; 1121 NSAppleScript * appleScript; 1122 NSDictionary * error; 1123 1124 string = [NSString stringWithFormat: 1125 @"tell application \"Finder\"\n" 1126 " activate\n" 1127 " reveal (POSIX file \"%@\")\n" 1128 "end tell", path]; 1129 1130 appleScript = [[NSAppleScript alloc] initWithSource: string]; 1131 if( ![appleScript executeAndReturnError: &error] ) 1132 { 1133 printf( "finderReveal failed\n" ); 1134 } 1135 [appleScript release]; 1108 Torrent * torrent; 1109 torrent = [fTorrents objectAtIndex: [fTableView selectedRow]]; 1110 [torrent reveal]; 1136 1111 } 1137 1112 -
branches/new_api/macosx/Torrent.h
r148 r151 49 49 - (void) sleep; 50 50 - (void) wakeUp; 51 - (void) reveal; 51 52 52 53 - (NSImage *) icon; -
branches/new_api/macosx/Torrent.m
r148 r151 200 200 } 201 201 202 - (void) reveal 203 { 204 NSString * path = [NSString stringWithFormat: @"%@/%@", 205 [self getFolder], [self name]]; 206 NSURL * url = [NSURL fileURLWithPath: path]; 207 208 [[NSWorkspace sharedWorkspace] selectFile: [url path] 209 inFileViewerRootedAtPath: nil]; 210 } 211 202 212 - (NSImage *) icon 203 213 { -
branches/new_api/macosx/TorrentTableView.h
r142 r151 7 7 8 8 { 9 IBOutlet Controller * fController; 9 IBOutlet Controller * fController; 10 NSArray * fTorrents; 10 11 11 NSPoint 12 NSPoint fClickPoint; 12 13 13 14 IBOutlet NSMenu * fContextRow; 14 15 IBOutlet NSMenu * fContextNoRow; 15 16 } 17 - (void) setTorrents: (NSArray *) torrents; 16 18 17 19 @end -
branches/new_api/macosx/TorrentTableView.m
r150 r151 23 23 #import "TorrentTableView.h" 24 24 #import "Controller.h" 25 #import "Torrent.h" 25 26 26 27 @implementation TorrentTableView 28 29 - (void) setTorrents: (NSArray *) torrents 30 { 31 fTorrents = torrents; 32 } 27 33 28 34 - (void) pauseOrResume: (int) row … … 89 95 NSPoint point; 90 96 int row, col; 97 Torrent * torrent; 91 98 92 99 point = [self convertPoint: [e locationInWindow] fromView: NULL]; … … 104 111 else if( [self pointInRevealRect: point] ) 105 112 { 106 #if 0 107 [fController finderReveal: [NSString stringWithFormat: 108 @"%@/%@", [NSString stringWithUTF8String: fStat[row].folder], 109 [NSString stringWithUTF8String: fStat[row].info.name]]]; 113 torrent = [fTorrents objectAtIndex: row]; 114 [torrent reveal]; 110 115 [self display]; 111 #endif112 116 } 113 117 else if( row >= 0 && ( [e modifierFlags] & NSAlternateKeyMask ) )
Note: See TracChangeset
for help on using the changeset viewer.