summaryrefslogtreecommitdiff
path: root/Cydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2008-01-22 11:35:12 +0000
committerJay Freeman (saurik) <saurik@saurik.com>2008-01-22 11:35:12 +0000
commitc25a610db9cf0e7911ea574c56a66fb7513a0c91 (patch)
tree4f39309ccb784e718a330f3c64a19116c493cd2d /Cydia.mm
parent74127566cd8a9df755be4e2b06708a74a784b024 (diff)
Implemented badges.
Diffstat (limited to 'Cydia.mm')
-rw-r--r--Cydia.mm16
1 files changed, 16 insertions, 0 deletions
diff --git a/Cydia.mm b/Cydia.mm
index aa90bd0..e63f35e 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 {