1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

buttons in inspector to reveal data file and (public) torrent file

This commit is contained in:
Mitchell Livingston 2006-10-15 19:57:40 +00:00
parent d397144b0f
commit 78ee2deab5
6 changed files with 36 additions and 1 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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];

View file

@ -88,6 +88,7 @@
- (BOOL) waitingToStart;
- (void) revealData;
- (void) revealPublicTorrent;
- (void) trashData;
- (void) trashTorrent;

View file

@ -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]];