mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 18:38:42 +00:00
Change setup of PrefsController a little.
This commit is contained in:
@@ -73,7 +73,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
|||||||
|
|
||||||
fDefaults = [NSUserDefaults standardUserDefaults];
|
fDefaults = [NSUserDefaults standardUserDefaults];
|
||||||
fInfoController = [[InfoWindowController alloc] initWithWindowNibName: @"InfoWindow"];
|
fInfoController = [[InfoWindowController alloc] initWithWindowNibName: @"InfoWindow"];
|
||||||
fPrefsController = [[PrefsController alloc] initWithWindowNibName: @"PrefsWindow"];
|
fPrefsController = [[PrefsController alloc] initWithWindowNibName: @"PrefsWindow" handle: fLib];
|
||||||
fBadger = [[Badger alloc] init];
|
fBadger = [[Badger alloc] init];
|
||||||
|
|
||||||
fAutoImportedNames = [[NSMutableArray alloc] init];
|
fAutoImportedNames = [[NSMutableArray alloc] init];
|
||||||
@@ -105,8 +105,6 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
|||||||
|
|
||||||
- (void) awakeFromNib
|
- (void) awakeFromNib
|
||||||
{
|
{
|
||||||
[fPrefsController setPrefs: fLib];
|
|
||||||
|
|
||||||
[fStatusBar setBackgroundImage: [NSImage imageNamed: @"StatusBarBackground.png"]];
|
[fStatusBar setBackgroundImage: [NSImage imageNamed: @"StatusBarBackground.png"]];
|
||||||
[fFilterBar setBackgroundImage: [NSImage imageNamed: @"FilterBarBackground.png"]];
|
[fFilterBar setBackgroundImage: [NSImage imageNamed: @"FilterBarBackground.png"]];
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
NSUserDefaults * fDefaults;
|
NSUserDefaults * fDefaults;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setPrefs: (tr_handle_t *) handle;
|
- (id) initWithWindowNibName: (NSString *) name handle: (tr_handle_t *) handle;
|
||||||
|
|
||||||
- (void) setShowMessage: (id) sender;
|
- (void) setShowMessage: (id) sender;
|
||||||
- (void) setBadge: (id) sender;
|
- (void) setBadge: (id) sender;
|
||||||
|
|||||||
@@ -70,13 +70,23 @@
|
|||||||
[[NSBundle mainBundle] pathForResource: @"Defaults" ofType: @"plist"]]];
|
[[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
|
- (void) dealloc
|
||||||
{
|
{
|
||||||
[fDownloadFolder release];
|
[fDownloadFolder release];
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setPrefs: (tr_handle_t *) handle
|
- (void) awakeFromNib
|
||||||
{
|
{
|
||||||
fToolbar = [[NSToolbar alloc] initWithIdentifier: @"Preferences Toolbar"];
|
fToolbar = [[NSToolbar alloc] initWithIdentifier: @"Preferences Toolbar"];
|
||||||
[fToolbar setDelegate: self];
|
[fToolbar setDelegate: self];
|
||||||
@@ -88,9 +98,6 @@
|
|||||||
[fToolbar setSelectedItemIdentifier: TOOLBAR_GENERAL];
|
[fToolbar setSelectedItemIdentifier: TOOLBAR_GENERAL];
|
||||||
[self showGeneralPref: nil];
|
[self showGeneralPref: nil];
|
||||||
|
|
||||||
fDefaults = [NSUserDefaults standardUserDefaults];
|
|
||||||
fHandle = handle;
|
|
||||||
|
|
||||||
//set download folder
|
//set download folder
|
||||||
NSString * downloadChoice = [fDefaults stringForKey: @"DownloadChoice"];
|
NSString * downloadChoice = [fDefaults stringForKey: @"DownloadChoice"];
|
||||||
fDownloadFolder = [[[fDefaults stringForKey: @"DownloadFolder"] stringByExpandingTildeInPath] retain];
|
fDownloadFolder = [[[fDefaults stringForKey: @"DownloadFolder"] stringByExpandingTildeInPath] retain];
|
||||||
@@ -285,7 +292,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tr_setBindPort( fHandle, bindPort );
|
tr_setBindPort(fHandle, bindPort);
|
||||||
[fDefaults setInteger: bindPort forKey: @"BindPort"];
|
[fDefaults setInteger: bindPort forKey: @"BindPort"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user