/* --------------------------------------------------------------------------

Class:			FhGLicensePanel
Version:		0.1
File:			FhGLicensePanel.m				 

Written by:		Thomas Engel
Created:		17.05.1995	(Copyleft)
Last modified:	17.05.1995


Note:	For a detailed description please read the class documentation.

 ------------------------------------------------------------------------- */


#import "FhGLicensePanel.h"
#import <FhGRegister.h>


@implementation FhGLicensePanel

- runForLicense;
{
	if( !panel )
	{
		if( [NXApp loadNibSection:"FhGLicensePanel.nib" owner:self] == nil )
			NXRunAlertPanel( NULL, "Couldn't load FhGLicensePanel.nib",
							 "OK", NULL, NULL );
	}
	[panel makeKeyAndOrderFront:self];
	
	return self;
}

- cancelRegistration:sender
{
	if( panel )
		[panel close];

	return self;
}

- enteredRegistration:sender
{
	id	ourLicenseChecker;

	ourLicenseChecker = [FhGRegister new];
	if( [ourLicenseChecker setRegistrationKey:[licenseField stringValue]] != 0 )
		NXRunAlertPanel( NULL, "License Key invalid. Please Enter again.",
							 "Ooops", NULL, NULL );

	else [self cancelRegistration:self];
	[ourLicenseChecker free];
	return self;
}

@end

/*
 * History: 
 *
 *
 * Bugs: - No
 */