- (void) customButtonClicked;
- (void) applyRightButton;
+- (UIBarButtonItem *) customButton;
- (UIBarButtonItem *) rightButton;
- (void) _didStartLoading;
}
- (UIBarButtonItem *) customButton {
- return custom_ == [NSNull null] ? nil : [[[UIBarButtonItem alloc]
+ if (custom_ == nil)
+ return nil;
+ else if (custom_ == [NSNull null])
+ return (UIBarButtonItem *) [NSNull null];
+
+ return [[[UIBarButtonItem alloc]
initWithTitle:static_cast<NSString *>(custom_.operator NSObject *())
style:[self rightButtonStyle]
target:self
} else {
[indicator_ stopAnimating];
- [[self navigationItem] setRightBarButtonItem:(
- custom_ != nil ? [self customButton] : [self rightButton]
- ) animated:YES];
+ UIBarButtonItem *button([self customButton]);
+ if (button == nil)
+ button = [self rightButton];
+ else if (button == (UIBarButtonItem *) [NSNull null])
+ button = nil;
+
+ [[self navigationItem] setRightBarButtonItem:button];
}
}
target:self
action:@selector(settingsButtonClicked)
] autorelease]];
-
- [self queueStatusDidChange];
}
- (void) settingsButtonClicked {
[delegate_ showSettings];
}
-#if !AlwaysReload
- (void) queueButtonClicked {
[delegate_ queue];
}
-- (void) applyLoadingTitle {
- // Disable "Loading" title.
-}
-
-- (void) applyRightButton {
- // Disable right button.
+- (UIBarButtonItem *) customButton {
+ return Queuing_ ? [[[UIBarButtonItem alloc]
+ initWithTitle:UCLocalize("QUEUE")
+ style:UIBarButtonItemStyleDone
+ target:self
+ action:@selector(queueButtonClicked)
+ ] autorelease] : [super customButton];
}
-#endif
- (void) queueStatusDidChange {
-#if !AlwaysReload
- if (!IsWildcat_ && Queuing_) {
- [[self navigationItem] setRightBarButtonItem:[[[UIBarButtonItem alloc]
- initWithTitle:UCLocalize("QUEUE")
- style:UIBarButtonItemStyleDone
- target:self
- action:@selector(queueButtonClicked)
- ] autorelease]];
- } else {
- [[self navigationItem] setRightBarButtonItem:nil];
- }
-#endif
+ [self applyRightButton];
}
- (bool) isLoading {
- // Never show as loading.
- return false;
+ return !Queuing_ && [super isLoading];
}
@end