#import "InfoController.h"
#import "StringStorage.h"
#import "version.h"

@implementation InfoController

- init
{
   [super init];
   [self setDocType: "info"];
   return self;
}

- awakeFromNib
{
   [versionText setStringValue: version];
   if([maintainerText respondsTo: @selector(setTitle:)])
       [maintainerText setTitle: maintainer];
   else
       [maintainerText setStringValue: maintainer];
   return self;
}

- sendComments: sender;
{
   char subject[80];
   id s = [NXApp appSpeaker];

   sprintf(subject,"Re: %s %s", [NXApp appName], version);

   NXPortFromName("Mail", NULL);	     /* make sure app is launched */
   [[NXApp appSpeaker] setSendPort:NXPortFromName("MailSendDemo", NULL)];
   [s performRemoteMethod:"setTo:" with: maintainer length: strlen(maintainer)+1];
   [s performRemoteMethod:"setSubject:" with: subject length: strlen(subject)+1];
   return self;
}

@end
