improve priority context menu

This commit is contained in:
Mitchell Livingston 2007-07-04 16:40:18 +00:00
parent 072a9c7916
commit 6bc49feffc
3 changed files with 8 additions and 4 deletions

View File

@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>29 56 356 240 0 0 1024 746 </string>
<string>35 67 356 240 0 0 1152 842 </string>
<key>IBEditorPositions</key>
<dict>
<key>549</key>

View File

@ -672,16 +672,20 @@
else
priority = PRIORITY_NORMAL;
NSIndexSet * fileIndexSet;
for (i = [indexSet firstIndex]; i != NSNotFound && (!current || !other); i = [indexSet indexGreaterThanIndex: i])
{
if ([torrent hasFilePriority: priority forIndexes: [[fFileOutline itemAtRow: i] objectForKey: @"Indexes"]])
fileIndexSet = [[fFileOutline itemAtRow: i] objectForKey: @"Indexes"];
if (![torrent canChangeDownloadCheckForFiles: fileIndexSet])
continue;
else if ([torrent hasFilePriority: priority forIndexes: fileIndexSet])
current = YES;
else
other = YES;
}
[menuItem setState: current ? (other ? NSMixedState : NSOnState) : NSOffState];
return YES;
[menuItem setState: current ? NSOnState : NSOffState];
return current || other;
}
return YES;