diff --git a/LiveDiag.xcodeproj/project.pbxproj b/LiveDiag.xcodeproj/project.pbxproj index 14e06d1..e12134c 100644 --- a/LiveDiag.xcodeproj/project.pbxproj +++ b/LiveDiag.xcodeproj/project.pbxproj @@ -17,6 +17,9 @@ 0A41C46817A6B885008F9FEA /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A41C46717A6B885008F9FEA /* WebKit.framework */; }; 0A4A5F3517A7A54800BE1CF9 /* NSString+Count.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A4A5F3417A7A54800BE1CF9 /* NSString+Count.m */; }; 0A675C5617A88BBC00EDEB47 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 0A675C5517A88BBC00EDEB47 /* Icon.icns */; }; + 0A8087DA17ABF742007CA399 /* LDPreferencesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A8087D917ABF742007CA399 /* LDPreferencesViewController.m */; }; + 0AA098F817AFEB4D0011E472 /* LDAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AA098F717AFEB4D0011E472 /* LDAppDelegate.m */; }; + 0AA098FB17AFF6A20011E472 /* LDUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AA098FA17AFF6A20011E472 /* LDUtils.m */; }; 0AEF9BD917A743B600A2A3B1 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0AEF9BD617A743B600A2A3B1 /* Localizable.strings */; }; 0AEF9BDA17A743CB00A2A3B1 /* jquery-2.0.3.min.js in Resources */ = {isa = PBXBuildFile; fileRef = 0AEF9BD517A743B600A2A3B1 /* jquery-2.0.3.min.js */; }; 0AEF9BE017A751D000A2A3B1 /* application.css in Resources */ = {isa = PBXBuildFile; fileRef = 0AEF9BDF17A751D000A2A3B1 /* application.css */; }; @@ -43,6 +46,12 @@ 0A4A5F3317A7A54800BE1CF9 /* NSString+Count.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+Count.h"; sourceTree = ""; }; 0A4A5F3417A7A54800BE1CF9 /* NSString+Count.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+Count.m"; sourceTree = ""; }; 0A675C5517A88BBC00EDEB47 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = ""; }; + 0A8087D817ABF742007CA399 /* LDPreferencesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LDPreferencesViewController.h; sourceTree = ""; }; + 0A8087D917ABF742007CA399 /* LDPreferencesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LDPreferencesViewController.m; sourceTree = ""; }; + 0AA098F617AFEB4D0011E472 /* LDAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LDAppDelegate.h; sourceTree = ""; }; + 0AA098F717AFEB4D0011E472 /* LDAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LDAppDelegate.m; sourceTree = ""; }; + 0AA098F917AFF6A20011E472 /* LDUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LDUtils.h; sourceTree = ""; }; + 0AA098FA17AFF6A20011E472 /* LDUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LDUtils.m; sourceTree = ""; }; 0AEF9BD517A743B600A2A3B1 /* jquery-2.0.3.min.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "jquery-2.0.3.min.js"; sourceTree = ""; }; 0AEF9BD617A743B600A2A3B1 /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = ""; }; 0AEF9BDF17A751D000A2A3B1 /* application.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = application.css; sourceTree = ""; }; @@ -107,8 +116,12 @@ 0A11A98117A6B50800E94748 /* LiveDiag */ = { isa = PBXGroup; children = ( + 0AA098F617AFEB4D0011E472 /* LDAppDelegate.h */, + 0AA098F717AFEB4D0011E472 /* LDAppDelegate.m */, 0A11A98D17A6B50800E94748 /* LDDocument.h */, 0A11A98E17A6B50800E94748 /* LDDocument.m */, + 0A8087D817ABF742007CA399 /* LDPreferencesViewController.h */, + 0A8087D917ABF742007CA399 /* LDPreferencesViewController.m */, 0A11A99017A6B50800E94748 /* LDDocument.xib */, 0A11A99317A6B50800E94748 /* MainMenu.xib */, 0A4A5F3217A7A54800BE1CF9 /* Library */, @@ -139,6 +152,8 @@ children = ( 0A4A5F3317A7A54800BE1CF9 /* NSString+Count.h */, 0A4A5F3417A7A54800BE1CF9 /* NSString+Count.m */, + 0AA098F917AFF6A20011E472 /* LDUtils.h */, + 0AA098FA17AFF6A20011E472 /* LDUtils.m */, ); path = Library; sourceTree = ""; @@ -252,6 +267,9 @@ 0A11A98817A6B50800E94748 /* main.m in Sources */, 0A11A98F17A6B50800E94748 /* LDDocument.m in Sources */, 0A4A5F3517A7A54800BE1CF9 /* NSString+Count.m in Sources */, + 0A8087DA17ABF742007CA399 /* LDPreferencesViewController.m in Sources */, + 0AA098F817AFEB4D0011E472 /* LDAppDelegate.m in Sources */, + 0AA098FB17AFF6A20011E472 /* LDUtils.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/LiveDiag/LDAppDelegate.h b/LiveDiag/LDAppDelegate.h new file mode 100644 index 0000000..8560d51 --- /dev/null +++ b/LiveDiag/LDAppDelegate.h @@ -0,0 +1,18 @@ +// +// LDAppDelegate.h +// LiveDiag +// +// Created by Taichiro Yoshida on 2013/08/05. +// Copyright (c) 2013年 dataich.com. All rights reserved. +// + +#import + +@interface LDAppDelegate : NSObject + +@property (unsafe_unretained) IBOutlet NSWindow *windowPreferences; + +- (IBAction)showPreferences:(id)sender; +- (void)showPreferences; + +@end diff --git a/LiveDiag/LDAppDelegate.m b/LiveDiag/LDAppDelegate.m new file mode 100644 index 0000000..43775b1 --- /dev/null +++ b/LiveDiag/LDAppDelegate.m @@ -0,0 +1,36 @@ +// +// LDAppDelegate.m +// LiveDiag +// +// Created by Taichiro Yoshida on 2013/08/05. +// Copyright (c) 2013年 dataich.com. All rights reserved. +// + +#import "LDAppDelegate.h" +#import "LDUtils.h" + +@implementation LDAppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification +{ + //check path settings, any commands + if([LDUtils pathTo:@"blockdiag"] == nil || [LDUtils pathTo:@"seqdiag"] == nil || [LDUtils pathTo:@"actdiag"] == nil || [LDUtils pathTo:@"nwdiag"] == nil || [LDUtils pathTo:@"rackdiag"] == nil) { + NSAlert *alert = [NSAlert alertWithMessageText:@"Path Setting" defaultButton:@"OK" alternateButton:@"Cancel" otherButton:nil informativeTextWithFormat:@"Please specify a path to blockdiag and the other."]; + if ([alert runModal] == NSAlertDefaultReturn) { + LDAppDelegate *delegate = (LDAppDelegate *)[[NSApplication sharedApplication] delegate]; + [delegate showPreferences]; + } + } +} + +- (IBAction)showPreferences:(id)sender { + [self showPreferences]; +} + +- (void)showPreferences { + [NSApp runModalForWindow:self.windowPreferences]; + [self.windowPreferences orderOut:self]; +// [self.windowPreferences makeKeyAndOrderFront:self]; +} + +@end diff --git a/LiveDiag/LDDocument.h b/LiveDiag/LDDocument.h index 1019a52..8121603 100644 --- a/LiveDiag/LDDocument.h +++ b/LiveDiag/LDDocument.h @@ -8,9 +8,11 @@ #import #import +#import "LDPreferencesViewController.h" @interface LDDocument : NSDocument @property (unsafe_unretained) IBOutlet NSTextView *textView; @property (weak) IBOutlet WebView *webView; +@property (strong) LDPreferencesViewController *preferencesController; @end diff --git a/LiveDiag/LDDocument.m b/LiveDiag/LDDocument.m index 14de8b4..47efac9 100644 --- a/LiveDiag/LDDocument.m +++ b/LiveDiag/LDDocument.m @@ -7,6 +7,8 @@ // #import "LDDocument.h" +#import "LDAppDelegate.h" +#import "LDUtils.h" #import "NSString+Count.h" #import @@ -29,7 +31,7 @@ - (void)windowControllerDidLoadNib:(NSWindowController *)aController { [super windowControllerDidLoadNib:aController]; self.textView.font = [NSFont userFixedPitchFontOfSize:12]; - + NSURL *fileURL = [self fileURL]; if (!fileURL) { return; @@ -83,7 +85,7 @@ -(void)textViewContentToWebView if([markDown countOfString:@"{"] == [markDown countOfString:@"}"]) { //loop for parts of diag NSError *error; - NSRegularExpression *re = [NSRegularExpression regularExpressionWithPattern:@"^(blockdiag|seqdiag|actdiag|nwdiag|)(\\s|)\\{.*?^\\}" options:NSRegularExpressionDotMatchesLineSeparators|NSRegularExpressionAnchorsMatchLines error:&error]; + NSRegularExpression *re = [NSRegularExpression regularExpressionWithPattern:@"^(blockdiag|seqdiag|actdiag|nwdiag|rackdiag|)(\\s|)\\{.*?^\\}" options:NSRegularExpressionDotMatchesLineSeparators|NSRegularExpressionAnchorsMatchLines error:&error]; NSArray *matches; while ([matches = [re matchesInString:markDown options:0 range:NSMakeRange(0, markDown.length)] count] > 0) { NSTextCheckingResult *match = matches[0]; @@ -100,6 +102,7 @@ -(void)textViewContentToWebView if(!command || [command isEqualToString:@""]) { command = @"blockdiag"; } + command = [LDUtils pathTo:command]; //don't want to use image cache, so create filename by arc4random NSString *outPath = [NSString stringWithFormat:@"%@%u.png", NSTemporaryDirectory(), arc4random()]; @@ -118,10 +121,10 @@ -(void)textViewContentToWebView // after task terminated, add 'src' attribute to from 'prapareSrc' attribute using jQuery // to pinpoint a , use process identifier echo.terminationHandler = ^(NSTask *task) { - dispatch_async(dispatch_get_main_queue(), ^{ - NSString *script = [NSString stringWithFormat:@"$('#%d').attr('src', $('#%d').attr('prepareSrc'));", pid, pid]; - [weakSelf.webView stringByEvaluatingJavaScriptFromString:script]; - }); + dispatch_async(dispatch_get_main_queue(), ^{ + NSString *script = [NSString stringWithFormat:@"$('#%d').attr('src', $('#%d').attr('prepareSrc'));", pid, pid]; + [weakSelf.webView stringByEvaluatingJavaScriptFromString:script]; + }); }; }; } diff --git a/LiveDiag/LDPreferencesViewController.h b/LiveDiag/LDPreferencesViewController.h new file mode 100644 index 0000000..12dc4b4 --- /dev/null +++ b/LiveDiag/LDPreferencesViewController.h @@ -0,0 +1,24 @@ +// +// LDPreferencesViewController.h +// LiveDiag +// +// Created by Taichiro Yoshida on 2013/08/02. +// Copyright (c) 2013 dataich.com. All rights reserved. +// + +#import + +@interface LDPreferencesViewController : NSViewController + +@property (weak) IBOutlet NSTextField *textBlockdiag; +@property (weak) IBOutlet NSTextField *textSeqdiag; +@property (weak) IBOutlet NSTextField *textActdiag; +@property (weak) IBOutlet NSTextField *textNwdiag; +@property (weak) IBOutlet NSTextField *textRackdiag; +@property (weak) IBOutlet NSUserDefaultsController *defaultsController; +@property (unsafe_unretained) IBOutlet NSWindow *windowPreferences; + +- (IBAction)browse:(NSButton *)sender; +- (IBAction)save:(id)sender; + +@end diff --git a/LiveDiag/LDPreferencesViewController.m b/LiveDiag/LDPreferencesViewController.m new file mode 100644 index 0000000..12b4aeb --- /dev/null +++ b/LiveDiag/LDPreferencesViewController.m @@ -0,0 +1,68 @@ +// +// LDPreferencesViewController.m +// LiveDiag +// +// Created by Taichiro Yoshida on 2013/08/02. +// Copyright (c) 2013 dataich.com. All rights reserved. +// + +#import "LDPreferencesViewController.h" + +@interface LDPreferencesViewController () + +@end + +@implementation LDPreferencesViewController + +/** + * save user preferences to NSUserDefaultsController + * I bind NSTextField to NSUserDefaultsController on xib, but it's saved only when the field loses focus... + * Provisionally I create 'save' action which sent from 'OK' button. + */ +- (IBAction)save:(id)sender { + [self setValueToDefauls:self.textBlockdiag.stringValue forKeyPath:@"values.path_blockdiag"]; + [self setValueToDefauls:self.textSeqdiag.stringValue forKeyPath:@"values.path_seqdiag"]; + [self setValueToDefauls:self.textActdiag.stringValue forKeyPath:@"values.path_actdiag"]; + [self setValueToDefauls:self.textNwdiag.stringValue forKeyPath:@"values.path_nwdiag"]; + [self setValueToDefauls:self.textRackdiag.stringValue forKeyPath:@"values.path_rackdiag"]; + + [NSApp stopModalWithCode:0]; +} + +- (void)setValueToDefauls:(NSString *)value forKeyPath:(NSString *)forKeyPath{ + if(value == nil || [value isEqualToString:@""]) { + [self.defaultsController setValue:nil forKeyPath:forKeyPath]; + } else { + [self.defaultsController setValue:value forKeyPath:forKeyPath]; + } +} + +- (IBAction)browse:(NSButton *)sender { + NSOpenPanel *panel = [NSOpenPanel openPanel]; + [panel beginSheetModalForWindow:self.view.window completionHandler:^(NSInteger result) { + if(result == NSFileHandlingPanelOKButton) { + NSString *path = [[panel URL] path]; + switch (sender.tag) { + case 0: + self.textBlockdiag.stringValue = path; + break; + case 1: + self.textSeqdiag.stringValue = path; + break; + case 2: + self.textActdiag.stringValue = path; + break; + case 3: + self.textNwdiag.stringValue = path; + break; + case 4: + self.textRackdiag.stringValue = path; + break; + default: + break; + } + } + }]; +} + +@end diff --git a/LiveDiag/Library/LDUtils.h b/LiveDiag/Library/LDUtils.h new file mode 100644 index 0000000..7e52b21 --- /dev/null +++ b/LiveDiag/Library/LDUtils.h @@ -0,0 +1,15 @@ +// +// LDUtils.h +// LiveDiag +// +// Created by Taichiro Yoshida on 2013/08/06. +// Copyright (c) 2013 dataich.com. All rights reserved. +// + +#import + +@interface LDUtils : NSObject + ++ (NSString *)pathTo:(NSString *)command; + +@end diff --git a/LiveDiag/Library/LDUtils.m b/LiveDiag/Library/LDUtils.m new file mode 100644 index 0000000..9d2ac03 --- /dev/null +++ b/LiveDiag/Library/LDUtils.m @@ -0,0 +1,18 @@ +// +// LDUtils.m +// LiveDiag +// +// Created by Taichiro Yoshida on 2013/08/06. +// Copyright (c) 2013 dataich.com. All rights reserved. +// + +#import "LDUtils.h" + +@implementation LDUtils + ++ (NSString *)pathTo:(NSString *)command { + NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; + return [userDefaults stringForKey:[NSString stringWithFormat:@"path_%@", command]]; +} + +@end diff --git a/LiveDiag/LiveDiag-Info.plist b/LiveDiag/LiveDiag-Info.plist index 57c7626..419265a 100644 --- a/LiveDiag/LiveDiag-Info.plist +++ b/LiveDiag/LiveDiag-Info.plist @@ -38,7 +38,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + 1.1.0 CFBundleSignature ???? CFBundleVersion diff --git a/LiveDiag/en.lproj/MainMenu.xib b/LiveDiag/en.lproj/MainMenu.xib index 482deca..9f7e698 100644 --- a/LiveDiag/en.lproj/MainMenu.xib +++ b/LiveDiag/en.lproj/MainMenu.xib @@ -11,9 +11,19 @@ 3084 + IBNSLayoutConstraint + NSBox + NSButton + NSButtonCell NSCustomObject NSMenu NSMenuItem + NSTextField + NSTextFieldCell + NSUserDefaultsController + NSView + NSViewController + NSWindowTemplate com.apple.InterfaceBuilder.CocoaPlugin @@ -813,6 +823,482 @@ NSFontManager + + LDAppDelegate + + + 1 + 2 + {{131, 159}, {655, 268}} + 1685586944 + LiveDiag + NSWindow + + + + + 256 + + + + 12 + + + + 274 + + + + 268 + {{510, 137}, {97, 32}} + + + + _NS:9 + YES + + 67108864 + 134217728 + Browse... + + LucidaGrande + 13 + 1044 + + _NS:9 + + -2038284288 + 129 + + + 200 + 25 + + NO + + + + 268 + {{510, 105}, {97, 32}} + + + + _NS:9 + 1 + YES + + 67108864 + 134217728 + Browse... + + _NS:9 + + -2038284288 + 129 + + + 200 + 25 + + NO + + + + 268 + {{510, 73}, {97, 32}} + + + + _NS:9 + 2 + YES + + 67108864 + 134217728 + Browse... + + _NS:9 + + -2038284288 + 129 + + + 200 + 25 + + NO + + + + 268 + {{510, 40}, {97, 32}} + + + + _NS:9 + 3 + YES + + 67108864 + 134217728 + Browse... + + _NS:9 + + -2038284288 + 129 + + + 200 + 25 + + NO + + + + 268 + {{15, 146}, {75, 17}} + + + + _NS:1535 + YES + + 68157504 + 71304192 + blockdiag: + + _NS:1535 + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + NO + + + + 268 + {{15, 114}, {75, 17}} + + + + _NS:1535 + YES + + 68157504 + 71304192 + seqdiag: + + _NS:1535 + + + + + NO + + + + 268 + {{15, 82}, {75, 17}} + + + + _NS:1535 + YES + + 68157504 + 71304192 + actdiag: + + _NS:1535 + + + + + NO + + + + 268 + {{15, 49}, {75, 17}} + + + + _NS:1535 + YES + + 68157504 + 71304192 + nwdiag: + + _NS:1535 + + + + + NO + + + + 268 + {{95, 143}, {413, 22}} + + + + _NS:9 + YES + + -1804074943 + 272630784 + + + + _NS:9 + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + NO + + + + 268 + {{95, 111}, {413, 22}} + + + + _NS:9 + YES + + -1804599231 + 272630784 + + + _NS:9 + + YES + + + + NO + + + + 268 + {{95, 79}, {413, 22}} + + + + _NS:9 + YES + + -1804599231 + 272630784 + + + _NS:9 + + YES + + + + NO + + + + 268 + {{95, 46}, {413, 22}} + + + + _NS:9 + YES + + -1804599231 + 272630784 + + + _NS:9 + + YES + + + + NO + + + + 268 + {{510, 8}, {97, 32}} + + + + _NS:9 + 4 + YES + + 67108864 + 134217728 + Browse... + + _NS:9 + + -2038284288 + 129 + + + 200 + 25 + + NO + + + + 268 + {{15, 19}, {75, 17}} + + + + _NS:1535 + YES + + 68157504 + 71304192 + rackdiag: + + _NS:1535 + + + + + NO + + + + 268 + {{95, 14}, {413, 22}} + + + + _NS:9 + YES + + -1804599231 + 272630784 + + + _NS:9 + + YES + + + + NO + + + {{1, 1}, {619, 175}} + + + + _NS:11 + + + {{17, 57}, {621, 191}} + + + + _NS:9 + {0, 0} + + 67108864 + 0 + Path + + LucidaGrande + 11 + 3100 + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + + 1 + 0 + 2 + NO + + + + 268 + {{528, 13}, {97, 32}} + + + _NS:9 + YES + + 67108864 + 134217728 + OK + + _NS:9 + + -2038284288 + 129 + + DQ + 200 + 25 + + NO + + + {655, 268} + + + + _NS:20 + + {{0, 0}, {1440, 878}} + {10000000000000, 10000000000000} + YES + + + + YES + @@ -832,6 +1318,14 @@ 142 + + + delegate + + + + 733 + performMiniaturize: @@ -1208,6 +1702,236 @@ 533 + + + initialFirstResponder + + + + 774 + + + + value: values.path_blockdiag + + + + + + value: values.path_blockdiag + value + values.path_blockdiag + + + + + + + 2 + + + 751 + + + + value: values.path_seqdiag + + + + + + value: values.path_seqdiag + value + values.path_seqdiag + 2 + + + 742 + + + + value: values.path_actdiag + + + + + + value: values.path_actdiag + value + values.path_actdiag + 2 + + + 743 + + + + value: values.path_nwdiag + + + + + + value: values.path_nwdiag + value + values.path_nwdiag + 2 + + + 745 + + + + view + + + + 712 + + + + browse: + + + + 713 + + + + textBlockdiag + + + + 715 + + + + textSeqdiag + + + + 716 + + + + textActdiag + + + + 717 + + + + textNwdiag + + + + 718 + + + + defaultsController + + + + 734 + + + + save + + + + 778 + + + + save: + + + + 779 + + + + windowPreferences + + + + 782 + + + + browse: + + + + 783 + + + + browse: + + + + 784 + + + + browse: + + + + 785 + + + + textRackdiag + + + + 824 + + + + browse: + + + + 825 + + + + windowPreferences + + + + 731 + + + + showPreferences: + + + + 732 + + + + value: values.path_rackdiag + + + + + + value: values.path_rackdiag + value + values.path_rackdiag + 2 + + + 826 + @@ -1819,6 +2543,1255 @@ + + 719 + + + + + 711 + + + + + 534 + + + + + + + + 535 + + + + + 4 + 0 + + 4 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 6 + 0 + + 6 + 1 + + 36 + + 1000 + + 3 + 9 + 3 + + + + 3 + 0 + + 4 + 1 + + 20 + + 1000 + + 6 + 24 + 3 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 9 + 40 + 3 + + + + 3 + 0 + + 3 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + + + + + 562 + + + + + 3 + 0 + + 3 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 6 + 0 + + 6 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 3 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 3 + 0 + + 4 + 1 + + 12 + + 1000 + + 6 + 24 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 6 + 0 + + 6 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + + + + 6 + 0 + + 6 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 3 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 6 + 0 + + 6 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 3 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 6 + 0 + + 6 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 3 + 1 + + 25 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 3 + 0 + + 4 + 1 + + 10 + + 1000 + + 6 + 24 + 3 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 5 + 0 + + 5 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 3 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 3 + 0 + + 4 + 1 + + 10 + + 1000 + + 6 + 24 + 3 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 3 + 0 + + 4 + 1 + + 10 + + 1000 + + 6 + 24 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 3 + 0 + + 3 + 1 + + 25 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + + + + + + + + + + + + + + + + + + + + + 652 + + + + + + + + 653 + + + + + 645 + + + + + + + + 646 + + + + + 638 + + + + + + + + 639 + + + + + 631 + + + + + + + + 632 + + + + + 624 + + + + + + + + 625 + + + + + 617 + + + + + + + + 618 + + + + + 568 + + + + + + + + 569 + + + + + 609 + + + + + + + + 610 + + + + + 600 + + + + + + + + 601 + + + + + 592 + + + + + + + + 593 + + + + + 572 + + + + + + + + 573 + + + + + 576 + + + + + + + + 577 + + + + + 584 + + + + + 585 + + + + + 642 + + + + + 644 + + + + + 649 + + + + + 650 + + + + + 580 + + + + + 587 + + + + + 597 + + + + + 643 + + + + + 659 + + + + + 658 + + + + + 608 + + + + + 651 + + + + + 661 + + + + + 663 + + + + + 656 + + + + + 628 + + + + + 629 + + + + + 630 + + + + + 636 + + + + + 637 + + + + + 570 + + + + + 571 + + + + + 582 + + + + + 621 + + + + + 622 + + + + + 623 + + + + + 563 + + + + + 565 + + + + + 566 + + + + + 730 + + + + + 757 + + + + + + 7 + 0 + + 0 + 1 + + 85 + + 1000 + + 3 + 9 + 1 + + + + + + 758 + + + + + 766 + + + + + 775 + + + + + 776 + + + + + 777 + + + + + 791 + + + + + 792 + + + + + 793 + + + + + 794 + + + + + + + + 795 + + + + + + 7 + 0 + + 0 + 1 + + 69 + + 1000 + + 3 + 9 + 1 + + + + + + 796 + + + + + + + + 797 + + + + + 798 + + + + + 799 + + + + + 802 + + + + + 814 + + + + + 815 + + + + + 817 + + + + + 818 + + + + + 819 + + + + + 820 + + + + + 822 + + + + + 823 + + + @@ -1900,18 +3873,177 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + LDPreferencesViewController + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1919,7 +4051,7 @@ - 533 + 826 @@ -1941,6 +4073,105 @@ + + LDAppDelegate + NSObject + + showPreferences: + id + + + showPreferences: + + showPreferences: + id + + + + windowPreferences + NSWindow + + + windowPreferences + + windowPreferences + NSWindow + + + + IBProjectSource + ./Classes/LDAppDelegate.h + + + + LDPreferencesViewController + NSViewController + + NSButton + id + + + + browse: + NSButton + + + save: + id + + + + NSUserDefaultsController + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + NSWindow + + + + defaultsController + NSUserDefaultsController + + + textActdiag + NSTextField + + + textBlockdiag + NSTextField + + + textNwdiag + NSTextField + + + textRackdiag + NSTextField + + + textSeqdiag + NSTextField + + + windowPreferences + NSWindow + + + + IBProjectSource + ./Classes/LDPreferencesViewController.h + + + + NSLayoutConstraint + NSObject + + IBProjectSource + ./Classes/NSLayoutConstraint.h + + 0 diff --git a/README.md b/README.md index 1e35bf4..3cd78f3 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ LiveDiag ======== -Live Preview App for Markdown+blockdiag(+seqdiag +actdiag +nwdiag) +Live Preview App for Markdown+blockdiag(+seqdiag +actdiag +nwdiag +rackdiag) ![image](Sample/blockdiag.png) ![image](Sample/seqdiag.png) ![image](Sample/actdiag.png) ![image](Sample/nwdiag.png) +![image](Sample/rackdiag.png) + all block code from [blockdiag.com](http://blockdiag.com/). Thanks!! @@ -16,26 +18,15 @@ all block code from [blockdiag.com](http://blockdiag.com/). Thanks!! ## Requirement -- [blockdiag](http://blockdiag.com/ja/blockdiag/introduction.html#id2) (add path to `/usr/bin/blockdiag`) -- [seqdiag](http://blockdiag.com/ja/seqdiag/introduction.html#setup) (add path to `/usr/bin/seqdiag`) -- [actdiag](http://blockdiag.com/ja/actdiag/introduction.html#setup) (add path to `/usr/bin/actdiag`) -- [nwdiag](http://blockdiag.com/ja/nwdiag/introduction.html#setup) (add path to `/usr/bin/nwdiag`) - - **at this time cannot load user $PATH. I'm trying to improve it.** +- [blockdiag](http://blockdiag.com/ja/blockdiag/introduction.html#id2) +- [seqdiag](http://blockdiag.com/ja/seqdiag/introduction.html#setup) +- [actdiag](http://blockdiag.com/ja/actdiag/introduction.html#setup) +- [nwdiag|rackdiag](http://blockdiag.com/ja/nwdiag/introduction.html#setup) ## Installation -1. Install [blockdiag](http://blockdiag.com/ja/blockdiag/introduction.html#macosx-macports), [seqdiag](http://blockdiag.com/ja/seqdiag/introduction.html#setup), [actdiag](http://blockdiag.com/ja/actdiag/introduction.html#setup) and [nwdiag](http://blockdiag.com/ja/nwdiag/introduction.html#setup) - -2. add path to /usr/bin - - ``` - $ sudo ln -s {blockdiag path} /usr/bin/blockdiag - $ sudo ln -s {seqdiag path} /usr/bin/seqdiag - $ sudo ln -s {actdiag path} /usr/bin/actdiag - $ sudo ln -s {nwdiag path} /usr/bin/nwdiag - ``` +1. Install [blockdiag](http://blockdiag.com/ja/blockdiag/introduction.html#macosx-macports), [seqdiag](http://blockdiag.com/ja/seqdiag/introduction.html#setup), [actdiag](http://blockdiag.com/ja/actdiag/introduction.html#setup) and [nwdiag|rackdiag](http://blockdiag.com/ja/nwdiag/introduction.html#setup) -3. Download LiveDiag.app and place it to /Applications +2. Download [LiveDiag.app](https://github.com/dataich/LiveDiag/releases/download/1.0.0/LiveDiag.app.zip) and place it to /Applications ## Release @@ -49,6 +40,7 @@ all block code from [blockdiag.com](http://blockdiag.com/). Thanks!! - seqdiag - actdiag - nwdiag + - rackdiag - printing ## Give me your feedback diff --git a/Sample/rackdiag.png b/Sample/rackdiag.png new file mode 100644 index 0000000..1a658bf Binary files /dev/null and b/Sample/rackdiag.png differ