| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #include <sstream> |
| | #include <string> |
| |
|
| | #include <Cocoa/Cocoa.h> |
| |
|
| | std::string GetSavePath(const char* filename) { |
| | NSSavePanel* panel = [NSSavePanel savePanel]; |
| | NSURL* userDocumentsDir = [NSFileManager.defaultManager URLsForDirectory:NSDocumentDirectory |
| | inDomains:NSUserDomainMask].firstObject; |
| | [panel setDirectoryURL:userDocumentsDir]; |
| | [panel setNameFieldStringValue:[NSString stringWithUTF8String:filename]]; |
| | if ([panel runModal] == NSModalResponseOK) { |
| | std::ostringstream s; |
| | s << [panel.URL.path cStringUsingEncoding:NSUTF8StringEncoding]; |
| | return s.str(); |
| | } else { |
| | return ""; |
| | } |
| | } |
| |
|
| | #ifdef __AVX__ |
| | void DisplayErrorDialogBox(const char* title, const char* msg) { |
| | NSAlert *alert = [[[NSAlert alloc] init] autorelease]; |
| | [alert setMessageText:[NSString stringWithUTF8String:title]]; |
| | [alert setInformativeText:[NSString stringWithUTF8String:msg]]; |
| | [alert setAlertStyle:NSAlertStyleCritical]; |
| | [alert addButtonWithTitle:@"Exit"]; |
| | [alert runModal]; |
| | } |
| | #endif |
| |
|