X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/e38b51c528f5b608467c5f85a7ea57777907d823..d12c6e703c607e4a57334768e544285499ad6172:/Cydia.mm diff --git a/Cydia.mm b/Cydia.mm index aa90bd0f..e63f35e4 100644 --- a/Cydia.mm +++ b/Cydia.mm @@ -1698,6 +1698,7 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString - (void) deselect; - (void) reloadData:(BOOL)reset; +- (NSMutableArray *) packages; - (NSString *) title; - (void) perform:(Package *)package; - (void) addPackage:(Package *)package; @@ -1866,6 +1867,10 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString } } +- (NSMutableArray *) packages { + return packages_; +} + - (NSString *) title { return nil; } @@ -2066,6 +2071,17 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString [upgrade_ reloadData:reset]; [uninstall_ reloadData:reset]; [sources_ reloadData]; + + if (size_t count = [[upgrade_ packages] count]) { + NSString *badge([[NSNumber numberWithInt:count] stringValue]); + [buttonbar_ setBadgeValue:badge forButton:3]; + [buttonbar_ setBadgeAnimated:YES forButton:3]; + [self setApplicationBadge:badge]; + } else { + [buttonbar_ setBadgeValue:nil forButton:3]; + [buttonbar_ setBadgeAnimated:NO forButton:3]; + [self removeApplicationBadge]; + } } - (void) perform {