Changeset 2167


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

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r2159 r2167  
    282282
    283283    [fTableView registerForDraggedTypes: [NSArray arrayWithObject: TORRENT_TABLE_VIEW_DATA_TYPE]];
    284     [fWindow registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType,
    285                                             NSURLPboardType, nil]];
     284    [fWindow registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, NSURLPboardType, nil]];
    286285
    287286    //register for sleep notifications
  • trunk/macosx/CreatorWindowController.h

    r2149 r2167  
    4343    NSTimer * fTimer;
    4444    BOOL fStarted;
     45   
     46    NSUserDefaults * fDefaults;
    4547}
    4648
  • 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.