Changeset 2240


Ignore:
Timestamp:
Jun 30, 2007, 2:52:24 AM (15 years ago)
Author:
livings124
Message:

enable the context menu for enable selected properly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.m

    r2238 r2240  
    614614    {
    615615        Torrent * torrent = [fTorrents objectAtIndex: 0];
    616         NSDictionary * item;
    617616        NSIndexSet * indexSet = [fFileOutline selectedRowIndexes], * itemIndexes;
    618617        NSMutableIndexSet * usedIndexes = [NSMutableIndexSet indexSet];
     
    631630    }
    632631   
    633     #warning disable if all can't be checked
    634632    if (action == @selector(setOnlySelectedCheck:))
    635         return [fFileOutline selectedRow] != -1;
     633    {
     634        Torrent * torrent = [fTorrents objectAtIndex: 0];
     635        NSIndexSet * indexSet = [fFileOutline selectedRowIndexes], * itemIndexes;
     636        NSMutableIndexSet * usedIndexes = [NSMutableIndexSet indexSet];
     637        int i, index;
     638        for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])
     639        {
     640            itemIndexes = [[fFileOutline itemAtRow: i] objectForKey: @"Indexes"];
     641            if (![usedIndexes containsIndexes: itemIndexes])
     642            {
     643                if ([torrent canChangeDownloadCheckForFiles: itemIndexes])
     644                    return YES;
     645                [usedIndexes addIndexes: itemIndexes];
     646            }
     647        }
     648        return NO;
     649    }
    636650   
    637651    if (action == @selector(setPriority:))
     
    954968- (void) setFileOutlineHoverRowForEvent: (NSEvent *) event
    955969{
    956     [fFileOutline setHoverRowForEvent: [[[fTabView selectedTabViewItem] identifier] isEqualToString: TAB_FILES_IDENT] ? event : nil];
     970    [fFileOutline setHoverRowForEvent: [[[fTabView selectedTabViewItem] identifier] isEqualToString: TAB_FILES_IDENT]
     971                                        ? event : nil];
    957972}
    958973
Note: See TracChangeset for help on using the changeset viewer.