mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 21:20:38 +00:00
Add some 10.4 methods.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25348 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1d62a78524
commit
c2b80f256b
6 changed files with 49 additions and 1 deletions
|
@ -37,6 +37,7 @@
|
|||
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include <Foundation/NSBundle.h>
|
||||
#include <Foundation/NSError.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include "AppKit/NSAlert.h"
|
||||
#include "AppKit/NSApplication.h"
|
||||
|
@ -1384,6 +1385,20 @@ void NSBeginInformationalAlertSheet(NSString *title,
|
|||
}
|
||||
}
|
||||
|
||||
+ (NSAlert *) alertWithError: (NSError *)error
|
||||
{
|
||||
NSArray *options;
|
||||
unsigned int count;
|
||||
|
||||
options = [error localizedRecoveryOptions];
|
||||
count = [options count];
|
||||
return [self alertWithMessageText: [error localizedDescription]
|
||||
defaultButton: (count > 0) ? [options objectAtIndex: 0] : nil
|
||||
alternateButton: (count > 1) ? [options objectAtIndex: 1] : nil
|
||||
otherButton: (count > 2) ? [options objectAtIndex: 2] : nil
|
||||
informativeTextWithFormat: [error localizedRecoverySuggestion]];
|
||||
}
|
||||
|
||||
+ (NSAlert *) alertWithMessageText: (NSString *)messageTitle
|
||||
defaultButton: (NSString *)defaultButtonTitle
|
||||
alternateButton: (NSString *)alternateButtonTitle
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue