Changeset 4974


Ignore:
Timestamp:
Feb 7, 2008, 9:26:04 PM (14 years ago)
Author:
livings124
Message:

save collapsed groups between launches

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r4972 r4974  
    581581    //save history
    582582    [self updateTorrentHistory];
     583    [fTableView saveCollapsedGroups];
    583584   
    584585    //remaining calls the same as dealloc
  • trunk/macosx/TorrentTableView.h

    r4947 r4974  
    5656- (void) removeCollapsedGroup: (int) value;
    5757- (void) removeAllCollapsedGroups;
     58- (void) saveCollapsedGroups;
    5859
    5960- (void) removeButtonTrackingAreas;
  • trunk/macosx/TorrentTableView.m

    r4951 r4974  
    6464            [[self tableColumnWithIdentifier: @"Torrent"] setDataCell: fTorrentCell];
    6565       
    66         fCollapsedGroups = [[NSMutableIndexSet alloc] init];
     66        NSData * groupData = [fDefaults dataForKey: @"CollapsedGroups"];
     67        if (groupData)
     68            fCollapsedGroups = [[NSUnarchiver unarchiveObjectWithData: groupData] retain];
     69        else
     70            fCollapsedGroups = [[NSMutableIndexSet alloc] init];
    6771       
    6872        fMouseControlRow = -1;
     
    112116{
    113117    [fCollapsedGroups removeAllIndexes];
     118}
     119
     120- (void) saveCollapsedGroups
     121{
     122    [fDefaults setObject: [NSArchiver archivedDataWithRootObject: fCollapsedGroups] forKey: @"CollapsedGroups"];
    114123}
    115124
Note: See TracChangeset for help on using the changeset viewer.