=================================================================== RCS file: /home/cvs/OpenXM/src/cfep/MyDocument.m,v retrieving revision 1.6 retrieving revision 1.13 diff -u -p -r1.6 -r1.13 --- OpenXM/src/cfep/MyDocument.m 2006/03/12 07:09:51 1.6 +++ OpenXM/src/cfep/MyDocument.m 2016/10/07 05:13:42 1.13 @@ -74,6 +74,11 @@ static NSMenuItem *menuItemPrettyPrint = nil; // pret [self addMenuExec]; // adding the execution menu. [textViewIn setAllowsUndo:YES]; if ([textViewIn isContinuousSpellCheckingEnabled]) [textViewIn toggleContinuousSpellChecking: self]; // Turn off the spell checking. + if ([textViewIn isAutomaticQuoteSubstitutionEnabled]) [textViewIn toggleAutomaticQuoteSubstitution: self]; // Turn off the smart quote. + if ([MyEnvironment isX11Installed] != 1) + [self messageDialog: NSLocalizedString(@"XQuartz(X11) is not installed and cfep/asir will not run properly. To install it, visit http://www.xquartz.org.",nil) with: 0]; +// if ([MyEnvironment isGccInstalled] != 1) +// [self messageDialog: NSLocalizedString(@"gcc is not installed. To install it, insert MacOS DVD1 and open Xcode Tools->XcodeTools.mpkg",nil) with: 0]; [self sayTheMessageAboutX]; [self initAux]; } @@ -152,7 +157,7 @@ static NSMenuItem *menuItemPrettyPrint = nil; // pret [self openMyModel: myEnvironment ]; [MyOpenGLController initMyOpenGLController]; // For the second execution, it will do nothing. } --(int) getMyDocumentKey { return myDocumentKey; } +-(NSString *) getMyDocumentKey { return myDocumentKey; } -(id) openMyModel: (MyEnvironment *) myEnvironment { [myEnvironment showForDebug]; // for debug. @@ -167,7 +172,7 @@ static NSMenuItem *menuItemPrettyPrint = nil; // pret [peerEndEvaluteMark retain]; [self stopIndicator]; - if (NoEngine && (!restartMode)) { task = nil; return; } + if (NoEngine && (!restartMode)) { task = nil; return self; } // Initialization to call /bin/bash outboundPipe = [NSPipe pipe]; // since autorelease is called in pipe. @@ -244,12 +249,27 @@ static NSMenuItem *menuItemPrettyPrint = nil; // pret -(void) sayTheMessageAboutX { NSLog(@"myDocumentSaidTheMessageAboutX=%d\n",myDocumentSaidTheMessageAboutX); if (!myDocumentSaidTheMessageAboutX) { - if ([MyEnvironment checkX] != 1) + // [[NSWorkspace sharedWorkspace] launchApplication: @"Console"]; // check if it works for apps in Utilities + if ([MyEnvironment checkX] != 1) { // [self messageDialog: // NSLocalizedString(@"A few commands (plot, ...) cannot be used, because X11 is not running.",nil) with: 0]; [self changeOutputCounterFieldWithString: [NSLocalizedString(@"Output mini-view: ",nil) stringByAppendingString: - NSLocalizedString(@"A few commands (plot, ...) cannot be used, because X11 is not running.",nil)]]; + NSLocalizedString(@"Starting XQuartz(X11). Please wait.",nil)]]; + if ([[NSWorkspace sharedWorkspace] launchApplication: @"XQuartz"]) { + NSLog(@"Starting XQuartz.\n"); + }else{ + NSLog(@"Starting XQuartz failed.\n"); + [self messageDialog: + NSLocalizedString(@"Starting XQuartz(X11) failed. A few commands (plot, ...) cannot be used, because X11 is not running.",nil) with: 0]; + } + while ([MyEnvironment checkX]!=1) { + sleep(1); + } + [self changeOutputCounterFieldWithString: + [NSLocalizedString(@"Output mini-view: ",nil) stringByAppendingString: + NSLocalizedString(@"Started XQuartz(X11)",nil)]]; + } myDocumentSaidTheMessageAboutX = 1; } } @@ -1046,7 +1066,7 @@ int debugInbound = 0; return -1; } gid = [[a objectAtIndex: 0] intValue]; - if ([[a objectAtIndex: 1] hasPrefix: @"meta"]) {[self openGLMeta: [a objectAtIndex: 1] to: gid]; return; } + if ([[a objectAtIndex: 1] hasPrefix: @"meta"]) {[self openGLMeta: [a objectAtIndex: 1] to: gid]; return 0; } [MyOpenGLController addOglComm: [a objectAtIndex: 1] to: gid from: self]; return 0; } @@ -1123,7 +1143,7 @@ int debugInbound = 0; // NSLog(@"%@",a); if ([[a objectAtIndex: 0] hasPrefix: @"notAvailable"]) { [self messageDialog: - NSLocalizedString(@"Typeset the output by TeX is not available. latex, dvips, and pstoimg must be installed.",nil) with: 0]; + NSLocalizedString(@"Typeset the output by TeX is not available. latex and dvipng must be installed.",nil) with: 0]; prettyPrint = 1; [self setPrettyPrint: nil]; return; } else if ([[a objectAtIndex: 0] compare: @"showFile"] == NSOrderedSame) {