1.4 Beta 2
#####################
- Fix: After clicking on a stack frame with a virtual file, the debugger front end would hang
-- Fix: Crash on clicking "Install & Relaunch" from Sparkle.
+- Fix: Crash on clicking "Install & Relaunch" from Sparkle
- New: #210 Add a "Stop" button to detach the debugger from the current session
+- New: #209 Drag a file onto the source view in the Breakpoints window to load the contents
1.4 Beta 1
@interface NSObject (BSSourceViewDelegate)
- (void)gutterClickedAtLine:(int)line forFile:(NSString*)file;
+
+// Whether to accept a file drop.
+- (BOOL)sourceView:(BSSourceView*)sv acceptsDropOfFile:(NSString*)fileName;
@end
[[textView textContainer] setHeightTracksTextView:NO];
[textView setAutoresizingMask:NSViewNotSizable];
[scrollView setDocumentView:textView];
+
+ NSArray* types = [NSArray arrayWithObject:NSFilenamesPboardType];
+ [self registerForDraggedTypes:types];
}
/**
[textView setString:contents];
}
+/**
+ * Validates an initiated drag operation.
+ */
+- (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender
+{
+ if ([delegate respondsToSelector:@selector(sourceView:acceptsDropOfFile:)])
+ return NSDragOperationCopy;
+ return NSDragOperationNone;
+}
+
+/**
+ * Performs a dragging operation of files to set the contents of the file.
+ */
+- (BOOL)performDragOperation:(id<NSDraggingInfo>)sender
+{
+ NSPasteboard* pboard = [sender draggingPasteboard];
+ if ([[pboard types] containsObject:NSFilenamesPboardType]) {
+ NSArray* files = [pboard propertyListForType:NSFilenamesPboardType];
+ if ([files count]) {
+ NSString* filename = [files objectAtIndex:0];
+ if ([delegate respondsToSelector:@selector(sourceView:acceptsDropOfFile:)] &&
+ [delegate sourceView:self acceptsDropOfFile:filename]) {
+ [self setFile:filename];
+ return YES;
+ }
+ }
+ }
+ return NO;
+}
+
@end