From 44fc6c6fc022b7262175a71a981ddc3969132ed5 Mon Sep 17 00:00:00 2001 From: Johan Paulsson Date: Tue, 26 Feb 2013 17:07:05 +0000 Subject: osx gui parsing errors --- tikzit/src/osx/TikzSourceController.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tikzit/src/osx/TikzSourceController.m') diff --git a/tikzit/src/osx/TikzSourceController.m b/tikzit/src/osx/TikzSourceController.m index 6d1580c..428c6ba 100644 --- a/tikzit/src/osx/TikzSourceController.m +++ b/tikzit/src/osx/TikzSourceController.m @@ -28,6 +28,7 @@ @synthesize graphicsView, sourceView, source, status; @synthesize documentUndoManager, tikzChanged; +@synthesize errorMessage, errorNotification; - (void)endEditing { NSResponder *res = [[sourceView window] firstResponder]; @@ -125,6 +126,10 @@ if ([graphicsView enabled]) [self updateTikzFromGraph]; } +- (IBAction)closeParseError:(id)pId{ + [errorNotification setHidden:TRUE]; +} + - (void)textDidBeginEditing:(NSNotification *)notification { if ([graphicsView enabled]) { [graphicsView setEnabled:NO]; @@ -169,9 +174,19 @@ [status setStringValue:@"success"]; [status setTextColor:successColor]; + + [errorNotification setHidden:TRUE]; } else { [status setStringValue:@"parse error"]; [status setTextColor:failedColor]; + + + NSLog(@"Parse error: %@",[assembler lastError]); + + NSError *e = [assembler lastError]; + + [errorMessage setStringValue:[[[assembler lastError] userInfo] valueForKey:NSLocalizedDescriptionKey]]; + [errorNotification setHidden:FALSE]; } } } -- cgit v1.2.3