1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 09:13:06 +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; }, {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; CLASS = InfoWindowController;
LANGUAGE = ObjC; LANGUAGE = ObjC;
OUTLETS = { OUTLETS = {
@ -32,6 +38,8 @@
fRatioField = NSTextField; fRatioField = NSTextField;
fRatioLimitField = NSTextField; fRatioLimitField = NSTextField;
fRatioMatrix = NSMatrix; fRatioMatrix = NSMatrix;
fRevealDataButton = NSButton;
fRevealTorrentButton = NSButton;
fSeedersField = NSTextField; fSeedersField = NSTextField;
fSizeField = NSTextField; fSizeField = NSTextField;
fStateField = NSTextField; fStateField = NSTextField;

View file

@ -43,6 +43,7 @@
* fDateStartedField, * fStateField, * fDateStartedField, * fStateField,
* fDownloadedValidField, * fDownloadedTotalField, * fUploadedTotalField, * fDownloadedValidField, * fDownloadedTotalField, * fUploadedTotalField,
* fRatioField, * fSwarmSpeedField; * fRatioField, * fSwarmSpeedField;
IBOutlet NSButton * fRevealDataButton, * fRevealTorrentButton;
IBOutlet NSTableView * fPeerTable; IBOutlet NSTableView * fPeerTable;
IBOutlet NSTextField * fSeedersField, * fLeechersField, * fConnectedPeersField, IBOutlet NSTextField * fSeedersField, * fLeechersField, * fConnectedPeersField,
@ -63,6 +64,9 @@
- (void) setNextTab; - (void) setNextTab;
- (void) setPreviousTab; - (void) setPreviousTab;
- (void) revealTorrentFile: (id) sender;
- (void) revealDataFile: (id) sender;
- (void) revealFile: (id) sender; - (void) revealFile: (id) sender;
- (void) setRatioCheck: (id) sender; - (void) setRatioCheck: (id) sender;

View file

@ -150,6 +150,9 @@
[fDataLocationField setToolTip: nil]; [fDataLocationField setToolTip: nil];
[fDateStartedField setStringValue: @""]; [fDateStartedField setStringValue: @""];
[fRevealDataButton setHidden: YES];
[fRevealTorrentButton setHidden: YES];
//don't allow empty fields to be selected //don't allow empty fields to be selected
[fTrackerField setSelectable: NO]; [fTrackerField setSelectable: NO];
[fAnnounceField setSelectable: NO]; [fAnnounceField setSelectable: NO];
@ -201,6 +204,9 @@
[fDataLocationField setToolTip: [torrent dataLocation]]; [fDataLocationField setToolTip: [torrent dataLocation]];
[fDateStartedField setObjectValue: [torrent date]]; [fDateStartedField setObjectValue: [torrent date]];
[fRevealDataButton setHidden: NO];
[fRevealTorrentButton setHidden: ![torrent publicTorrent]];
//allow these fields to be selected //allow these fields to be selected
[fTrackerField setSelectable: YES]; [fTrackerField setSelectable: YES];
[fAnnounceField setSelectable: YES]; [fAnnounceField setSelectable: YES];
@ -531,6 +537,16 @@
return descriptors; return descriptors;
} }
- (void) revealTorrentFile: (id) sender
{
[[fTorrents objectAtIndex: 0] revealPublicTorrent];
}
- (void) revealDataFile: (id) sender
{
[[fTorrents objectAtIndex: 0] revealData];
}
- (void) revealFile: (id) sender - (void) revealFile: (id) sender
{ {
NSIndexSet * indexSet = [fFileTable selectedRowIndexes]; NSIndexSet * indexSet = [fFileTable selectedRowIndexes];

View file

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

View file

@ -432,6 +432,12 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
[[NSWorkspace sharedWorkspace] selectFile: [self dataLocation] inFileViewerRootedAtPath: nil]; [[NSWorkspace sharedWorkspace] selectFile: [self dataLocation] inFileViewerRootedAtPath: nil];
} }
- (void) revealPublicTorrent
{
if (fPublicTorrent)
[[NSWorkspace sharedWorkspace] selectFile: fPublicTorrentLocation inFileViewerRootedAtPath: nil];
}
- (void) trashData - (void) trashData
{ {
[self trashFile: [self dataLocation]]; [self trashFile: [self dataLocation]];