X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/05636a2c619a660f5d11f0468844326e65f7d5fc..766b71dd4f1e125f68905d928c6735f2346cb5ea:/Cydia.mm diff --git a/Cydia.mm b/Cydia.mm index 8eb45e51..f42afe3e 100644 --- a/Cydia.mm +++ b/Cydia.mm @@ -342,6 +342,18 @@ static _finline NSString *CydiaURL(NSString *path) { } return self; } +- (void)_updateFrameForDisplay { + [super _updateFrameForDisplay]; + if ([self cancelButtonIndex] == -1) { + NSArray *buttons = [self buttons]; + if ([buttons count]) { + UIImage *background = [[buttons objectAtIndex:0] backgroundForState:0]; + for (UIThreePartButton *button in buttons) + [button setBackground:background forState:0]; + } + } +} + - (void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { button_ = buttonIndex + 1; } @@ -3887,7 +3899,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { @end /* }}} */ -@interface CYBrowserController : BrowserView { +@interface CYBrowserController : BrowserController { CydiaObject *cydia_; } @@ -4150,7 +4162,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } return self; } -- (void) didFinishLoading { +- (void) applyRightButton { UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithTitle:UCLocalize("CONFIRM") style:UIBarButtonItemStylePlain @@ -4158,8 +4170,10 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { action:@selector(confirmButtonClicked) ]; #if !AlwaysReload && !IgnoreInstall - if (issues_ == nil) [[self navigationItem] setRightBarButtonItem:rightItem]; - else [[self navigationItem] setRightBarButtonItem:nil]; + if (issues_ == nil && ![self isLoading]) [[self navigationItem] setRightBarButtonItem:rightItem]; + else [super applyRightButton]; +#else + [[self navigationItem] setRightBarButtonItem:nil]; #endif [rightItem release]; } @@ -5244,11 +5258,18 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) actionButtonClicked { - if (commercial_ && [self isLoading]) - [super _rightButtonClicked]; - else + // Wait until it's done loading. + if (![self isLoading]) [self _actionButtonClicked]; } + +- (void) reloadButtonClicked { + // Don't reload a package view by clicking the button. +} + +- (void) applyLoadingTitle { + // Don't show "Loading" as the title. Ever. +} #endif - (id) initWithDatabase:(Database *)database { @@ -5316,7 +5337,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } } -- (void) didFinishLoading { +- (void) applyRightButton { int count = [buttons_ count]; UIBarButtonItem *actionItem = [[UIBarButtonItem alloc] initWithTitle:count == 0 ? nil : count != 1 ? UCLocalize("MODIFY") : [buttons_ objectAtIndex:0] @@ -5324,7 +5345,8 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { target:self action:@selector(actionButtonClicked) ]; - [[self navigationItem] setRightBarButtonItem:actionItem]; + if (![self isLoading]) [[self navigationItem] setRightBarButtonItem:actionItem]; + else [super applyRightButton]; [actionItem release]; }