mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 03:11:18 +00:00
When NSDocument presents a save panel, make sure the file name has a
valid extension for the document's type. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31793 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
13a2fd6326
commit
694843b3e1
2 changed files with 17 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2010-12-29 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/NSDocument.m (-runModalSavePanel:withAccessoryView:):
|
||||
Make sure the file name displayed in the panel has a valid
|
||||
extension.
|
||||
|
||||
2010-12-27 16:51-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/GSThemeMenu.m: Changes for compiling with older compilers.
|
||||
|
@ -47,7 +53,6 @@
|
|||
* Source/NSWindow.m ([-encodeWithCoder:], [-initWithCoder:]): Same
|
||||
for NSBackingStoreType.
|
||||
|
||||
>>>>>>> .r31789
|
||||
2010-12-27 02:12-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/GSThemeMenu.m: Added implementation for
|
||||
|
|
|
@ -1071,6 +1071,17 @@ originalContentsURL: (NSURL *)orig
|
|||
{
|
||||
directory = [[self fileName] stringByDeletingLastPathComponent];
|
||||
file = [[self fileName] lastPathComponent];
|
||||
if (![savePanel allowsOtherFileTypes])
|
||||
{
|
||||
NSArray *exts = [savePanel allowedFileTypes];
|
||||
if ([exts count] && ![exts containsObject: [file pathExtension]] &&
|
||||
![exts containsObject: @"*"])
|
||||
{
|
||||
file = [file stringByDeletingPathExtension];
|
||||
file = [file stringByAppendingPathExtension:
|
||||
[exts objectAtIndex: 0]];
|
||||
}
|
||||
}
|
||||
return [savePanel runModalForDirectory: directory file: file];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue