Changeset 761
- Timestamp:
- Aug 13, 2006, 3:46:02 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Transmission.xcodeproj/project.pbxproj
r754 r761 82 82 A2173E1C0A33C1B300B0D8AB /* ActionButtonPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = A2173E1B0A33C1B300B0D8AB /* ActionButtonPressed.png */; }; 83 83 A21DFF100A292B2B007C5F76 /* Transfers.png in Resources */ = {isa = PBXBuildFile; fileRef = A21DFF0F0A292B2B007C5F76 /* Transfers.png */; }; 84 A221DA890A8F7E7E0011E98E /* InfoTableView.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = A221DA870A8F7E7E0011E98E /* InfoTableView.h */; }; 85 A221DA8A0A8F7E7E0011E98E /* InfoTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = A221DA880A8F7E7E0011E98E /* InfoTableView.m */; }; 84 86 A2305A800A3DC9E400AB2D77 /* ProgressBarWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = A2305A7C0A3DC9E400AB2D77 /* ProgressBarWhite.png */; }; 85 87 A2305A810A3DC9E400AB2D77 /* ProgressBarBlue.png in Resources */ = {isa = PBXBuildFile; fileRef = A2305A7D0A3DC9E400AB2D77 /* ProgressBarBlue.png */; }; … … 159 161 A261F1E40A69A1B10002815A /* Growl.framework in CopyFiles */, 160 162 A24F19210A3A796800C9C145 /* Sparkle.framework in CopyFiles */, 163 A221DA890A8F7E7E0011E98E /* InfoTableView.h in CopyFiles */, 161 164 ); 162 165 runOnlyForDeploymentPostprocessing = 0; … … 256 259 4DCCBB3C09C3D71100D3CABF /* TorrentCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = TorrentCell.m; path = macosx/TorrentCell.m; sourceTree = "<group>"; }; 257 260 4DCCBB3D09C3D71100D3CABF /* TorrentCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = TorrentCell.h; path = macosx/TorrentCell.h; sourceTree = "<group>"; }; 258 4DDBB71909E16BAE00284745 /* transmissioncli */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = transmissioncli; sourceTree = BUILT_PRODUCTS_DIR; };261 4DDBB71909E16BAE00284745 /* transmissioncli */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = transmissioncli; sourceTree = BUILT_PRODUCTS_DIR; }; 259 262 4DDBB71B09E16BF100284745 /* transmissioncli.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = transmissioncli.c; path = cli/transmissioncli.c; sourceTree = "<group>"; }; 260 263 4DDFDD20099A5D8E00189D81 /* DownloadBadge.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DownloadBadge.png; path = macosx/Images/DownloadBadge.png; sourceTree = "<group>"; }; … … 285 288 A2173E1B0A33C1B300B0D8AB /* ActionButtonPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ActionButtonPressed.png; path = macosx/Images/ActionButtonPressed.png; sourceTree = "<group>"; }; 286 289 A21DFF0F0A292B2B007C5F76 /* Transfers.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Transfers.png; path = macosx/Images/Transfers.png; sourceTree = "<group>"; }; 290 A221DA870A8F7E7E0011E98E /* InfoTableView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = InfoTableView.h; path = macosx/InfoTableView.h; sourceTree = "<group>"; }; 291 A221DA880A8F7E7E0011E98E /* InfoTableView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = InfoTableView.m; path = macosx/InfoTableView.m; sourceTree = "<group>"; }; 287 292 A2305A7C0A3DC9E400AB2D77 /* ProgressBarWhite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarWhite.png; path = macosx/Images/ProgressBarWhite.png; sourceTree = "<group>"; }; 288 293 A2305A7D0A3DC9E400AB2D77 /* ProgressBarBlue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarBlue.png; path = macosx/Images/ProgressBarBlue.png; sourceTree = "<group>"; }; … … 399 404 A2710E740A86796000CE4F7D /* PrefsWindow.h */, 400 405 A2710E750A86796000CE4F7D /* PrefsWindow.m */, 406 A221DA870A8F7E7E0011E98E /* InfoTableView.h */, 407 A221DA880A8F7E7E0011E98E /* InfoTableView.m */, 401 408 ); 402 409 name = Sources; … … 813 820 A27ABC240A6ADE410020EC71 /* ImageBackgroundView.m in Sources */, 814 821 A2710E770A86796000CE4F7D /* PrefsWindow.m in Sources */, 822 A221DA8A0A8F7E7E0011E98E /* InfoTableView.m in Sources */, 815 823 ); 816 824 runOnlyForDeploymentPostprocessing = 0; -
trunk/macosx/English.lproj/InfoWindow.nib/classes.nib
r535 r761 5 5 LANGUAGE = ObjC; 6 6 OUTLETS = {fContextMenu = NSMenu; }; 7 SUPERCLASS = NSTableView;7 SUPERCLASS = InfoTableView; 8 8 }, 9 9 {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 10 {CLASS = InfoTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }, 10 11 { 11 12 ACTIONS = { … … 30 31 fLeechersField = NSTextField; 31 32 fNameField = NSTextField; 33 fPeerTable = NSTableView; 32 34 fPieceSizeField = NSTextField; 33 35 fPiecesField = NSTextField; -
trunk/macosx/FileTableView.h
r376 r761 24 24 25 25 #import <Cocoa/Cocoa.h> 26 #import "InfoTableView.h" 26 27 27 @interface FileTableView : NSTableView28 @interface FileTableView : InfoTableView 28 29 { 29 30 IBOutlet NSMenu * fContextMenu; -
trunk/macosx/FileTableView.m
r421 r761 27 27 @implementation FileTableView 28 28 29 - (void) mouseDown: (NSEvent *) event30 {31 [[self window] makeKeyWindow];32 [super mouseDown: event];33 }34 35 29 - (NSMenu *) menuForEvent: (NSEvent *) e 36 30 { -
trunk/macosx/InfoWindowController.h
r569 r761 25 25 #import <Cocoa/Cocoa.h> 26 26 #import "Torrent.h" 27 #import <transmission.h> 27 28 28 29 @interface InfoWindowController : NSWindowController 29 30 { 30 31 NSArray * fTorrents; 31 NSMutableArray * f Files;32 NSMutableArray * fPeers, * fFiles; 32 33 NSImage * fAppIcon; 33 34 … … 46 47 * fConnectedPeersField, * fDownloadingFromField, * fUploadingToField; 47 48 48 IBOutlet NSTableView * f FileTable;49 IBOutlet NSTableView * fPeerTable, * fFileTable; 49 50 50 51 IBOutlet NSMatrix * fRatioMatrix; -
trunk/macosx/InfoWindowController.m
r746 r761 35 35 #define TAB_INFO_IDENT @"Info" 36 36 #define TAB_ACTIVITY_IDENT @"Activity" 37 #define TAB_PEERS_IDENT @"Peers" 37 38 #define TAB_OPTIONS_IDENT @"Options" 38 39 #define TAB_FILES_IDENT @"Files" … … 41 42 #define TAB_INFO_HEIGHT 182.0 42 43 #define TAB_ACTIVITY_HEIGHT 214.0 44 #define TAB_PEERS_HEIGHT 250.0 43 45 #define TAB_OPTIONS_HEIGHT 116.0 44 46 #define TAB_FILES_HEIGHT 250.0 … … 57 59 58 60 fTorrents = [[NSArray alloc] init]; 61 fPeers = [[NSMutableArray alloc] initWithCapacity: 6]; 59 62 fFiles = [[NSMutableArray alloc] initWithCapacity: 6]; 60 63 [fFileTable setDoubleAction: @selector(revealFile:)]; … … 68 71 [window setFrameUsingName: @"InspectorWindowFrame"]; 69 72 73 //select tab 70 74 NSString * identifier = [[NSUserDefaults standardUserDefaults] stringForKey: @"InfoTab"]; 75 if ([fTabView indexOfTabViewItemWithIdentifier: identifier] == NSNotFound) 76 identifier = TAB_INFO_IDENT; 77 71 78 [fTabView selectTabViewItemWithIdentifier: identifier]; 72 79 [self setWindowForTab: identifier animate: NO]; … … 78 85 { 79 86 [fTorrents release]; 87 [fPeers release]; 80 88 [fFiles release]; 81 89 … … 253 261 } 254 262 } 263 264 //set peers table 265 if (numberSelected == 1) 266 { 267 [fPeers setArray: [[fTorrents objectAtIndex: 0] peers]]; 268 [fPeers sortUsingDescriptors: [fPeerTable sortDescriptors]]; 269 } 270 else 271 [fPeers removeAllObjects]; 272 273 [fPeerTable deselectAll: nil]; 274 [fPeerTable reloadData]; 255 275 } 256 276 … … 365 385 if ([identifier isEqualToString: TAB_ACTIVITY_IDENT]) 366 386 height = TAB_ACTIVITY_HEIGHT; 387 else if ([identifier isEqualToString: TAB_PEERS_IDENT]) 388 height = TAB_PEERS_HEIGHT; 367 389 else if ([identifier isEqualToString: TAB_OPTIONS_IDENT]) 368 390 height = TAB_OPTIONS_HEIGHT; … … 411 433 - (int) numberOfRowsInTableView: (NSTableView *) tableView 412 434 { 413 return [fFiles count]; 414 } 415 416 - (id) tableView: (NSTableView *) tableView objectValueForTableColumn: 417 (NSTableColumn *) column row: (int) row 418 { 419 NSString * file = [fFiles objectAtIndex: row]; 420 if ([[column identifier] isEqualToString: @"Icon"]) 421 return [[NSWorkspace sharedWorkspace] iconForFileType: [file pathExtension]]; 422 else 423 return [file lastPathComponent]; 435 if (tableView == fPeerTable) 436 return [fTorrents count] == 1 ? [[fTorrents objectAtIndex: 0] totalPeers] : 0; 437 else if (tableView == fFileTable) 438 return [fFiles count]; 439 else 440 return 0; 441 } 442 443 - (id) tableView: (NSTableView *) tableView objectValueForTableColumn: (NSTableColumn *) column row: (int) row 444 { 445 NSString * ident = [column identifier]; 446 if (tableView == fPeerTable) 447 { 448 NSDictionary * peer = [fPeers objectAtIndex: row]; 449 450 if ([ident isEqualToString: @"UL To"]) 451 return [[peer objectForKey: @"UL To"] boolValue] ? @"Y" : @""; 452 else if ([ident isEqualToString: @"DL From"]) 453 return [[peer objectForKey: @"DL From"] boolValue] ? @"Y" : @""; 454 else 455 return [peer objectForKey: @"Client"]; 456 } 457 else 458 { 459 NSString * file = [fFiles objectAtIndex: row]; 460 if ([ident isEqualToString: @"Icon"]) 461 return [[NSWorkspace sharedWorkspace] iconForFileType: [file pathExtension]]; 462 else 463 return [file lastPathComponent]; 464 } 465 } 466 467 - (void) tableView: (NSTableView *) tableView didClickTableColumn: (NSTableColumn *) tableColumn 468 { 469 if (tableView == fPeerTable) 470 { 471 [fPeers sortUsingDescriptors: [tableView sortDescriptors]]; 472 [tableView reloadData]; 473 } 424 474 } 425 475 … … 429 479 row: (int) row mouseLocation: (NSPoint) mouseLocation 430 480 { 431 return [fFiles objectAtIndex: row];481 return tableView == fFileTable ? [fFiles objectAtIndex: row] : nil; 432 482 } 433 483 -
trunk/macosx/Torrent.h
r692 r761 115 115 - (BOOL) justFinished; 116 116 117 - (NSArray *) peers; 118 117 119 - (NSString *) progressString; 118 120 - (NSString *) statusString; -
trunk/macosx/Torrent.m
r729 r761 516 516 } 517 517 518 - (NSArray *) peers 519 { 520 tr_peer_t * peer; 521 int totalPeers = [self totalPeers], i; 522 523 NSMutableArray * peers = [NSMutableArray arrayWithCapacity: totalPeers]; 524 for (i = 0; i < totalPeers; i++) 525 { 526 peer = tr_getPeer(fHandle, i); 527 [peers addObject: [NSDictionary dictionaryWithObjectsAndKeys: 528 [NSString stringWithCString: (char *) tr_clientForId(tr_peerId(peer)) encoding: NSUTF8StringEncoding], 529 @"Client", 530 [NSNumber numberWithBool: tr_peerIsDownloading(peer)], @"UL To", 531 [NSNumber numberWithBool: tr_peerIsUploading(peer)], @"DL From", nil]]; 532 } 533 534 return peers; 535 } 536 518 537 - (NSString *) progressString 519 538 {
Note: See TracChangeset
for help on using the changeset viewer.