mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 04:00:37 +00:00
Accept dragged file names in NSSavePanel.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21838 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a360bbba59
commit
9c2cf54e7e
2 changed files with 26 additions and 5 deletions
|
@ -104,6 +104,7 @@ static BOOL _gs_display_reading_progress = NO;
|
|||
{
|
||||
return NSDragOperationNone;
|
||||
}
|
||||
|
||||
return NSDragOperationAll;
|
||||
}
|
||||
|
||||
|
@ -117,9 +118,23 @@ static BOOL _gs_display_reading_progress = NO;
|
|||
if ([types containsObject: NSFilenamesPboardType] == YES)
|
||||
{
|
||||
NSArray *names = [dragPb propertyListForType: NSFilenamesPboardType];
|
||||
NSString *file = [names lastObject];
|
||||
NSString *file = [[names lastObject] stringByStandardizingPath];
|
||||
BOOL isDir;
|
||||
|
||||
if (file &&
|
||||
[_fm fileExistsAtPath: file isDirectory: &isDir] &&
|
||||
isDir)
|
||||
{
|
||||
[self setDirectory: file];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *path = [file stringByDeletingLastPathComponent];
|
||||
NSString *filename = [file lastPathComponent];
|
||||
|
||||
[self _setupForDirectory: path file: filename];
|
||||
}
|
||||
|
||||
[self setDirectory: file];
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue