diff options
author | Grant Paul <chpwn@chpwn.com> | 2010-10-16 13:57:35 -0700 |
---|---|---|
committer | Grant Paul <chpwn@chpwn.com> | 2010-10-16 13:57:35 -0700 |
commit | 09c01bb0755e06d7be9b1c68250ba95531a64128 (patch) | |
tree | b7b763924bb84af4f346d67e6b2389067638fda2 | |
parent | 72b825bcd9ce6f4691759dec0a0c31a19ed0e581 (diff) |
Improved Queuing for cleaner code and better operation. Now it reloads the current view when exiting a queue and while starting it, and it has a much cleaner method of adding the "Q_D" badge.
-rw-r--r-- | Cydia.mm | 27 |
1 files changed, 17 insertions, 10 deletions
@@ -8346,6 +8346,14 @@ static _finline void _setHomePage(Cydia *self) { #endif } +// Returns the navigation controller for the queuing badge. +- (id) queueBadgeController { + int index = [self indexOfTabWithTag:kManageTag]; + if (index == -1) index = [self indexOfTabWithTag:kInstalledTag]; + + return [[tabbar_ viewControllers] objectAtIndex:index]; +} + - (void) cancelAndClear:(bool)clear { @synchronized (self) { if (clear) { @@ -8360,19 +8368,18 @@ static _finline void _setHomePage(Cydia *self) { } } - // Stop queuing, and let the appropriate controller know it. + // Stop queuing. Queuing_ = false; - [[[[tabbar_ viewControllers] objectAtIndex:[self indexOfTabWithTag:kManageTag] != -1 ? [self indexOfTabWithTag:kManageTag] : [self indexOfTabWithTag:kInstalledTag]] tabBarItem] setBadgeValue:nil]; - [queueDelegate_ queueStatusDidChange]; + [[[self queueBadgeController] tabBarItem] setBadgeValue:nil]; } else { - // Start queuing, and let the controllers know. + // Start queuing. Queuing_ = true; - - [[[[tabbar_ viewControllers] objectAtIndex:[self indexOfTabWithTag:kManageTag] != -1 ? [self indexOfTabWithTag:kManageTag] : [self indexOfTabWithTag:kInstalledTag]] tabBarItem] setBadgeValue:UCLocalize("Q_D")]; - [(CYNavigationController *)[tabbar_ selectedViewController] reloadData]; - - [queueDelegate_ queueStatusDidChange]; - } + [[[self queueBadgeController] tabBarItem] setBadgeValue:UCLocalize("Q_D")]; + } + + // Show the changes in the current view. + [(CYNavigationController *) [tabbar_ selectedViewController] reloadData]; + [queueDelegate_ queueStatusDidChange]; } } |