diff options
Diffstat (limited to 'iphone/FixMyStreet/Classes')
-rw-r--r-- | iphone/FixMyStreet/Classes/AboutViewController.h | 18 | ||||
-rw-r--r-- | iphone/FixMyStreet/Classes/AboutViewController.m | 44 | ||||
-rw-r--r-- | iphone/FixMyStreet/Classes/InputTableViewController.h | 1 | ||||
-rw-r--r-- | iphone/FixMyStreet/Classes/InputTableViewController.m | 37 | ||||
-rw-r--r-- | iphone/FixMyStreet/Classes/SettingsViewController.m | 6 | ||||
-rw-r--r-- | iphone/FixMyStreet/Classes/mysociety.png | bin | 0 -> 4467 bytes |
6 files changed, 92 insertions, 14 deletions
diff --git a/iphone/FixMyStreet/Classes/AboutViewController.h b/iphone/FixMyStreet/Classes/AboutViewController.h new file mode 100644 index 000000000..2f8045434 --- /dev/null +++ b/iphone/FixMyStreet/Classes/AboutViewController.h @@ -0,0 +1,18 @@ +// +// AboutViewController.h +// FixMyStreet +// +// Created by Matthew on 23/10/2008. +// Copyright 2008 __MyCompanyName__. All rights reserved. +// + +#import <UIKit/UIKit.h> + + +@interface AboutViewController : UIViewController { + +} + +-(IBAction)donate:(id)sender; + +@end diff --git a/iphone/FixMyStreet/Classes/AboutViewController.m b/iphone/FixMyStreet/Classes/AboutViewController.m new file mode 100644 index 000000000..98cdbc304 --- /dev/null +++ b/iphone/FixMyStreet/Classes/AboutViewController.m @@ -0,0 +1,44 @@ +// +// AboutViewController.m +// FixMyStreet +// +// Created by Matthew on 23/10/2008. +// Copyright 2008 __MyCompanyName__. All rights reserved. +// + +#import "AboutViewController.h" + +@implementation AboutViewController + +/* +// Override initWithNibName:bundle: to load the view using a nib file then perform additional customization that is not appropriate for viewDidLoad. +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { + // Custom initialization + } + return self; +} +*/ + +// Implement viewDidLoad to do additional setup after loading the view. +- (void)viewDidLoad { + [super viewDidLoad]; + self.title = @"About"; + self.view.backgroundColor = [UIColor groupTableViewBackgroundColor]; +} + + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + // Return YES for supported orientations + return (interfaceOrientation == UIInterfaceOrientationPortrait); +} + +- (void)dealloc { + [super dealloc]; +} + +-(IBAction)donate:(id)sender { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.mysociety.org/donate/"]]; +} + +@end diff --git a/iphone/FixMyStreet/Classes/InputTableViewController.h b/iphone/FixMyStreet/Classes/InputTableViewController.h index eb904d5a1..64bc1d13f 100644 --- a/iphone/FixMyStreet/Classes/InputTableViewController.h +++ b/iphone/FixMyStreet/Classes/InputTableViewController.h @@ -29,6 +29,7 @@ -(IBAction)addPhoto:(id) sender; -(IBAction)gotoSettings:(id)sender firstTime:(BOOL)firstTime; +-(IBAction)gotoAbout:(id)sender; // UIImagePickerControllerDelegate - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo; diff --git a/iphone/FixMyStreet/Classes/InputTableViewController.m b/iphone/FixMyStreet/Classes/InputTableViewController.m index fcf11c879..d1822d22b 100644 --- a/iphone/FixMyStreet/Classes/InputTableViewController.m +++ b/iphone/FixMyStreet/Classes/InputTableViewController.m @@ -10,6 +10,7 @@ #import "SettingsViewController.h" #import "FixMyStreetAppDelegate.h" #import "EditSubjectViewController.h" +#import "AboutViewController.h" @implementation InputTableViewController @@ -40,7 +41,7 @@ // Implement viewDidLoad to do additional setup after loading the view. - (void)viewDidLoad { [super viewDidLoad]; - actionsToDoView.sectionFooterHeight = 0; +// actionsToDoView.sectionFooterHeight = 0; backButton = [[UIBarButtonItem alloc] initWithTitle:@"Cancel" style:UIBarButtonSystemItemCancel target:nil action:nil]; self.navigationItem.backBarButtonItem = backButton; @@ -56,7 +57,7 @@ } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 3; + return 4; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { @@ -159,6 +160,13 @@ cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; } actionSummaryCell = cell; + } else if (indexPath.section == 3) { + if (delegate.name && delegate.name.length && delegate.email && delegate.email.length) { + cell.accessoryType = UITableViewCellAccessoryCheckmark; + } else { + cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + } + cell.text = @"Your details"; } else { cell.text = @"Eh?"; } @@ -173,10 +181,12 @@ [[MyCLController sharedInstance].locationManager startUpdatingLocation]; } else if (indexPath.section == 1) { FixMyStreetAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; - EditSubjectViewController* editSubjectViewController = [[EditSubjectViewController alloc] initWithNibName:@"EditSubjectView" bundle:nil]; + EditSubjectViewController* editSubjectViewController = [[EditSubjectViewController alloc] initWithNibName:@"EditSubjectView" bundle:nil]; [editSubjectViewController setAll:delegate.subject viewTitle:@"Edit summary" placeholder:@"Summary" keyboardType:UIKeyboardTypeDefault capitalisation:UITextAutocapitalizationTypeSentences]; [self.navigationController pushViewController:editSubjectViewController animated:YES]; [editSubjectViewController release]; + } else if (indexPath.section == 3) { + [self gotoSettings:nil firstTime:NO]; } } @@ -267,25 +277,30 @@ // Buttons +-(IBAction)gotoAbout:(id)sender { + backButton.title = @"Back"; + AboutViewController* aboutViewController = [[AboutViewController alloc] initWithNibName:@"AboutView" bundle:nil]; + [UIView beginAnimations:nil context:NULL]; + [UIView setAnimationDuration: 1]; + [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:YES]; + [self.navigationController pushViewController:aboutViewController animated:NO]; + [UIView commitAnimations]; + [aboutViewController release]; +} + -(IBAction)gotoSettings:(id)sender firstTime:(BOOL)firstTime { backButton.title = @"Done"; - SettingsViewController* settingsViewController = [[SettingsViewController alloc] initWithStyle:UITableViewStyleGrouped]; if (firstTime) settingsViewController.firstTime = firstTime; - // [self.navigationController pushViewController:settingsViewController animated:YES]; - [UIView beginAnimations:nil context:NULL]; - [UIView setAnimationDuration: 1]; - [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:YES]; - [self.navigationController pushViewController:settingsViewController animated:NO]; - [UIView commitAnimations]; + [self.navigationController pushViewController:settingsViewController animated:YES]; [settingsViewController release]; } -(void)uploadReport { FixMyStreetAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; if (!delegate.name || !delegate.email) { - [self gotoSettings:nil firstTime:NO]; + [self gotoSettings:nil firstTime:YES]; } else { [delegate uploadReport]; } diff --git a/iphone/FixMyStreet/Classes/SettingsViewController.m b/iphone/FixMyStreet/Classes/SettingsViewController.m index 2e3b2dbed..a56a79691 100644 --- a/iphone/FixMyStreet/Classes/SettingsViewController.m +++ b/iphone/FixMyStreet/Classes/SettingsViewController.m @@ -27,7 +27,7 @@ - (void)viewDidLoad { [super viewDidLoad]; self.title = @"Edit settings"; - self.tableView.sectionHeaderHeight = 27.0; + self.tableView.sectionHeaderHeight = 20.0; self.tableView.sectionFooterHeight = 0.0; self.tableView.scrollEnabled = NO; @@ -39,8 +39,8 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { if (self.firstTime) - return 3; - return 4; + return 4; + return 3; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { diff --git a/iphone/FixMyStreet/Classes/mysociety.png b/iphone/FixMyStreet/Classes/mysociety.png Binary files differnew file mode 100644 index 000000000..8a9280c16 --- /dev/null +++ b/iphone/FixMyStreet/Classes/mysociety.png |