Changeset 2337 for trunk/macosx/FileOutlineView.m
- Timestamp:
- Jul 13, 2007, 4:20:11 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/FileOutlineView.m
r2335 r2337 106 106 Torrent * torrent = [(InfoWindowController *)[[self window] windowController] selectedTorrent]; 107 107 108 NSIndexSet * indexSet = [item objectForKey: @"Indexes"]; 109 if ([[item objectForKey: @"IsFolder"] boolValue] || ![torrent canChangeDownloadCheckForFiles: indexSet]) 108 if ([[item objectForKey: @"IsFolder"] boolValue]) 110 109 [fNormalColor set]; 111 110 else 112 111 { 113 if ([torrent hasFilePriority: TR_PRI_HIGH forIndexes: indexSet]) 114 [fHighPriorityColor set]; 115 else if ([torrent hasFilePriority: TR_PRI_LOW forIndexes: indexSet]) 116 [fLowPriorityColor set]; 112 NSArray * priorities = [torrent filePrioritiesForIndexes: [item objectForKey: @"Indexes"]]; 113 if ([priorities count] == 0) 114 [fNormalColor set]; 117 115 else 118 [fNormalColor set]; 116 { 117 int priority = [[priorities objectAtIndex: 0] intValue]; 118 if (priority == TR_PRI_LOW) 119 [fLowPriorityColor set]; 120 else if (priority == TR_PRI_HIGH) 121 [fHighPriorityColor set]; 122 else 123 [fNormalColor set]; 124 } 119 125 } 120 126 … … 141 147 { 142 148 item = [self itemAtRow: i]; 143 if ([[item objectForKey: @"IsFolder"] boolValue]) 144 continue; 145 146 indexSet = [item objectForKey: @"Indexes"]; 147 if ([torrent canChangeDownloadCheckForFiles: indexSet]) 149 if (![[item objectForKey: @"IsFolder"] boolValue]) 148 150 { 149 if ([torrent hasFilePriority: TR_PRI_HIGH forIndexes: indexSet]) 150 [fHighPriorityColor set]; 151 else if ([torrent hasFilePriority: TR_PRI_LOW forIndexes: indexSet]) 152 [fLowPriorityColor set]; 153 else 154 continue; 151 NSArray * priorities = [torrent filePrioritiesForIndexes: [item objectForKey: @"Indexes"]]; 152 if ([priorities count] == 1) 153 { 154 int priority = [[priorities objectAtIndex: 0] intValue]; 155 if (priority == TR_PRI_LOW) 156 [fLowPriorityColor set]; 157 else if (priority == TR_PRI_HIGH) 158 [fHighPriorityColor set]; 159 else 160 continue; 155 161 156 NSRect rect = [self rectOfRow: i]; 157 float width = 14.0; 158 rect.origin.y += (rect.size.height - width) * 0.5; 159 rect.origin.x += 3.0; 160 rect.size.width = width; 161 rect.size.height = width; 162 163 [[NSBezierPath bezierPathWithOvalInRect: rect] fill]; 162 NSRect rect = [self rectOfRow: i]; 163 float width = 14.0; 164 rect.origin.y += (rect.size.height - width) * 0.5; 165 rect.origin.x += 3.0; 166 rect.size.width = width; 167 rect.size.height = width; 168 169 [[NSBezierPath bezierPathWithOvalInRect: rect] fill]; 170 } 164 171 } 165 172 }
Note: See TracChangeset
for help on using the changeset viewer.