Changeset 712


Ignore:
Timestamp:
Jul 30, 2006, 10:11:08 PM (15 years ago)
Author:
livings124
Message:

Change setup of PrefsController? a little.

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r711 r712  
    7474        fDefaults = [NSUserDefaults standardUserDefaults];
    7575        fInfoController = [[InfoWindowController alloc] initWithWindowNibName: @"InfoWindow"];
    76         fPrefsController = [[PrefsController alloc] initWithWindowNibName: @"PrefsWindow"];
     76        fPrefsController = [[PrefsController alloc] initWithWindowNibName: @"PrefsWindow" handle: fLib];
    7777        fBadger = [[Badger alloc] init];
    7878       
     
    106106- (void) awakeFromNib
    107107{
    108     [fPrefsController setPrefs: fLib];
    109    
    110108    [fStatusBar setBackgroundImage: [NSImage imageNamed: @"StatusBarBackground.png"]];
    111109    [fFilterBar setBackgroundImage: [NSImage imageNamed: @"FilterBarBackground.png"]];
  • trunk/macosx/PrefsController.h

    r655 r712  
    6161}
    6262
    63 - (void) setPrefs: (tr_handle_t *) handle;
     63- (id) initWithWindowNibName: (NSString *) name handle: (tr_handle_t *) handle;
    6464
    6565- (void) setShowMessage:    (id) sender;
  • trunk/macosx/PrefsController.m

    r711 r712  
    7171}
    7272
     73- (id) initWithWindowNibName: (NSString *) name handle: (tr_handle_t *) handle
     74{
     75    if ((self = [super initWithWindowNibName: name]))
     76    {
     77        fDefaults = [NSUserDefaults standardUserDefaults];
     78        fHandle = handle;
     79    }
     80    return self;
     81}
     82
    7383- (void) dealloc
    7484{
     
    7787}
    7888
    79 - (void) setPrefs: (tr_handle_t *) handle
     89- (void) awakeFromNib
    8090{
    8191    fToolbar = [[NSToolbar alloc] initWithIdentifier: @"Preferences Toolbar"];
     
    8898    [fToolbar setSelectedItemIdentifier: TOOLBAR_GENERAL];
    8999    [self showGeneralPref: nil];
    90 
    91     fDefaults = [NSUserDefaults standardUserDefaults];
    92     fHandle = handle;
    93100   
    94101    //set download folder
     
    286293    else
    287294    {
    288         tr_setBindPort( fHandle, bindPort );
     295        tr_setBindPort(fHandle, bindPort);
    289296        [fDefaults setInteger: bindPort forKey: @"BindPort"];
    290297    }
Note: See TracChangeset for help on using the changeset viewer.