Ignore:
Timestamp:
Jul 16, 2006, 5:59:20 PM (16 years ago)
Author:
livings124
Message:

small search field in filter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r606 r614  
    315315    [[NSRunLoop currentRunLoop] addTimer: fAutoImportTimer forMode: NSDefaultRunLoopMode];
    316316   
    317     [self applyFilter];
     317    [self applyFilter: nil];
    318318   
    319319    [fWindow makeKeyAndOrderFront: nil];
     
    475475
    476476    [self updateUI: nil];
    477     [self applyFilter];
     477    [self applyFilter: nil];
    478478    [self updateTorrentHistory];
    479479}
     
    548548   
    549549    [self updateUI: nil];
    550     [self applyFilter];
     550    [self applyFilter: nil];
    551551    [fInfoController updateInfoStatsAndSettings];
    552552    [self updateTorrentHistory];
     
    574574   
    575575    [self updateUI: nil];
    576     [self applyFilter];
     576    [self applyFilter: nil];
    577577    [fInfoController updateInfoStatsAndSettings];
    578578    [self updateTorrentHistory];
     
    841841        if ([torrent justFinished])
    842842        {
    843             [self applyFilter];
     843            [self applyFilter: nil];
    844844            [self checkToStartWaiting: torrent];
    845845       
     
    992992}
    993993
    994 - (void) applyFilter
     994- (void) applyFilter: (id) sender
    995995{
    996996    //remember selected rows if needed
     
    10261026    else
    10271027        [tempTorrents setArray: fTorrents];
     1028   
     1029    NSString * searchString = [fSearchFilterField stringValue];
     1030    if (![searchString isEqualToString: @""])
     1031    {
     1032        int i;
     1033        for (i = [tempTorrents count] - 1; i >= 0; i--)
     1034            if ([[[tempTorrents objectAtIndex: i] name] rangeOfString: searchString
     1035                                        options: NSCaseInsensitiveSearch].location == NSNotFound)
     1036                [tempTorrents removeObjectAtIndex: i];
     1037    }
    10281038   
    10291039    [fFilteredTorrents setArray: tempTorrents];
     
    10791089    }
    10801090
    1081     [self applyFilter];
     1091    [self applyFilter: nil];
    10821092}
    10831093
     
    11991209        [torrentToStart startTransfer];
    12001210       
    1201         [self applyFilter];
     1211        [self applyFilter: nil];
    12021212        [self updateUI: nil];
    12031213        [fInfoController updateInfoStatsAndSettings];
     
    12101220    [self attemptToStartMultipleAuto: [notification object]];
    12111221
    1212     [self applyFilter];
     1222    [self applyFilter: nil];
    12131223    [self updateUI: nil];
    12141224    [fInfoController updateInfoStatsAndSettings];
     
    12201230    [self attemptToStartMultipleAuto: fTorrents];
    12211231   
    1222     [self applyFilter];
     1232    [self applyFilter: nil];
    12231233    [self updateUI: nil];
    12241234    [fInfoController updateInfoStatsAndSettings];
     
    12281238- (void) torrentStoppedForRatio: (NSNotification *) notification
    12291239{
    1230     [self applyFilter];
     1240    [self applyFilter: nil];
    12311241    [fInfoController updateInfoStatsAndSettings];
    12321242   
     
    15621572- (void) toggleFilterBar: (id) sender
    15631573{
     1574    if (!fFilterBarVisible)
     1575        [fSearchFilterField setEnabled: YES];
     1576
    15641577    [self showFilterBar: !fFilterBarVisible animate: YES];
    15651578    [fDefaults setBool: fFilterBarVisible forKey: @"FilterBar"];
     
    15671580    //disable filtering when hiding
    15681581    if (!fFilterBarVisible)
     1582    {
     1583        [fSearchFilterField setEnabled: NO];
     1584        [fSearchFilterField setStringValue: @""];
    15691585        [self setFilter: fNoFilterButton];
     1586    }
    15701587}
    15711588
Note: See TracChangeset for help on using the changeset viewer.