=================================================================== RCS file: /home/cvs/OpenXM/src/cfep/MyDocument.m,v retrieving revision 1.9 retrieving revision 1.12 diff -u -p -r1.9 -r1.12 --- OpenXM/src/cfep/MyDocument.m 2011/07/15 22:57:34 1.9 +++ OpenXM/src/cfep/MyDocument.m 2016/10/07 02:02:31 1.12 @@ -74,8 +74,9 @@ 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(@"X11 is not installed. To install it, insert MacOS DVD1 and open Optional install->Applications->X11",nil) with: 0]; + [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]; @@ -156,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. @@ -171,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. @@ -248,12 +249,21 @@ 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)",nil)]]; + if ([[NSWorkspace sharedWorkspace] launchApplication: @"XQuartz"]) { + NSLog(@"Started 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]; + } + } myDocumentSaidTheMessageAboutX = 1; } } @@ -1050,7 +1060,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; }