* Headers/AppKit/NSSavePanel.h

* Source/NSSavePanel.m: Added implementation for directory method
	from 10.6.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35484 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2012-08-31 19:02:35 +00:00
parent 58c33f3dce
commit cf7e179fcb
3 changed files with 22 additions and 6 deletions

View file

@ -1,3 +1,11 @@
2012-08-31 15:01-EDT Gregory John Casamento <greg.casamento@gmail.com>
Original changes by Marcian Lytwyn <marcian.lytwyn@advcsi.com>
merged from gnustep_testplant_branch.
* Headers/AppKit/NSSavePanel.h
* Source/NSSavePanel.m: Added implementation for directory method
from 10.6.
2012-08-31 12:09-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Source/GSXibLoader.m: Add _preProcessXib: method to perform

View file

@ -165,6 +165,9 @@ enum {
* Setting Directory and File Type
*/
- (void) setDirectory: (NSString *)path;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
- (void) setDirectoryURL: (NSURL*)url;
#endif
- (NSString *) requiredFileType;
- (void) setRequiredFileType: (NSString *)fileType;

View file

@ -936,7 +936,7 @@ selectCellWithString: (NSString*)title
{
NSString *standardizedPath = [path stringByStandardizingPath];
BOOL isDir;
if (standardizedPath
&& [_fm fileExistsAtPath: standardizedPath
isDirectory: &isDir]
@ -946,6 +946,14 @@ selectCellWithString: (NSString*)title
setPath(_browser, _directory);
}
}
/** <p>Sets the current path name in the Save panel's browser.
The path argument must be an absolute path name.</p>
<p>See Also: -directory</p>
*/
- (void) setDirectoryURL: (NSURL*)url
{
[self setDirectory: [url path]];
}
/**<p> Specifies the type, a file name extension to be appended to
any selected files that don't already have that extension;
@ -1096,7 +1104,7 @@ selectCellWithString: (NSString*)title
*/
- (NSInteger) runModal
{
return [self runModalForDirectory: nil file: @""];
return [self runModalForDirectory: [self directory] file: [self filename]];
}
/**<p> Initializes the panel to the directory specified by path and,
@ -1336,10 +1344,7 @@ selectCellWithString: (NSString*)title
if (result == NSAlertDefaultReturn)
{
if ([_fm createDirectoryAtPath: filename
withIntermediateDirectories: YES
attributes: nil
error: NULL] == NO)
if ([_fm createDirectoryAtPath: filename attributes: nil] == NO)
{
NSRunAlertPanel(_(@"Save"),
_(@"The directory '%@' could not be created."),