| 96 | } |
| 97 | |
| 98 | bool MacFileSystem::ShowSaveFileDialog(Window* parentWindow, const StringView& initialDirectory, const StringView& filter, bool multiSelect, const StringView& title, Array<String>& filenames) |
| 99 | { |
| 100 | bool result = true; |
| 101 | @autoreleasepool { |
| 102 | NSWindow* focusedWindow = [[NSApplication sharedApplication] keyWindow]; |
| 103 | |
| 104 | NSSavePanel* dialog = [NSSavePanel savePanel]; |
| 105 | [dialog setExtensionHidden:NO]; |
| 106 | InitMacDialog(dialog, initialDirectory, filter, title); |
| 107 | |
| 108 | if ([dialog runModal] == NSModalResponseOK) |
| 109 | { |
| 110 | const NSURL* url = [dialog URL]; |
| 111 | filenames.Add(AppleUtils::ToString((CFStringRef)[url path])); |
| 112 | result = false; |
| 113 | } |
| 114 | |
| 115 | [focusedWindow makeKeyAndOrderFront:nil]; |
| 116 | } |
| 117 | return result; |
| 118 | } |
| 119 |
no test coverage detected