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:))
[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];
}
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];
}
}
- (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)