From e25e221f5b13c686abcb06a3fce30b0ed19a2dcc Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 6 May 2008 21:57:44 +0000 Subject: [PATCH] Renamed News to Home and started pre-caching tabs for perceived performance. --- Cydia.app/{news-dn.png => home-dn.png} | Bin Cydia.app/{news-up.png => home-up.png} | Bin Cydia.mm | 47 +++++++++++++++++++------ 3 files changed, 37 insertions(+), 10 deletions(-) rename Cydia.app/{news-dn.png => home-dn.png} (100%) rename Cydia.app/{news-up.png => home-up.png} (100%) diff --git a/Cydia.app/news-dn.png b/Cydia.app/home-dn.png similarity index 100% rename from Cydia.app/news-dn.png rename to Cydia.app/home-dn.png diff --git a/Cydia.app/news-up.png b/Cydia.app/home-up.png similarity index 100% rename from Cydia.app/news-up.png rename to Cydia.app/home-up.png diff --git a/Cydia.mm b/Cydia.mm index c3a9e0b2..81a3e7b7 100644 --- a/Cydia.mm +++ b/Cydia.mm @@ -3463,6 +3463,7 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString UITransitionView *transition_; PackageTable *table_; UIPreferencesTable *advanced_; + UIView *dimmed_; bool flipped_; bool reload_; } @@ -3485,6 +3486,7 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString [transition_ release]; [table_ release]; [advanced_ release]; + [dimmed_ release]; [super dealloc]; } @@ -3560,6 +3562,10 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString [advanced_ setDataSource:self]; [advanced_ reloadData]; + dimmed_ = [[UIView alloc] initWithFrame:pageBounds]; + CGColor dimmed(space_, 0, 0, 0, 0.5); + [dimmed_ setBackgroundColor:dimmed]; + table_ = [[PackageTable alloc] initWithBook:book database:database @@ -3836,6 +3842,11 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString unsigned tag_; UIKeyboard *keyboard_; + + InstallView *install_; + ChangesView *changes_; + ManageView *manage_; + SearchView *search_; } @end @@ -3881,6 +3892,16 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString _assert([Metadata_ writeToFile:@"/var/lib/cydia/metadata.plist" atomically:YES] == YES); + /* XXX: this is just stupid */ + if (tag_ != 2) + [install_ reloadData]; + if (tag_ != 3) + [changes_ reloadData]; + if (tag_ != 4) + [manage_ reloadData]; + if (tag_ != 5) + [search_ reloadData]; + [book_ reloadData]; /*[hud show:NO]; [hud removeFromSuperview];*/ @@ -4008,11 +4029,12 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString } - (void) setPage:(RVPage *)page { + [page resetViewAnimated:NO]; [page setDelegate:self]; [book_ setPage:page]; } -- (RVPage *) _setNewsPage { +- (RVPage *) _setHomePage { BrowserView *browser = [[[BrowserView alloc] initWithBook:book_ database:database_] autorelease]; [self setPage:browser]; [browser loadURL:[NSURL URLWithString:@"http://cydia.saurik.com/"]]; @@ -4028,23 +4050,23 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString switch (tag) { case 1: - [self _setNewsPage]; + [self _setHomePage]; break; case 2: - [self setPage:[[[InstallView alloc] initWithBook:book_ database:database_] autorelease]]; + [self setPage:install_]; break; case 3: - [self setPage:[[[ChangesView alloc] initWithBook:book_ database:database_] autorelease]]; + [self setPage:changes_]; break; case 4: - [self setPage:[[[ManageView alloc] initWithBook:book_ database:database_] autorelease]]; + [self setPage:manage_]; break; case 5: - [self setPage:[[[SearchView alloc] initWithBook:book_ database:database_] autorelease]]; + [self setPage:search_]; break; default: @@ -4103,11 +4125,11 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString NSArray *buttonitems = [NSArray arrayWithObjects: [NSDictionary dictionaryWithObjectsAndKeys: @"buttonBarItemTapped:", kUIButtonBarButtonAction, - @"news-up.png", kUIButtonBarButtonInfo, - @"news-dn.png", kUIButtonBarButtonSelectedInfo, + @"home-up.png", kUIButtonBarButtonInfo, + @"home-dn.png", kUIButtonBarButtonSelectedInfo, [NSNumber numberWithInt:1], kUIButtonBarButtonTag, self, kUIButtonBarButtonTarget, - @"News", kUIButtonBarButtonTitle, + @"Home", kUIButtonBarButtonTitle, @"0", kUIButtonBarButtonType, nil], @@ -4184,6 +4206,11 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString [[UIKeyboardImpl sharedInstance] setSoundsEnabled:(Sounds_Keyboard_ ? YES : NO)]; [overlay_ addSubview:keyboard_]; + install_ = [[InstallView alloc] initWithBook:book_ database:database_]; + changes_ = [[ChangesView alloc] initWithBook:book_ database:database_]; + manage_ = [[ManageView alloc] initWithBook:book_ database:database_]; + search_ = [[SearchView alloc] initWithBook:book_ database:database_]; + [self reloadData]; [book_ update]; @@ -4192,7 +4219,7 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString if (bootstrap_) [self bootstrap]; else - [self _setNewsPage]; + [self _setHomePage]; } - (void) showKeyboard:(BOOL)show { -- 2.45.2