// // SCMSubmitDialog.m // SCMMenuExtra // // Created by Michael Bishop on 5/12/11. // Copyright 2011 Numerical Garden LLC. All rights reserved. // #import "SCMSubmitDialog.h" @implementation SCMSubmitDialog @synthesize filepath,submitter; - (id)initWithWindow:(NSWindow *)window { if ((self = [super initWithWindow:window]) == nil) return nil; return self; } - (void)dealloc { self.filepath = nil; self.submitter = nil; [super dealloc]; } - (void)windowDidLoad { [super windowDidLoad]; // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. [[self window] setLevel:NSFloatingWindowLevel]; [descriptionTextView setFont:[NSFont userFixedPitchFontOfSize:12.0]]; } -(void)textDidChange:(NSNotification*)notification { [descriptionTextView setFont:[NSFont userFixedPitchFontOfSize:12.0]]; } -(IBAction)submit:(id)sender { [self.submitter submitFile:self.filepath withDescription:descriptionTextView.string completionBlock:^(NSError * error) { if ( error ) { [self presentError:error]; } else { [self close]; descriptionTextView.string = @""; } }]; } -(NSString*)windowNibName { return @"SCMSubmitDialog"; } +(NSSet*)keysForValuesAffectingFilename { return [NSSet setWithObject:@"filepath"]; } -(NSString*)filename { return [self.filepath lastPathComponent]; } @end