From: Dustin L. Howett Date: Mon, 4 Oct 2010 14:16:27 +0000 (-0400) Subject: Merge branch 'master' of git.saurik.com:cydia X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/1e63fe6c2fd1018a669edf272ea87cfb24a2e3af?hp=-c Merge branch 'master' of git.saurik.com:cydia --- 1e63fe6c2fd1018a669edf272ea87cfb24a2e3af diff --combined Cydia.mm index 2638e422,3dfb9505..2d7b2030 --- a/Cydia.mm +++ b/Cydia.mm @@@ -2482,11 -2482,13 +2482,13 @@@ struct PackageNameOrdering UIImage *icon(nil); if (!icon_.empty()) if ([icon_ hasPrefix:@"file:///"]) + // XXX: correct escaping icon = [UIImage imageAtPath:[icon_ substringFromIndex:7]]; if (icon == nil) if (section != nil) icon = [UIImage imageAtPath:[NSString stringWithFormat:@"%@/Sections/%@.png", App_, section]]; if (icon == nil) if (source_ != nil) if (NSString *dicon = [source_ defaultIcon]) if ([dicon hasPrefix:@"file:///"]) + // XXX: correct escaping icon = [UIImage imageAtPath:[dicon substringFromIndex:7]]; if (icon == nil) icon = [UIImage applicationImageNamed:@"unknown.png"]; @@@ -5227,12 -5229,9 +5229,12 @@@ bool DepSubstrate(const pkgCache::VerIt } } +// We don't want to allow non-commercial packages to do custom things to the install button, +// so it must call customButtonClicked with a custom commercial_ == 1 fallthrough. - (void) customButtonClicked { - // Wait until it's done loading. - if (![self isLoading]) + if (commercial_) + [super customButtonClicked]; + else [self _customButtonClicked]; } @@@ -5243,16 -5242,6 +5245,16 @@@ - (void) applyLoadingTitle { // Don't show "Loading" as the title. Ever. } + +- (UIBarButtonItem *) rightButton { + int count = [buttons_ count]; + return [[[UIBarButtonItem alloc] + initWithTitle:count == 0 ? nil : count != 1 ? UCLocalize("MODIFY") : [buttons_ objectAtIndex:0] + style:UIBarButtonItemStylePlain + target:self + action:@selector(customButtonClicked) + ] autorelease]; +} #endif - (id) initWithDatabase:(Database *)database { @@@ -5320,6 -5309,19 +5322,6 @@@ } } -- (void) applyRightButton { - int count = [buttons_ count]; - UIBarButtonItem *actionItem = [[UIBarButtonItem alloc] - initWithTitle:count == 0 ? nil : count != 1 ? UCLocalize("MODIFY") : [buttons_ objectAtIndex:0] - style:UIBarButtonItemStylePlain - target:self - action:@selector(customButtonClicked) - ]; - if (![self isLoading]) [[self navigationItem] setRightBarButtonItem:actionItem]; - else [super applyRightButton]; - [actionItem release]; -} - - (bool) isLoading { return commercial_ ? [super isLoading] : false; }