diff options
author | Graham Madarasz (Graham Linden) <graham@lindenlab.com> | 2013-02-22 09:49:58 -0800 |
---|---|---|
committer | Graham Madarasz (Graham Linden) <graham@lindenlab.com> | 2013-02-22 09:49:58 -0800 |
commit | 98e02a5d76ccc044e72949965e84f0803ad0026c (patch) | |
tree | 49df15d88f940e9901c618eacc9e2286cccb6952 /indra/newview/llfilepicker_mac.mm | |
parent | e17d69d1d16c607aa304936ebf2ab151684f9c76 (diff) | |
parent | 27b01e94dd7e98415fa8ec645c37f9291f60df0b (diff) |
Merge new boost and add OS X 10.8 mods
Diffstat (limited to 'indra/newview/llfilepicker_mac.mm')
-rw-r--r-- | indra/newview/llfilepicker_mac.mm | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/indra/newview/llfilepicker_mac.mm b/indra/newview/llfilepicker_mac.mm index 13d0caeb9f..d8862bce57 100644 --- a/indra/newview/llfilepicker_mac.mm +++ b/indra/newview/llfilepicker_mac.mm @@ -66,19 +66,21 @@ std::vector<std::string>* doLoadDialog(const std::vector<std::string>* allowed_t if (fileTypes) { - [panel setAllowedFileTypes:fileTypes]; - - result = [panel runModalForTypes:fileTypes]; + result = [panel runModal]; } else { - result = [panel runModalForDirectory:NSHomeDirectory() file:nil]; + // I suggest it's better to open the last path and let this default to home dir as necessary + // for consistency with other OS X apps + // + //[panel setDirectoryURL: fileURLWithPath(NSHomeDirectory()) ]; + result = [panel runModal]; } if (result == NSOKButton) { - NSArray *filesToOpen = [panel filenames]; + NSArray *filesToOpen = [panel URLs]; int i, count = [filesToOpen count]; if (count > 0) @@ -114,11 +116,14 @@ std::string* doSaveDialog(const std::string* file, NSString *fileName = [NSString stringWithCString:file->c_str() encoding:[NSString defaultCStringEncoding]]; std::string *outfile = NULL; - - if([panel runModalForDirectory:nil file:fileName] == + NSURL* url = [NSURL fileURLWithPath:fileName]; + [panel setDirectoryURL: url]; + if([panel runModal] == NSFileHandlingPanelOKButton) - { - outfile= new std::string( [ [panel filename] UTF8String ] ); + { + NSURL* url = [panel URL]; + NSString* p = [url path]; + outfile = new std::string( [p UTF8String] ); // write the file } return outfile; |