From: Grant Paul Date: Sun, 23 Jan 2011 00:10:09 +0000 (-0800) Subject: Merge commit :(. Bring in my work on URLs and UITabBarController into one functioning... X-Git-Tag: v1.1.0%b1~367^2~26 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/4305896caa42e43147efb1a289699b3edf91e853?hp=--cc Merge commit :(. Bring in my work on URLs and UITabBarController into one functioning whole! - Queueing badges and controllers work. - As far as I can tell, no broken URLs on Cydia pages. - There might still be one the website, but that's not under my control. - Lazy loads tabs again, but also doesn't reload the home page when switching back to it (yay!). - Adds "Show Pacakge Settings" duplicated text as a section header on the PackageSettingsController, for asthetic reasons. - Popups are *still* broken, and I still don't know why. --- 4305896caa42e43147efb1a289699b3edf91e853 diff --cc MobileCydia.app/package.js index 2eaeb4a6,2eaeb4a6..0e2566bd --- a/MobileCydia.app/package.js +++ b/MobileCydia.app/package.js @@@ -224,7 -224,7 +224,7 @@@ $(function () $(".installed").addClass("deleted"); else { $("#installed").html($.xml(installed)); -- $("#files-href").href("cydia://files/" + idc); ++ $("#files-href").href("cydia://package/" + idc + "/files"); } space("#id", $.xml(id), 220); diff --cc MobileCydia.mm index 71f00064,2b644405..1b0e37d8 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@@ -6624,12 -6582,12 +6621,11 @@@ bool DepSubstrate(const pkgCache::VerIt /* }}} */ /* Home Controller {{{ */ - @interface CYHomeController : CYBrowserController { + @interface HomeController : CYBrowserController { } -- @end - @implementation CYHomeController + @implementation HomeController + (BOOL)shouldHideNavigationBar { return NO; @@@ -7768,8 -7768,12 +7805,6 @@@ [self reloadData]; } -- (void) setSearchTerm:(NSString *)term { - [search_ setText:term]; -} - --- (NSString *) title { return nil; } -- - (id) initWithDatabase:(Database *)database { return [super initWithDatabase:database title:UCLocalize("SEARCH") filter:@selector(isUnfilteredAndSearchedForBy:) with:nil]; } @@@ -8337,21 -8326,17 +8363,16 @@@ - (void) _updateData { [self _saveConfig]; - for (CYNavigationController *controller in [tabbar_ viewControllers]) - [controller reloadData]; + [tabbar_ reloadData]; - [queueDelegate_ queueStatusDidChange]; - [[[self queueBadgeController] tabBarItem] setBadgeValue:(Queuing_ ? UCLocalize("Q_D") : nil)]; - } + CYNavigationController *navigation = [self queueNavigationController]; - id queuedelegate = nil; - - (int)indexOfTabWithTag:(int)tag { - int i = 0; - for (UINavigationController *controller in [tabbar_ viewControllers]) { - if ([[controller tabBarItem] tag] == tag) - return i; - i += 1; - } ++ id queuedelegate = nil; + if ([[navigation viewControllers] count] > 0) + queuedelegate = [[navigation viewControllers] objectAtIndex:0]; - return -1; + [queuedelegate queueStatusDidChange]; + [[navigation tabBarItem] setBadgeValue:(Queuing_ ? UCLocalize("Q_D") : nil)]; } - (void) _refreshIfPossible { @@@ -8640,15 -8662,14 +8698,6 @@@ WebThreadUnlock(); } - // Returns the navigation controller for the queuing badge. - - (id) queueBadgeController { - int index = [self indexOfTabWithTag:kManageTag]; - if (index == -1) - index = [self indexOfTabWithTag:kInstalledTag]; -- (PackageController *) _packageController { - return [[[PackageController alloc] initWithDatabase:database_] autorelease]; -} -- - return [[tabbar_ viewControllers] objectAtIndex:index]; -- (PackageController *) packageController { - return [self _packageController]; --} -- - (void) cancelAndClear:(bool)clear { @synchronized (self) { if (clear) { @@@ -8984,21 -8993,17 +9021,15 @@@ } NSMutableArray *controllers([NSMutableArray array]); - - for (unsigned int i = 0; i < [pages count]; i++) { - UITabBarItem *item = [items objectAtIndex:i]; - CYViewController *page = [pages objectAtIndex:i]; - [page setDelegate:self]; -- + for (UITabBarItem *item in items) { CYNavigationController *controller([[[CYNavigationController alloc] initWithDatabase:database_] autorelease]); - [controller setViewControllers:[NSArray arrayWithObject:page]]; [controller setTabBarItem:item]; [controllers addObject:controller]; } -- [tabbar_ setViewControllers:controllers]; ++ [tabbar_ setUpdateDelegate:self]; [window_ addSubview:[tabbar_ view]]; - } - (void)showEmulatedLoadingControllerInView:(UIView *)view {