Changeset 614


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

small search field in filter

Location:
trunk/macosx
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.h

    r606 r614  
    7070    IBOutlet BarButton          * fNoFilterButton, * fPauseFilterButton,
    7171                                * fSeedFilterButton, * fDownloadFilterButton;
     72    IBOutlet NSSearchField      * fSearchFilterField;
    7273                               
    7374    IBOutlet NSMenuItem         * fNextInfoTabItem, * fPrevInfoTabItem;
     
    134135- (void) sortTorrentsIgnoreSelected;
    135136- (void) setSort: (id) sender;
    136 - (void) applyFilter;
     137- (void) applyFilter: (id) sender;
    137138- (void) setFilter: (id) sender;
    138139
  • 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
  • trunk/macosx/English.lproj/MainMenu.nib/classes.nib

    r597 r614  
    44        {
    55            ACTIONS = {
     6                applyFilter = id;
    67                checkUpdate = id;
    78                copyTorrentFile = id;
     
    5556                fRatioSetItem = NSMenuItem;
    5657                fScrollView = NSScrollView;
     58                fSearchFilterField = NSSearchField;
    5759                fSeedFilterButton = BarButton;
    5860                fSmallViewItem = NSMenuItem;
  • trunk/macosx/English.lproj/MainMenu.nib/info.nib

    r608 r614  
    1212                <string>364 490 420 60 0 0 1152 842 </string>
    1313                <key>1603</key>
    14                 <string>188 407 477 65 0 0 1152 842 </string>
     14                <string>241 540 477 65 0 0 1152 842 </string>
    1515                <key>29</key>
    1616                <string>9 780 451 44 0 0 1152 842 </string>
     
    3232        <key>IBOpenObjects</key>
    3333        <array>
     34                <integer>1603</integer>
    3435                <integer>29</integer>
    35                 <integer>1603</integer>
    3636        </array>
    3737        <key>IBSystem Version</key>
  • trunk/macosx/TorrentCell.m

    r613 r614  
    286286                                                        isEqual: [NSColor alternateSelectedControlColor]];
    287287    NSDictionary * nameAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
    288                     highlighted ? [NSColor whiteColor] : [NSColor blackColor],
    289                     NSForegroundColorAttributeName,
     288                    highlighted ? [NSColor whiteColor] : [NSColor blackColor], NSForegroundColorAttributeName,
    290289                    [NSFont messageFontOfSize: 12.0], NSFontAttributeName, nil];
    291290    NSDictionary * statusAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
    292                     highlighted ? [NSColor whiteColor] : [NSColor darkGrayColor],
    293                     NSForegroundColorAttributeName,
     291                    highlighted ? [NSColor whiteColor] : [NSColor darkGrayColor], NSForegroundColorAttributeName,
    294292                    [NSFont messageFontOfSize: 9.0], NSFontAttributeName, nil];
    295293
Note: See TracChangeset for help on using the changeset viewer.