1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 09:13:06 +00:00

display date completed info in the inspector

This commit is contained in:
Mitchell Livingston 2007-05-25 19:45:14 +00:00
parent b4d71e2e9a
commit 4481e184cf
6 changed files with 33 additions and 10 deletions

View file

@ -21,8 +21,9 @@
fConnectedPeersField = NSTextField;
fCreatorField = NSTextField;
fDataLocationField = NSTextField;
fDateAddedField = NSTextField;
fDateCompletedField = NSTextField;
fDateCreatedField = NSTextField;
fDateStartedField = NSTextField;
fDownloadLimitField = NSTextField;
fDownloadLimitLabel = NSTextField;
fDownloadLimitPopUp = NSPopUpButton;

View file

@ -38,7 +38,7 @@
IBOutlet NSTextField * fNameField, * fSizeField, * fTrackerField,
* fPiecesField, * fHashField, * fSecureField,
* fTorrentLocationField, * fDataLocationField,
* fDateStartedField,
* fDateAddedField, * fDateCompletedField,
* fCreatorField, * fDateCreatedField,
* fStateField,
* fDownloadedValidField, * fDownloadedTotalField, * fUploadedTotalField,

View file

@ -37,7 +37,7 @@
#define TAB_OPTIONS_IDENT @"Options"
//15 spacing at the bottom of each tab
#define TAB_INFO_HEIGHT 284.0
#define TAB_INFO_HEIGHT 300.0
#define TAB_ACTIVITY_HEIGHT 170.0
#define TAB_PEERS_HEIGHT 279.0
#define TAB_FILES_HEIGHT 279.0
@ -176,7 +176,8 @@
[fTorrentLocationField setToolTip: nil];
[fDataLocationField setStringValue: @""];
[fDataLocationField setToolTip: nil];
[fDateStartedField setStringValue: @""];
[fDateAddedField setStringValue: @""];
[fDateCompletedField setStringValue: @""];
[fCommentView setSelectable: NO];
[fRevealDataButton setHidden: YES];
@ -253,7 +254,7 @@
else
[fTorrentLocationField setToolTip: [torrent torrentLocation]];
[fDateStartedField setObjectValue: [torrent dateAdded]];
[fDateAddedField setObjectValue: [torrent dateAdded]];
[fRevealDataButton setHidden: NO];
[fRevealTorrentButton setHidden: ![torrent publicTorrent]];
@ -310,8 +311,7 @@
- (void) updateInfoGeneral
{
int numberSelected = [fTorrents count];
if (numberSelected != 1)
if ([fTorrents count] != 1)
return;
Torrent * torrent = [fTorrents objectAtIndex: 0];
@ -323,6 +323,8 @@
NSString * location = [torrent dataLocation];
[fDataLocationField setStringValue: [location stringByAbbreviatingWithTildeInPath]];
[fDataLocationField setToolTip: location];
[fDateCompletedField setObjectValue: [torrent dateCompleted]];
}
- (void) updateInfoActivity

View file

@ -35,7 +35,8 @@
tr_stat_t * fStat;
BOOL fResumeOnWake;
NSDate * fDateAdded, * fDateCompleted, * fAnnounceDate;
NSDate * fDateAdded, * fDateCompleted, * fAnnounceDate,
* fDateActivity;
BOOL fUseIncompleteFolder;
NSString * fDownloadFolder, * fIncompleteFolder;
@ -202,6 +203,7 @@
- (NSDate *) dateAdded;
- (NSDate *) dateCompleted;
- (NSDate *) dateActivity;
- (NSNumber *) stateSortKey;
- (NSNumber *) progressSortKey;

View file

