// // AboutController.m // Bmi Calculator // // Created by Jasarien on 11/06/2007. // Copyright 2007 Jasarien.Com All rights reserved. // #import "AboutController.h" @implementation AboutController static AboutController *sharedInstance = nil; + (AboutController *)sharedInstance { return sharedInstance ? sharedInstance : [[self alloc] init]; } - (id)init { if (sharedInstance) { [self dealloc]; } else { sharedInstance = [super init]; } return sharedInstance; } - (IBAction)showPanel:(id)sender { if (!aboutText) { NSWindow *aboutWindow; if (![NSBundle loadNibNamed:@"AboutWindow" owner:self]) { NSLog(@"Failed to load AboutWindow.nib"); NSBeep(); return; } aboutWindow = [aboutText window]; [aboutText readRTFDFromFile:[[NSBundle mainBundle] pathForResource:@"README" ofType:@"rtf"]]; [aboutText startScrollingWithInitialDelay:1.5]; //Setup the window [aboutWindow setExcludedFromWindowsMenu:YES]; [aboutWindow setMenu:nil]; [aboutWindow center]; } //Show the window [[aboutText window] makeKeyAndOrderFront:nil]; } - (IBAction)openHomepage:(id)sender { [[NSWorkspace sharedWorkspace] openURL: [NSURL URLWithString:@"http://jasarien.com/software"]]; } - (void)dealloc { [sharedInstance release]; [super dealloc]; } @end