diff options
Diffstat (limited to 'macosx/main.mm')
-rw-r--r-- | macosx/main.mm | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/macosx/main.mm b/macosx/main.mm index 225c9151c..6607ed3d2 100644 --- a/macosx/main.mm +++ b/macosx/main.mm @@ -10,18 +10,18 @@ static void hb_error_handler(const char *errmsg) { NSString *error = @(errmsg); - dispatch_async(dispatch_get_main_queue(), ^{ - NSAlert *alert = [[NSAlert alloc] init]; - [alert setMessageText:NSLocalizedString(@"Internal Error.", @"")]; - if (error) - { - [alert setInformativeText:error]; - } - [alert runModal]; - [alert release]; - }); - fprintf(stderr, "GUI ERROR dialog: %s\n", errmsg ); + if (error && [[NSUserDefaults standardUserDefaults] boolForKey:@"HBDebugAlert"]) + { + dispatch_async(dispatch_get_main_queue(), ^{ + NSAlert *alert = [[NSAlert alloc] init]; + [alert setMessageText:NSLocalizedString(@"Internal Error.", @"")]; + [alert runModal]; + [alert release]; + }); + } + + fprintf(stderr, "error: %s\n", errmsg); } int main(int argc, const char **argv) |