mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
feat(macos): added last known location (#6610)
* feat(macos): added last known location * fix data file label and reveal data button positions * code review: code style --------- Co-authored-by: BogdanArdelean <bogdan.ardelean@ymail.com>
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
@property(nonatomic) IBOutlet NSTextField* fHashField;
|
||||
@property(nonatomic) IBOutlet NSTextField* fSecureField;
|
||||
@property(nonatomic) IBOutlet NSTextField* fDataLocationField;
|
||||
@property(nonatomic) IBOutlet NSTextField* fLastDataLocationField;
|
||||
@property(nonatomic) IBOutlet NSTextField* fLastDataLabel;
|
||||
@property(nonatomic) IBOutlet NSTextField* fCreatorField;
|
||||
@property(nonatomic) IBOutlet NSTextField* fDateCreatedField;
|
||||
|
||||
@@ -60,10 +62,17 @@
|
||||
Torrent* torrent = self.fTorrents[0];
|
||||
|
||||
NSString* location = torrent.dataLocation;
|
||||
NSString* lastKnownDataLocation = torrent.lastKnownDataLocation;
|
||||
|
||||
self.fDataLocationField.stringValue = location ? location.stringByAbbreviatingWithTildeInPath : @"";
|
||||
self.fDataLocationField.toolTip = location ? location : @"";
|
||||
|
||||
self.fRevealDataButton.hidden = !location;
|
||||
self.fLastDataLabel.hidden = location ? YES : NO;
|
||||
self.fLastDataLocationField.hidden = location ? YES : NO;
|
||||
self.fLastDataLocationField.stringValue = location ? @"" : lastKnownDataLocation.stringByAbbreviatingWithTildeInPath;
|
||||
self.fLastDataLocationField.toolTip = location ? @"" : lastKnownDataLocation;
|
||||
|
||||
self.fRevealDataButton.hidden = location ? NO : YES;
|
||||
}
|
||||
|
||||
- (void)revealDataFile:(id)sender
|
||||
@@ -83,6 +92,9 @@
|
||||
|
||||
- (void)setupInfo
|
||||
{
|
||||
self.fLastDataLabel.hidden = YES;
|
||||
self.fLastDataLocationField.hidden = YES;
|
||||
|
||||
if (self.fTorrents.count == 1)
|
||||
{
|
||||
Torrent* torrent = self.fTorrents[0];
|
||||
|
||||
Reference in New Issue
Block a user