//
//  quick and dirty:
//     dialing with the ZyXEL modem 
//     by: Olaf Mueller <olaf@orest.escape.de>
//

#import "Preferences.h"


@interface Preferences (PrivatePreferencesMethods)	


@end


@implementation Preferences

//	init

- init
{
	[super init] ;
	
	[NXApp loadNibSection:"Preferences.nib" owner:self] ;
	[myPanel setFrameAutosaveName: "Preferences"] ;
	return  self ;
}


- orderFront: sender
{
	[idForm setStringValue: NXGetDefaultValue([NXApp appName],"countryCode") at: 0] ;
	[idForm setStringValue: NXGetDefaultValue([NXApp appName],"cityCode") at: 1] ;
	[hereForm setStringValue: NXGetDefaultValue([NXApp appName],"thisCountry") at: 0] ;
	[hereForm setStringValue: NXGetDefaultValue([NXApp appName],"thisCity") at: 1] ;
	[ignoreString setStringValue: NXGetDefaultValue([NXApp appName],"charsToIgnore")] ;
	[myPanel makeKeyAndOrderFront: self] ;
	return  self ;
}


- doOk: sender
{
	NXWriteDefault ([NXApp appName],"countryCode",[idForm stringValueAt: 0]) ;
	NXWriteDefault ([NXApp appName],"cityCode",[idForm stringValueAt: 1]) ;
	NXWriteDefault ([NXApp appName],"thisCountry",[hereForm stringValueAt: 0]) ;
	NXWriteDefault ([NXApp appName],"thisCity",[hereForm stringValueAt: 1]) ;
	NXWriteDefault ([NXApp appName],"charsToIgnore",[ignoreString stringValue]) ;
	return  self ;
}


// ------------------- private methods -------------------------


@end
