summaryrefslogtreecommitdiff
path: root/Cydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2008-05-06 21:57:44 +0000
committerJay Freeman (saurik) <saurik@saurik.com>2010-09-30 07:08:00 +0000
commit9b619239dd66c1c63cb6cfb845a42f6e16e97e9a (patch)
treecbd534477e98ed1a55361509e60cb45740e75152 /Cydia.mm
parent826783725a3a1421bbbda58cd44573f606a26b90 (diff)
Renamed News to Home and started pre-caching tabs for perceived performance.
Diffstat (limited to 'Cydia.mm')
-rw-r--r--Cydia.mm47
1 files changed, 37 insertions, 10 deletions
diff --git a/Cydia.mm b/Cydia.mm
index c3a9e0b..81a3e7b 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 {