summaryrefslogtreecommitdiff
path: root/Cydia.mm
diff options
context:
space:
mode:
authorGrant Paul <chpwn@chpwn.com>2010-10-03 01:35:15 -0700
committerJay Freeman <saurik@Jay-Freemans-MacBook-Pro.local>2010-10-04 00:12:22 -0700
commit2bdd73bd2a0e988a2148f12f676f8f71f43c7b55 (patch)
tree970c8fa20c087442119cb0e3dc4f16fd8d50ad5f /Cydia.mm
parent21c6da4bd0e412e8b9f8ecec4e872335c770a910 (diff)
Completed new "Who Are You?" panel. Details:
- Fixed strange crash (introduced with last commit). - Changed to a "form sheet" style of view controller on the iPad" - Added Settings under the "Sources" tab on the iPad (where else to put it?) - Changed English localization to reflect the above iPad change, and made the _EX role descriptions more useful.
Diffstat (limited to 'Cydia.mm')
-rw-r--r--Cydia.mm28
1 files changed, 24 insertions, 4 deletions
diff --git a/Cydia.mm b/Cydia.mm
index b8bdb0e..ba5cb32 100644
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -6222,6 +6222,21 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
];
[[self navigationItem] setRightBarButtonItem:rightItem animated:animated];
[rightItem release];
+
+ if (IsWildcat_ && !editing) {
+ UIBarButtonItem *settingsItem = [[UIBarButtonItem alloc]
+ initWithTitle:UCLocalize("SETTINGS")
+ style:UIBarButtonItemStylePlain
+ target:self
+ action:@selector(settingsButtonClicked)
+ ];
+ [[self navigationItem] setLeftBarButtonItem:settingsItem];
+ [settingsItem release];
+ }
+}
+
+- (void) settingsButtonClicked {
+ [delegate_ showSettings];
}
- (void) editButtonClicked {
@@ -7503,8 +7518,6 @@ freeing the view controllers on tab change */
segment_ = [[UISegmentedControl alloc] initWithItems:items];
container_ = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [[self view] frame].size.width, 44.0f)];
[container_ addSubview:segment_];
- CGFloat width = [[self view] frame].size.width;
- [segment_ setFrame:CGRectMake(width / 32.0f, 0, width - (width / 32.0f * 2.0f), 44.0f)];
int index = -1;
if ([Role_ isEqualToString:@"User"]) index = 0;
@@ -7526,6 +7539,13 @@ freeing the view controllers on tab change */
} return self;
}
+- (void) viewWillAppear:(BOOL)animated {
+ [super viewWillAppear:animated];
+
+ CGFloat width = [[self view] frame].size.width;
+ [segment_ setFrame:CGRectMake(width / 32.0f, 0, width - (width / 32.0f * 2.0f), 44.0f)];
+}
+
- (void) save {
switch ([segment_ selectedSegmentIndex]) {
case 0: Role_ = @"User"; break;
@@ -8282,6 +8302,7 @@ static _finline void _setHomePage(Cydia *self) {
- (void) showSettings {
RoleController *role = [[RoleController alloc] initWithDatabase:database_ delegate:self];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:role];
+ if (IsWildcat_) [nav setModalPresentationStyle:UIModalPresentationFormSheet];
[container_ presentModalViewController:nav animated:YES];
}
@@ -8836,8 +8857,7 @@ int main(int argc, char *argv[]) { _pooled
if (Metadata_ == NULL)
Metadata_ = [NSMutableDictionary dictionaryWithCapacity:2];
else {
-
- Role_ = [Metadata_ objectForKey:@"Settings"];
+ Settings_ = [Metadata_ objectForKey:@"Settings"];
Packages_ = [Metadata_ objectForKey:@"Packages"];
Sections_ = [Metadata_ objectForKey:@"Sections"];