]> git.saurik.com Git - cydia.git/commitdiff
Merge commit :(. Bring in my work on URLs and UITabBarController into one functioning...
authorGrant Paul <chpwn@chpwn.com>
Sun, 23 Jan 2011 00:10:09 +0000 (16:10 -0800)
committerGrant Paul <chpwn@chpwn.com>
Sun, 23 Jan 2011 00:10:09 +0000 (16:10 -0800)
 - 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.

1  2 
MobileCydia.app/package.js
MobileCydia.mm

index 2eaeb4a685a4ec4ecec19353f23cf74d618b9dce,2eaeb4a685a4ec4ecec19353f23cf74d618b9dce..0e2566bd0e8faf9b81a1df4a69015bec451d2257
@@@ -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 71f000643fdc2243e4c9c88fc16a8f0bc82c5d1c,2b644405b9e43b1fa576489c67d9b9c05ad46b2c..1b0e37d8173e75f90b474e0e30b3d0c7ebf9e551
@@@ -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;
      [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];
  }
  - (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 {
      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) {
      }
  
      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 {