diff --git a/macosx/English.lproj/InfoWindow.nib/classes.nib b/macosx/English.lproj/InfoWindow.nib/classes.nib index 40dd76bc3..c90acacb7 100644 --- a/macosx/English.lproj/InfoWindow.nib/classes.nib +++ b/macosx/English.lproj/InfoWindow.nib/classes.nib @@ -8,7 +8,13 @@ }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { - ACTIONS = {revealFile = id; setRatioCheck = id; setRatioLimit = id; }; + ACTIONS = { + revealDataFile = id; + revealFile = id; + revealTorrentFile = id; + setRatioCheck = id; + setRatioLimit = id; + }; CLASS = InfoWindowController; LANGUAGE = ObjC; OUTLETS = { @@ -32,6 +38,8 @@ fRatioField = NSTextField; fRatioLimitField = NSTextField; fRatioMatrix = NSMatrix; + fRevealDataButton = NSButton; + fRevealTorrentButton = NSButton; fSeedersField = NSTextField; fSizeField = NSTextField; fStateField = NSTextField; diff --git a/macosx/English.lproj/InfoWindow.nib/keyedobjects.nib b/macosx/English.lproj/InfoWindow.nib/keyedobjects.nib index 3eea303e1..ed58213f0 100644 Binary files a/macosx/English.lproj/InfoWindow.nib/keyedobjects.nib and b/macosx/English.lproj/InfoWindow.nib/keyedobjects.nib differ diff --git a/macosx/InfoWindowController.h b/macosx/InfoWindowController.h index bc357d27c..11f534620 100644 --- a/macosx/InfoWindowController.h +++ b/macosx/InfoWindowController.h @@ -43,6 +43,7 @@ * fDateStartedField, * fStateField, * fDownloadedValidField, * fDownloadedTotalField, * fUploadedTotalField, * fRatioField, * fSwarmSpeedField; + IBOutlet NSButton * fRevealDataButton, * fRevealTorrentButton; IBOutlet NSTableView * fPeerTable; IBOutlet NSTextField * fSeedersField, * fLeechersField, * fConnectedPeersField, @@ -63,6 +64,9 @@ - (void) setNextTab; - (void) setPreviousTab; + +- (void) revealTorrentFile: (id) sender; +- (void) revealDataFile: (id) sender; - (void) revealFile: (id) sender; - (void) setRatioCheck: (id) sender; diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index b17b07e59..52b5a2e59 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -150,6 +150,9 @@ [fDataLocationField setToolTip: nil]; [fDateStartedField setStringValue: @""]; + [fRevealDataButton setHidden: YES]; + [fRevealTorrentButton setHidden: YES]; + //don't allow empty fields to be selected [fTrackerField setSelectable: NO]; [fAnnounceField setSelectable: NO]; @@ -201,6 +204,9 @@ [fDataLocationField setToolTip: [torrent dataLocation]]; [fDateStartedField setObjectValue: [torrent date]]; + [fRevealDataButton setHidden: NO]; + [fRevealTorrentButton setHidden: ![torrent publicTorrent]]; + //allow these fields to be selected [fTrackerField setSelectable: YES]; [fAnnounceField setSelectable: YES]; @@ -531,6 +537,16 @@ return descriptors; } +- (void) revealTorrentFile: (id) sender +{ + [[fTorrents objectAtIndex: 0] revealPublicTorrent]; +} + +- (void) revealDataFile: (id) sender +{ + [[fTorrents objectAtIndex: 0] revealData]; +} + - (void) revealFile: (id) sender { NSIndexSet * indexSet = [fFileTable selectedRowIndexes]; diff --git a/macosx/Torrent.h b/macosx/Torrent.h index 4d27d42cc..e5e28e960 100644 --- a/macosx/Torrent.h +++ b/macosx/Torrent.h @@ -88,6 +88,7 @@ - (BOOL) waitingToStart; - (void) revealData; +- (void) revealPublicTorrent; - (void) trashData; - (void) trashTorrent; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 3d4c64e33..cf3a4e647 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -432,6 +432,12 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 [[NSWorkspace sharedWorkspace] selectFile: [self dataLocation] inFileViewerRootedAtPath: nil]; } +- (void) revealPublicTorrent +{ + if (fPublicTorrent) + [[NSWorkspace sharedWorkspace] selectFile: fPublicTorrentLocation inFileViewerRootedAtPath: nil]; +} + - (void) trashData { [self trashFile: [self dataLocation]];