From 0ba592d6f48427be2ff1e353aab96b9f9c1ee271 Mon Sep 17 00:00:00 2001 From: nigel <> Date: Wed, 26 Mar 2003 00:20:54 +0000 Subject: [PATCH] Extra help menu action (for HowTo) --- BasiliskII/src/MacOSX/Controller.h | 1 + BasiliskII/src/MacOSX/Controller.mm | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/BasiliskII/src/MacOSX/Controller.h b/BasiliskII/src/MacOSX/Controller.h index 0f03e96b..31998d12 100644 --- a/BasiliskII/src/MacOSX/Controller.h +++ b/BasiliskII/src/MacOSX/Controller.h @@ -41,6 +41,7 @@ type: (NSEventType)type; +- (IBAction) HelpHowTo: (id)sender; - (IBAction) HelpToDo: (id)sender; - (IBAction) HelpVersions: (id)sender; diff --git a/BasiliskII/src/MacOSX/Controller.mm b/BasiliskII/src/MacOSX/Controller.mm index ca8b775a..383d560f 100644 --- a/BasiliskII/src/MacOSX/Controller.mm +++ b/BasiliskII/src/MacOSX/Controller.mm @@ -258,6 +258,19 @@ // Methods to display documentation: +- (IBAction) HelpHowTo: (id)sender +{ + NSString *path = [[NSBundle mainBundle] pathForResource: @"HowTo" + ofType: @"html"]; + + if ( ! path ) + InfoSheet(@"Cannot find HowTo.html", [theEmulator window]); + else + if ( ! [[NSWorkspace sharedWorkspace] openFile: path + withApplication: @"TextEdit"] ) + InfoSheet(@"Cannot open HowTo.html with TextEdit", [theEmulator window]); +} + - (IBAction) HelpToDo: (id)sender { NSString *path = [[NSBundle mainBundle] pathForResource: @"ToDo" @@ -281,7 +294,8 @@ else if ( ! [[NSWorkspace sharedWorkspace] openFile: path withApplication: @"TextEdit"] ) - InfoSheet(@"Cannot open Versions.html with TextEdit", [theEmulator window]); + InfoSheet(@"Cannot open Versions.html with TextEdit", + [theEmulator window]); }