File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9090-(id ) initWithFrame : (NSRect )frameRect ;
9191-(void ) awakeFromNib ;
9292
93+ -(NSDragOperation )draggingEntered : (id <NSDraggingInfo >)sender ;
94+ -(BOOL )performDragOperation : (id <NSDraggingInfo >)sender ;
95+
9396-(void ) loadPicture : (NSString *) name
9497 greenTex : (Texture*) greenTexture
9598 redTex : (Texture*) redTexture
Original file line number Diff line number Diff line change @@ -311,6 +311,8 @@ -(id) initWithFrame:(NSRect)frameRect
311311 currentScreenTex = 0 ;
312312
313313 statusbar_updated = NO ;
314+
315+ [self registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType , nil ]];
314316
315317 return self;
316318}
@@ -328,6 +330,22 @@ -(void)dealloc
328330 [super dealloc ];
329331}
330332
333+ - (NSDragOperation )draggingEntered : (id <NSDraggingInfo >)sender {
334+ return NSDragOperationCopy;
335+ }
336+
337+ - (BOOL )performDragOperation : (id <NSDraggingInfo >)sender {
338+ NSPasteboard *pboard;
339+
340+ pboard = [sender draggingPasteboard ];
341+
342+ if ( [[pboard types ] containsObject: NSFilenamesPboardType ] ) {
343+ NSString *fileURL = [[NSURL URLFromPasteboard: pboard] path ];
344+ [[FuseController singleton ] openFile: [fileURL UTF8String ]];
345+ }
346+ return YES ;
347+ }
348+
331349-(void ) awakeFromNib
332350{
333351 /* keep the window in the standard aspect ratio if the user resizes */
You can’t perform that action at this time.
0 commit comments