Implemented uiMsgBox() and uiMsgBoxError() and resolved a TODO on the OS X side.

This commit is contained in:
Pietro Gagliardi 2015-08-25 19:26:51 -04:00
parent ccd46d11f7
commit 283ae5329e
1 changed files with 18 additions and 3 deletions

View File

@ -1,7 +1,7 @@
// 26 june 2015 // 26 june 2015
#import "uipriv_darwin.h" #import "uipriv_darwin.h"
// TODO is whether extensions are shown a Finder setting? // note: whether extensions are actually shown depends on a user setting in Finder; we can't control it here
static void setupSavePanel(NSSavePanel *s) static void setupSavePanel(NSSavePanel *s)
{ {
[s setCanCreateDirectories:YES]; [s setCanCreateDirectories:YES];
@ -45,12 +45,27 @@ char *uiSaveFile(void)
return runSavePanel(s); return runSavePanel(s);
} }
static void msgbox(const char *title, const char *description, NSAlertStyle style)
{
NSAlert *a;
a = [NSAlert new];
[a setAlertStyle:style];
[a setShowsHelp:NO];
[a setShowsSuppressionButton:NO];
[a setMessageText:toNSString(title)];
[a setInformativeText:toNSString(description)];
[a addButtonWithTitle:@"OK"];
[a runModal];
[a release];
}
void uiMsgBox(const char *title, const char *description) void uiMsgBox(const char *title, const char *description)
{ {
// TODO msgbox(title, description, NSInformationalAlertStyle);
} }
void uiMsgBoxError(const char *title, const char *description) void uiMsgBoxError(const char *title, const char *description)
{ {
// TODO msgbox(title, description, NSCriticalAlertStyle);
} }