From 5a9ec56a21ca0b01fb96b1070cebd1bfa3ebd1e8 Mon Sep 17 00:00:00 2001 From: nigel <> Date: Fri, 10 Jan 2003 23:01:48 +0000 Subject: [PATCH] Extra methods for new Help menu items --- BasiliskII/src/MacOSX/Controller.h | 4 ++++ BasiliskII/src/MacOSX/Controller.mm | 33 +++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/BasiliskII/src/MacOSX/Controller.h b/BasiliskII/src/MacOSX/Controller.h index 0073bd8b..0f03e96b 100644 --- a/BasiliskII/src/MacOSX/Controller.h +++ b/BasiliskII/src/MacOSX/Controller.h @@ -40,6 +40,10 @@ - (void) dispatchEvent: (NSEvent *)event type: (NSEventType)type; + +- (IBAction) HelpToDo: (id)sender; +- (IBAction) HelpVersions: (id)sender; + #ifdef ENABLE_MULTIPLE - (IBAction) NewEmulator: (id)sender; - (IBAction) PauseAll: (id)sender; diff --git a/BasiliskII/src/MacOSX/Controller.mm b/BasiliskII/src/MacOSX/Controller.mm index cabaaba7..9a4457dd 100644 --- a/BasiliskII/src/MacOSX/Controller.mm +++ b/BasiliskII/src/MacOSX/Controller.mm @@ -33,6 +33,7 @@ #define DEBUG 0 #import +#import "misc_macosx.h" #import "video_macosx.h" // @@ -248,6 +249,38 @@ [super sendEvent: event]; } + +// Methods to display documentation: + +- (IBAction) HelpToDo: (id)sender +{ + NSString *path = [[NSBundle mainBundle] pathForResource: @"ToDo" + ofType: @"html"]; + + if ( ! path ) + InfoSheet(@"Cannot find ToDo.html", [theEmulator window]); + else + if ( ! [[NSWorkspace sharedWorkspace] openFile: path + withApplication: @"TextEdit"] ) + InfoSheet(@"Cannot open ToDo.html with TextEdit", [theEmulator window]); +} + +- (IBAction) HelpVersions: (id)sender +{ + NSString *path = [[NSBundle mainBundle] pathForResource: @"Versions" + ofType: @"html"]; + + if ( ! path ) + InfoSheet(@"Cannot find Versions.html", [theEmulator window]); + else + if ( ! [[NSWorkspace sharedWorkspace] openFile: path + withApplication: @"TextEdit"] ) + InfoSheet(@"Cannot open Versions.html with TextEdit", [theEmulator window]); +} + + +// Menu items which for managing more than one window + #ifdef ENABLE_MULTIPLE - (IBAction) NewEmulator: (id)sender