@ -35,6 +35,7 @@
- (id) initWithHash: (NSString *) hashString path: (NSString *) path lib: (tr_handle_t *) lib
publicTorrent: (NSNumber *) publicTorrent
dateAdded: (NSDate *) dateAdded dateCompleted: (NSDate *) dateCompleted
dateActivity: (NSDate *) dateActivity
ratioSetting: (NSNumber *) ratioSetting ratioLimit: (NSNumber *) ratioLimit
limitSpeedCustom: (NSNumber *) limitCustom
checkUpload: (NSNumber *) checkUpload uploadLimit: (NSNumber *) uploadLimit
@ -70,6 +71,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
self = [self initWithHash: nil path: path lib: lib
publicTorrent: delete ? [NSNumber numberWithBool: NO] : nil
dateAdded: nil dateCompleted: nil
dateActivity: nil
ratioSetting: nil ratioLimit: nil
limitSpeedCustom: nil
checkUpload: nil uploadLimit: nil
@ -95,6 +97,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
publicTorrent: [history objectForKey: @"PublicCopy"]
dateAdded: [history objectForKey: @"Date"]
dateCompleted: [history objectForKey: @"DateCompleted"]
dateActivity: [history objectForKey: @"DateActivity"]
ratioSetting: [history objectForKey: @"RatioSetting"]
ratioLimit: [history objectForKey: @"RatioLimit"]
limitSpeedCustom: [history objectForKey: @"LimitSpeedCustom"]
@ -154,7 +157,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
fDownloadFolder, @"DownloadFolder",
[NSNumber numberWithBool: fUseIncompleteFolder], @"UseIncompleteFolder",
[NSNumber numberWithBool: [self isActive]], @"Active",
[self dateAdded], @"Date",
fDateAdded, @"Date",
[NSNumber numberWithInt: fRatioSetting], @"RatioSetting",
[NSNumber numberWithFloat: fRatioLimit], @"RatioLimit",
[NSNumber numberWithInt: fCheckUpload], @"CheckUpload",
@ -174,7 +177,11 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
[history setObject: [NSNumber numberWithBool: fPex] forKey: @"Pex"];
if (fDateCompleted)
[history setObject: [self dateAdded] forKey: @"DateCompleted"];
[history setObject: fDateCompleted forKey: @"DateCompleted"];
NSDate * dateCompleted = [self dateActivity];
if (dateCompleted)
[history setObject: dateCompleted forKey: @"DateActivity"];
return history;
}
@ -198,6 +205,8 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
[fDateAdded release];
if (fDateCompleted)
[fDateCompleted release];
if (fDateActivity)
[fDateActivity release];
if (fAnnounceDate)
[fAnnounceDate release];
@ -1340,6 +1349,12 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
return fDateCompleted;
}
- (NSDate *) dateActivity
{
uint64_t date = fStat->activityDate;
return date > 0 ? [NSDate dateWithTimeIntervalSince1970: date] : fDateActivity;
}
- (NSNumber *) stateSortKey
{
if (![self isActive])
@ -1368,6 +1383,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
- (id) initWithHash: (NSString *) hashString path: (NSString *) path lib: (tr_handle_t *) lib
publicTorrent: (NSNumber *) publicTorrent
dateAdded: (NSDate *) dateAdded dateCompleted: (NSDate *) dateCompleted
dateActivity: (NSDate *) dateActivity
ratioSetting: (NSNumber *) ratioSetting ratioLimit: (NSNumber *) ratioLimit
limitSpeedCustom: (NSNumber *) limitCustom
checkUpload: (NSNumber *) checkUpload uploadLimit: (NSNumber *) uploadLimit
@ -1407,6 +1423,8 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
fDateAdded = dateAdded ? [dateAdded retain] : [[NSDate alloc] init];
if (dateCompleted)
fDateCompleted = [dateCompleted retain];
if (dateActivity)
fDateActivity = [dateActivity retain];
fRatioSetting = ratioSetting ? [ratioSetting intValue] : NSMixedState;
fRatioLimit = ratioLimit ? [ratioLimit floatValue] : [fDefaults floatForKey: @"RatioLimit"];