Ignore:
Timestamp:
Jun 19, 2007, 11:18:47 PM (15 years ago)
Author:
livings124
Message:

store the values of the tracker address, private check, and open check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/CreatorWindowController.m

    r2149 r2167  
    7979            return nil;
    8080        }
     81       
     82        fDefaults = [NSUserDefaults standardUserDefaults];
    8183    }
    8284    return self;
     
    125127    [fLocationField setStringValue: [fLocation stringByAbbreviatingWithTildeInPath]];
    126128    [fLocationField setToolTip: fLocation];
     129   
     130    //set previously saved values
     131    NSString * tracker;
     132    if ((tracker = [fDefaults stringForKey: @"CreatorTracker"]))
     133        [fTrackerField setStringValue: tracker];
     134   
     135    if ([fDefaults objectForKey: @"CreatorPrivate"])
     136        [fPrivateCheck setState: [fDefaults boolForKey: @"CreatorPrivate"] ? NSOnState : NSOffState];
     137   
     138    if ([fDefaults objectForKey: @"CreatorOpen"])
     139        [fOpenCheck setState: [fDefaults boolForKey: @"CreatorOpen"] ? NSOnState : NSOffState];
    127140}
    128141
     
    214227   
    215228    fOpenTorrent = [fOpenCheck state] == NSOnState;
     229   
     230    //store values
     231    [fDefaults setObject: trackerString forKey: @"CreatorTracker"];
     232    [fDefaults setBool: [fPrivateCheck state] == NSOnState forKey: @"CreatorPrivate"];
     233    [fDefaults setBool: fOpenTorrent forKey: @"CreatorOpen"];
     234   
    216235    tr_makeMetaInfo(fInfo, [fLocation UTF8String], [trackerString UTF8String], [[fCommentView string] UTF8String],
    217236                    [fPrivateCheck state] == NSOnState);
Note: See TracChangeset for help on using the changeset viewer.