diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-23 02:48:22 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-23 02:48:55 -0800 |
commit | ed5566c758424fffb2204d93d93998d7fbc744b6 (patch) | |
tree | 023f9679780ded4a85ad70796065466174e4b9f3 | |
parent | 46d3a5cfc2959b65fef514faa666d735b91afbc6 (diff) |
Add cydia.removeButton().
-rw-r--r-- | MobileCydia.mm | 6 | ||||
-rw-r--r-- | UICaboodle/BrowserView.mm | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 3b09f6a..51843a7 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -3999,6 +3999,8 @@ static NSString *Warning_; return @"localize"; else if (selector == @selector(refreshSources)) return @"refreshSources"; + else if (selector == @selector(removeButton)) + return @"removeButton"; else if (selector == @selector(setButtonImage:withStyle:toFunction:)) return @"setButtonImage"; else if (selector == @selector(setButtonTitle:withStyle:toFunction:)) @@ -4153,6 +4155,10 @@ static NSString *Warning_; [delegate_ performSelectorOnMainThread:@selector(installPackages:) withObject:packages waitUntilDone:NO]; } +- (void) removeButton { + [indirect_ removeButton]; +} + - (void) setButtonImage:(NSString *)button withStyle:(NSString *)style toFunction:(id)function { [indirect_ setButtonImage:button withStyle:style toFunction:function]; } diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm index b5a7b90..07a92ee 100644 --- a/UICaboodle/BrowserView.mm +++ b/UICaboodle/BrowserView.mm @@ -584,7 +584,11 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se style_ = style; function_ = function; + [self performSelectorOnMainThread:@selector(applyRightButton) withObject:nil waitUntilDone:NO]; +} +- (void) removeButton { + custom_ = [NSNull null]; [self performSelectorOnMainThread:@selector(applyRightButton) withObject:nil waitUntilDone:NO]; } @@ -904,8 +908,8 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se } - (UIBarButtonItem *) customButton { - return [[[UIBarButtonItem alloc] - initWithTitle:custom_ + return custom_ == [NSNull null] ? nil : [[[UIBarButtonItem alloc] + initWithTitle:static_cast<NSString *>(custom_.operator NSObject *()) style:[self rightButtonStyle] target:self action:@selector(customButtonClicked) |