From ab4a1cd2f7a501596e80efd882aebab687e7a46a Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Fri, 22 Jun 2007 01:16:50 +0000 Subject: [PATCH] don't show priority colors for finished files --- macosx/FileOutlineView.m | 6 ++++-- macosx/InfoWindowController.m | 3 +++ macosx/Torrent.m | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/macosx/FileOutlineView.m b/macosx/FileOutlineView.m index 01ceef74a..823d15104 100644 --- a/macosx/FileOutlineView.m +++ b/macosx/FileOutlineView.m @@ -75,7 +75,8 @@ if (![self isRowSelected: row]) { NSDictionary * item = [self itemAtRow: row]; - if ([[item objectForKey: @"IsFolder"] boolValue]) + if ([[item objectForKey: @"IsFolder"] boolValue] + || ![[item objectForKey: @"Torrent"] canChangeDownloadCheckForFiles: [item objectForKey: @"Indexes"]]) [fNormalColor set]; else { @@ -108,7 +109,8 @@ if ([self isRowSelected: i]) { item = [self itemAtRow: i]; - if (![[item objectForKey: @"IsFolder"] boolValue]) + if (![[item objectForKey: @"IsFolder"] boolValue] + && [[item objectForKey: @"Torrent"] canChangeDownloadCheckForFiles: [item objectForKey: @"Indexes"]]) { priority = [[item objectForKey: @"Priority"] intValue]; if (priority == PRIORITY_HIGH) diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 93578bc29..71692e5da 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -909,6 +909,9 @@ } else if ([identifier isEqualToString: @"Priority"]) { + if (![[fTorrents objectAtIndex: 0] canChangeDownloadCheckForFiles: [item objectForKey: @"Indexes"]]) + return; + int priority = [object intValue], actualPriority; if (priority == 0) actualPriority = PRIORITY_LOW; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index bf460f9fc..f0d156449 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -1406,7 +1406,8 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 { int index; for (index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index]) - if (priority == [[[fFlatFileList objectAtIndex: index] objectForKey: @"Priority"] intValue]) + if (priority == [[[fFlatFileList objectAtIndex: index] objectForKey: @"Priority"] intValue] + && [self fileProgress: index] < 1.0) return YES; return NO; } @@ -1678,6 +1679,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 [dict setObject: [NSNumber numberWithUnsignedLongLong: size] forKey: @"Size"]; [dict setObject: [[NSWorkspace sharedWorkspace] iconForFileType: [name pathExtension]] forKey: @"Icon"]; [dict setObject: [NSNumber numberWithInt: priority] forKey: @"Priority"]; + [dict setObject: self forKey: @"Torrent"]; [flatList addObject: dict]; }