]> git.saurik.com Git - cydia.git/commitdiff
Add cydia.removeButton().
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 23 Feb 2011 10:48:22 +0000 (02:48 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 23 Feb 2011 10:48:55 +0000 (02:48 -0800)
MobileCydia.mm
UICaboodle/BrowserView.mm

index 3b09f6a65843f0f6826c54411978ba566096aba9..51843a76d6587a840b999ba5ed4c6fb6c53782ad 100644 (file)
@@ -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];
 }
index b5a7b9033d8dd362d31c4e7856a2d8d3d22c7aab..07a92eec468f0292f1c530242c4896b1e000eb5f 100644 (file)
@@ -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)