Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1fe87b2b50
Fetching contributors…

Cannot retrieve contributors at this time

52 lines (37 sloc) 1.475 kb
//
// ABCardWindowControllerPatches.m
// ABKeyManager
//
// Created by Robert Goldsmith on 12/03/2005.
// Copyright 2005 Far-Blue. All rights reserved.
//
#import "ABCardWindowControllerPatches.h"
#import "PatchingFunctions.h"
#import "ABKeyWindowAugmentationsManager.h"
#import "GPGMEController.h"
@implementation ABCardWindowControllerPatches
+(void)initialize
{
registerMethodFromClassInNewClassAndRenameOldMethodFromThisNewClass (@"ABCardWindowControllerPatches", @selector(validateMenuItem:), @"ABCardWindowController", @"originalValidateMenuItem:");
registerMethodFromClassInNewClassAndRenameOldMethodFromThisNewClass (@"ABCardWindowControllerPatches", @selector(windowWillClose:), @"ABCardWindowController", @"originalWindowWillClose:");
registerMethodWithNewClass(@"ABCardWindowControllerPatches", @selector(inputController),@"ABCardWindowController");
}
-(id)inputController
{
id inputController;
object_getInstanceVariable(self,"_cardInputController" ,(void **)&inputController);
return inputController;
}
-(BOOL)validateMenuItem:(id)sender
{
if([sender tag]==255)//GPGMail Options info
return ![[self inputController] isFieldVisible:@"GPGOptions"];
return [self originalValidateMenuItem:sender];
}
-(void)windowWillClose:(id)foo
{
[ABKeyWindowAugmentationsManager removeWindow:[self window]];
[[GPGMEController sharedController] removeObserver:[self inputController]];
[self originalWindowWillClose:foo];
}
@end
Jump to Line
Something went wrong with that request. Please try again.