X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/1ce016d4bdc5917ade93fe12291410cbf54cdb6c..18096c78c51f7dee48bb9e9312fe733d9d30e320:/UICaboodle/RVBook.mm diff --git a/UICaboodle/RVBook.mm b/UICaboodle/RVBook.mm index 28774ae3..433de39d 100644 --- a/UICaboodle/RVBook.mm +++ b/UICaboodle/RVBook.mm @@ -172,7 +172,10 @@ [pages_ addObject:page]; [self reloadButtonsForPage:page]; - [navbar_ setAccessoryView:[page accessoryView] animate:animated removeOnPop:NO]; + if ([navbar_ respondsToSelector:@selector(setAccessoryView:animate:removeOnPop:)]) + [navbar_ setAccessoryView:[page accessoryView] animate:animated removeOnPop:NO]; + else + [navbar_ setAccessoryView:[page accessoryView] animate:animated]; } - (void) pushPage:(RVPage *)page { @@ -223,7 +226,10 @@ [page setPageActive:YES]; [self reloadButtonsForPage:page]; - [navbar_ setAccessoryView:[page accessoryView] animate:animated removeOnPop:NO]; + if ([navbar_ respondsToSelector:@selector(setAccessoryView:animate:removeOnPop:)]) + [navbar_ setAccessoryView:[page accessoryView] animate:animated removeOnPop:NO]; + else + [navbar_ setAccessoryView:[page accessoryView] animate:animated]; } - (void) setBackButtonTitle:(NSString *)title forPage:(RVPage *)page { @@ -270,10 +276,24 @@ } - (void) reloadData { - for (int i(0), e([pages_ count]); i != e; ++i) { - RVPage *page([pages_ objectAtIndex:(e - i - 1)]); + size_t count([pages_ count]); + for (size_t i(0); i != count; ++i) { + RVPage *page([pages_ objectAtIndex:(count - i - 1)]); [page reloadData]; } + + if (count != 0) { + RVPage *page([pages_ lastObject]); + [self reloadButtonsForPage:page]; + } +} + +- (void) reloadButtons { + size_t count([pages_ count]); + if (count != 0) { + RVPage *page([pages_ lastObject]); + [self reloadButtonsForPage:page]; + } } - (CGRect) pageBounds { @@ -292,7 +312,7 @@ - (void) _leftButtonTitle:(NSString *&)leftButtonTitle style:(UINavigationButtonStyle &)leftButtonStyle forPage:(RVPage *)page { [super _leftButtonTitle:leftButtonTitle style:leftButtonStyle forPage:page]; if ((cancel_ = leftButtonTitle == nil && [pages_ count] == 1)) { - leftButtonTitle = @"Cancel"; + leftButtonTitle = [[NSBundle mainBundle] localizedStringForKey:@"CANCEL" value:nil table:nil]; leftButtonStyle = UINavigationButtonStyleNormal; } }