+}
+
+void frmMain::DisplayHelpBrowser()
+{
+ /* Replace with modern API when deployment target is 10.13+ in the future */
+
+ /* Replace with NSWorkspace */
+
+ NSString *language = [[NSLocale currentLocale] localeIdentifier];
+ NSString *documentationFilename = [NSString stringWithFormat:@"Documentation (%@)", language];
+ NSString *helpBrowserDocumentationPath = [[NSBundle mainBundle] pathForResource:documentationFilename ofType:@"fodt"];
+
+ if (helpBrowserDocumentationPath == nil)
+ {
+ helpBrowserDocumentationPath = [[NSBundle mainBundle] pathForResource:@"Documentation (en_GB)" ofType:@"fodt"];
+ }
+
+ NSURL *helpBrowserExecutableURL = [[NSBundle mainBundle] URLForResource:@"ODTHelpBrowser" withExtension:@"app"];
+
+ NSArray *args = [NSArray arrayWithObjects:@"-d", helpBrowserDocumentationPath, nil];
+ NSDictionary *helpBrowserArguments = [NSDictionary dictionaryWithObject:args
+ forKey:NSWorkspaceLaunchConfigurationArguments];
+
+ helpBrowserProcess = [[NSWorkspace sharedWorkspace] launchApplicationAtURL:helpBrowserExecutableURL options:NSWorkspaceLaunchAndHide configuration:helpBrowserArguments error: nil];
+
+ [helpBrowserProcess activateWithOptions:(NSApplicationActivateAllWindows | NSApplicationActivateIgnoringOtherApps)];
+}
+
+void frmMain::TerminateHelpBrowserProcess()
+{
+ if (helpBrowserProcess != nil)
+ {
+ [helpBrowserProcess terminate];
+ }
+}