Change setup of PrefsController a little.

This commit is contained in:
Mitchell Livingston
2006-07-30 22:11:08 +00:00
parent 25045ca3d6
commit e8f77bb80f
3 changed files with 14 additions and 9 deletions

View File

@@ -73,7 +73,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
fDefaults = [NSUserDefaults standardUserDefaults];
fInfoController = [[InfoWindowController alloc] initWithWindowNibName: @"InfoWindow"];
fPrefsController = [[PrefsController alloc] initWithWindowNibName: @"PrefsWindow"];
fPrefsController = [[PrefsController alloc] initWithWindowNibName: @"PrefsWindow" handle: fLib];
fBadger = [[Badger alloc] init];
fAutoImportedNames = [[NSMutableArray alloc] init];
@@ -105,8 +105,6 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
- (void) awakeFromNib
{
[fPrefsController setPrefs: fLib];
[fStatusBar setBackgroundImage: [NSImage imageNamed: @"StatusBarBackground.png"]];
[fFilterBar setBackgroundImage: [NSImage imageNamed: @"FilterBarBackground.png"]];

View File

@@ -60,7 +60,7 @@
NSUserDefaults * fDefaults;
}
- (void) setPrefs: (tr_handle_t *) handle;
- (id) initWithWindowNibName: (NSString *) name handle: (tr_handle_t *) handle;
- (void) setShowMessage: (id) sender;
- (void) setBadge: (id) sender;

View File

@@ -70,13 +70,23 @@
[[NSBundle mainBundle] pathForResource: @"Defaults" ofType: @"plist"]]];
}
- (id) initWithWindowNibName: (NSString *) name handle: (tr_handle_t *) handle
{
if ((self = [super initWithWindowNibName: name]))
{
fDefaults = [NSUserDefaults standardUserDefaults];
fHandle = handle;
}
return self;
}
- (void) dealloc
{
[fDownloadFolder release];
[super dealloc];
}
- (void) setPrefs: (tr_handle_t *) handle
- (void) awakeFromNib
{
fToolbar = [[NSToolbar alloc] initWithIdentifier: @"Preferences Toolbar"];
[fToolbar setDelegate: self];
@@ -87,9 +97,6 @@
[fToolbar setSelectedItemIdentifier: TOOLBAR_GENERAL];
[self showGeneralPref: nil];
fDefaults = [NSUserDefaults standardUserDefaults];
fHandle = handle;
//set download folder
NSString * downloadChoice = [fDefaults stringForKey: @"DownloadChoice"];
@@ -285,7 +292,7 @@
}
else
{
tr_setBindPort( fHandle, bindPort );
tr_setBindPort(fHandle, bindPort);
[fDefaults setInteger: bindPort forKey: @"BindPort"];
}
}