MYCrypto+Cocoa.m
changeset 9 aa5eb3fd6ebf
child 14 3af1d1c0ceb5
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/MYCrypto+Cocoa.m	Sun Apr 12 22:16:14 2009 -0700
     1.3 @@ -0,0 +1,48 @@
     1.4 +//
     1.5 +//  MYCrypto+Cocoa.m
     1.6 +//  MYCrypto
     1.7 +//
     1.8 +//  Created by Jens Alfke on 4/10/09.
     1.9 +//  Copyright 2009 Jens Alfke. All rights reserved.
    1.10 +//
    1.11 +
    1.12 +#import "MYCrypto+Cocoa.h"
    1.13 +#import "MYCrypto_Private.h"
    1.14 +#import "MYIdentity.h"
    1.15 +
    1.16 +
    1.17 +@implementation SFChooseIdentityPanel (MYCrypto)
    1.18 +
    1.19 +
    1.20 +- (NSInteger)my_runModalForIdentities:(NSArray *)identities 
    1.21 +                              message:(NSString *)message
    1.22 +{
    1.23 +    NSMutableArray *identityRefs = $marray();
    1.24 +    for (MYIdentity *ident in identities)
    1.25 +        [identityRefs addObject: (id)ident.identityRef];
    1.26 +    return [self runModalForIdentities: identityRefs message: message];
    1.27 +}
    1.28 +
    1.29 +- (void)my_beginSheetForWindow:(NSWindow *)docWindow 
    1.30 +                 modalDelegate:(id)delegate 
    1.31 +                didEndSelector:(SEL)didEndSelector
    1.32 +                   contextInfo:(void *)contextInfo 
    1.33 +                    identities:(NSArray *)identities 
    1.34 +                       message:(NSString *)message
    1.35 +{
    1.36 +    NSMutableArray *identityRefs = $marray();
    1.37 +    for (MYIdentity *ident in identities)
    1.38 +        [identityRefs addObject: (id)ident.identityRef];
    1.39 +    [self beginSheetForWindow:docWindow 
    1.40 +                modalDelegate:delegate 
    1.41 +               didEndSelector:didEndSelector
    1.42 +                  contextInfo:contextInfo 
    1.43 +                   identities:identityRefs
    1.44 +                      message:message];
    1.45 +}
    1.46 +
    1.47 +- (MYIdentity*) my_identity {
    1.48 +    return [MYIdentity identityWithIdentityRef: [self identity]];
    1.49 +}
    1.50 +
    1.51 +@end