snej@8: // snej@8: // MYCrypto+Cocoa.m snej@8: // MYCrypto snej@8: // snej@8: // Created by Jens Alfke on 4/10/09. snej@8: // Copyright 2009 Jens Alfke. All rights reserved. snej@8: // snej@8: snej@8: #import "MYCrypto+Cocoa.h" snej@8: #import "MYCrypto_Private.h" snej@8: #import "MYIdentity.h" snej@8: snej@8: snej@8: @implementation SFChooseIdentityPanel (MYCrypto) snej@8: snej@8: snej@8: - (NSInteger)my_runModalForIdentities:(NSArray *)identities snej@8: message:(NSString *)message snej@8: { snej@8: NSMutableArray *identityRefs = $marray(); snej@8: for (MYIdentity *ident in identities) snej@8: [identityRefs addObject: (id)ident.identityRef]; snej@8: return [self runModalForIdentities: identityRefs message: message]; snej@8: } snej@8: snej@8: - (void)my_beginSheetForWindow:(NSWindow *)docWindow snej@8: modalDelegate:(id)delegate snej@8: didEndSelector:(SEL)didEndSelector snej@8: contextInfo:(void *)contextInfo snej@8: identities:(NSArray *)identities snej@8: message:(NSString *)message snej@8: { snej@8: NSMutableArray *identityRefs = $marray(); snej@8: for (MYIdentity *ident in identities) snej@8: [identityRefs addObject: (id)ident.identityRef]; snej@8: [self beginSheetForWindow:docWindow snej@8: modalDelegate:delegate snej@8: didEndSelector:didEndSelector snej@8: contextInfo:contextInfo snej@8: identities:identityRefs snej@8: message:message]; snej@8: } snej@8: snej@8: - (MYIdentity*) my_identity { snej@8: return [MYIdentity identityWithIdentityRef: [self identity]]; snej@8: } snej@8: snej@8: @end snej@14: snej@14: snej@14: snej@14: /* snej@14: Copyright (c) 2009, Jens Alfke . All rights reserved. snej@14: snej@14: Redistribution and use in source and binary forms, with or without modification, are permitted snej@14: provided that the following conditions are met: snej@14: snej@14: * Redistributions of source code must retain the above copyright notice, this list of conditions snej@14: and the following disclaimer. snej@14: * Redistributions in binary form must reproduce the above copyright notice, this list of conditions snej@14: and the following disclaimer in the documentation and/or other materials provided with the snej@14: distribution. snej@14: snej@14: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR snej@14: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND snej@14: FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRI- snej@14: BUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES snej@14: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR snej@14: PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN snej@14: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF snej@14: THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. snej@14: */