diff --git a/OSM POI Editor.xcodeproj/project.pbxproj b/OSM POI Editor.xcodeproj/project.pbxproj index a5241fd..34755db 100644 --- a/OSM POI Editor.xcodeproj/project.pbxproj +++ b/OSM POI Editor.xcodeproj/project.pbxproj @@ -76,6 +76,7 @@ 63E4BF3114E0728200E0BD46 /* NSDataAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 63E4BF2E14E0728200E0BD46 /* NSDataAdditions.m */; }; 63E4BF3214E0728200E0BD46 /* TBXML.m in Sources */ = {isa = PBXBuildFile; fileRef = 63E4BF3014E0728200E0BD46 /* TBXML.m */; }; 63E5B13614EDAF2E007E9BAF /* location.png in Resources */ = {isa = PBXBuildFile; fileRef = 63E5B13514EDAF2E007E9BAF /* location.png */; }; + 63F9CCA514F32B2E00308DE1 /* iphone_delete_button.png in Resources */ = {isa = PBXBuildFile; fileRef = 63F9CCA414F32B2E00308DE1 /* iphone_delete_button.png */; }; 63FFDC6614E480DF00701DEC /* OPETagInterpreter.m in Sources */ = {isa = PBXBuildFile; fileRef = 63FFDC6514E480DF00701DEC /* OPETagInterpreter.m */; }; /* End PBXBuildFile section */ @@ -323,6 +324,7 @@ 63E4BF2F14E0728200E0BD46 /* TBXML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TBXML.h; sourceTree = ""; }; 63E4BF3014E0728200E0BD46 /* TBXML.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TBXML.m; sourceTree = ""; }; 63E5B13514EDAF2E007E9BAF /* location.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = location.png; sourceTree = ""; }; + 63F9CCA414F32B2E00308DE1 /* iphone_delete_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = iphone_delete_button.png; sourceTree = ""; }; 63FFDC6414E480DF00701DEC /* OPETagInterpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OPETagInterpreter.h; path = ../OPETagInterpreter.h; sourceTree = ""; }; 63FFDC6514E480DF00701DEC /* OPETagInterpreter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OPETagInterpreter.m; path = ../OPETagInterpreter.m; sourceTree = ""; }; /* End PBXFileReference section */ @@ -619,6 +621,7 @@ 637A89FB14E1B426003F656F /* Resources */ = { isa = PBXGroup; children = ( + 63F9CCA414F32B2E00308DE1 /* iphone_delete_button.png */, 63E5B13514EDAF2E007E9BAF /* location.png */, 6345E57B14E2FD1200F55486 /* Blue_Dot.png */, 63E279EF14E2073C009D02BD /* Blue_Marker.png */, @@ -845,6 +848,7 @@ 6383948214EC4DDD00C74A57 /* OPEInfoViewController.xib in Resources */, 6383949814EC7DAC00C74A57 /* GTMOAuthViewTouch.xib in Resources */, 63E5B13614EDAF2E007E9BAF /* location.png in Resources */, + 63F9CCA514F32B2E00308DE1 /* iphone_delete_button.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/OSM POI Editor.xcodeproj/project.xcworkspace/xcuserdata/David.xcuserdatad/UserInterfaceState.xcuserstate b/OSM POI Editor.xcodeproj/project.xcworkspace/xcuserdata/David.xcuserdatad/UserInterfaceState.xcuserstate index 9064b63..2084cdd 100644 Binary files a/OSM POI Editor.xcodeproj/project.xcworkspace/xcuserdata/David.xcuserdatad/UserInterfaceState.xcuserstate and b/OSM POI Editor.xcodeproj/project.xcworkspace/xcuserdata/David.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/OSM POI Editor.xcodeproj/xcuserdata/David.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/OSM POI Editor.xcodeproj/xcuserdata/David.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist index 5746a4f..3a9b69a 100644 --- a/OSM POI Editor.xcodeproj/xcuserdata/David.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist +++ b/OSM POI Editor.xcodeproj/xcuserdata/David.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -37,11 +37,11 @@ continueAfterRunningActions = "No" isPathRelative = "1" filePath = "OSM POI Editor/OPENodeViewController.m" - timestampString = "351478612.023022" + timestampString = "351483956.720965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "213" - endingLineNumber = "213" + startingLineNumber = "247" + endingLineNumber = "247" landmarkName = "-viewDidAppear:" landmarkType = "5"> @@ -51,25 +51,11 @@ continueAfterRunningActions = "No" isPathRelative = "1" filePath = "OSM POI Editor/OPEOSMData.m" - timestampString = "351212657.816714" + timestampString = "351492079.359031" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "187" - endingLineNumber = "187" - landmarkName = "-openChangesetWithMessage:" - landmarkType = "5"> - - @@ -98,7 +84,7 @@ endingColumnNumber = "9223372036854775807" startingLineNumber = "19" endingLineNumber = "19" - landmarkName = "node,theNewNode" + landmarkName = "node,theNewNode,type" landmarkType = "19"> diff --git a/OSM POI Editor/OPENodeViewController.h b/OSM POI Editor/OPENodeViewController.h index 9289340..0f7e989 100644 --- a/OSM POI Editor/OPENodeViewController.h +++ b/OSM POI Editor/OPENodeViewController.h @@ -23,8 +23,11 @@ @property (nonatomic, strong) OPENode * theNewNode; @property (nonatomic, strong) IBOutlet UITableView* tableView; @property (nonatomic, strong) NSArray * catAndType; +@property (nonatomic, strong) NSString * type; +@property (nonatomic, strong) IBOutlet UIButton * deleteButton; - (void) saveButtonPressed; +- (void) deleteButtonPressed; diff --git a/OSM POI Editor/OPENodeViewController.m b/OSM POI Editor/OPENodeViewController.m index 543a5c1..bbb9f38 100644 --- a/OSM POI Editor/OPENodeViewController.m +++ b/OSM POI Editor/OPENodeViewController.m @@ -16,15 +16,16 @@ @implementation OPENodeViewController -@synthesize node, theNewNode; +@synthesize node, theNewNode, type; @synthesize tableView; @synthesize catAndType; +@synthesize deleteButton; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { - // Custom initialization + } return self; } @@ -49,6 +50,21 @@ - (void)viewDidLoad [[self navigationItem] setRightBarButtonItem:saveButton]; + + deleteButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + [deleteButton setTitle:@"Delete" forState:UIControlStateNormal]; + [self.deleteButton setBackgroundImage:[[UIImage imageNamed:@"iphone_delete_button.png"] + stretchableImageWithLeftCapWidth:8.0f + topCapHeight:0.0f] + forState:UIControlStateNormal]; + + [self.deleteButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + self.deleteButton.titleLabel.font = [UIFont boldSystemFontOfSize:20]; + self.deleteButton.titleLabel.shadowColor = [UIColor lightGrayColor]; + self.deleteButton.titleLabel.shadowOffset = CGSizeMake(0, -1); + [self.deleteButton addTarget:self action:@selector(deleteButtonPressed) forControlEvents:UIControlEventTouchUpInside]; + + theNewNode = [[OPENode alloc] initWithNode:node]; tagInterpreter = [OPETagInterpreter sharedInstance]; @@ -61,7 +77,7 @@ - (void)viewDidLoad - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections. - return 2; + return 3; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { @@ -79,7 +95,7 @@ - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInte return @"Category"; } else if (section == 2) { - return @"Value2 Style"; + return @""; //Delete Button Header } else { return @"Subtitle Style"; @@ -91,6 +107,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N NSString *CellIdentifier1 = @"Cell_Section_1"; NSString *CellIdentifier2 = @"Cell_Section_2"; + NSString *CellIdentifier3 = @"Cell_Section_3"; NSArray * catAndTypeName = [[NSArray alloc] initWithObjects:@"Category",@"Type", nil]; @@ -103,6 +120,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1]; } cell.textLabel.text = [theNewNode.tags objectForKey:@"name"]; + cell.accessoryType= UITableViewCellAccessoryDisclosureIndicator; } else if (indexPath.section == 1) { @@ -112,9 +130,20 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N } cell.textLabel.text = [catAndTypeName objectAtIndex:indexPath.row]; cell.detailTextLabel.text = [catAndType objectAtIndex:indexPath.row]; + cell.accessoryType= UITableViewCellAccessoryDisclosureIndicator; //cell.detailTextLabel.text = [NSString stringWithFormat:@"%d",indexPath.row]; } - cell.accessoryType= UITableViewCellAccessoryDisclosureIndicator; + else if (indexPath.section == 2) { + cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier3]; + if(cell == nil) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier3]; + } + + deleteButton.frame = cell.contentView.bounds; + + [cell.contentView addSubview:deleteButton]; + } + // Configure the cell... //cell.textLabel.text = @"Text Label"; @@ -167,6 +196,11 @@ - (void) saveButtonPressed [data deleteXmlNode:node withChangeset:change]; } +- (void) deleteButtonPressed +{ + NSLog(@"Delete Button Pressed"); +} + - (void) setText:(NSString *)text { [theNewNode.tags setObject:text forKey:@"name"]; diff --git a/OSM POI Editor/OPENodeViewController.xib b/OSM POI Editor/OPENodeViewController.xib index 6101926..db12415 100644 --- a/OSM POI Editor/OPENodeViewController.xib +++ b/OSM POI Editor/OPENodeViewController.xib @@ -210,24 +210,27 @@ AAgACAAIAAEAAQABAAE - 37 + 39 OPENodeViewController UIViewController - - tableView - UITableView - - - tableView - + + UIButton + UITableView + + + + deleteButton + UIButton + + tableView UITableView - + IBProjectSource ./Classes/OPENodeViewController.h diff --git a/OSM POI Editor/OPEOSMData.m b/OSM POI Editor/OPEOSMData.m index 90142ec..b9ded2a 100644 --- a/OSM POI Editor/OPEOSMData.m +++ b/OSM POI Editor/OPEOSMData.m @@ -157,10 +157,7 @@ - (void) deleteNode: (OPENode *) node } - (NSInteger) openChangesetWithMessage: (NSString *) message -{ - - - +{ BOOL didAuth = NO; BOOL canAuth = NO; if (auth) { diff --git a/OSM POI Editor/OPETextEdit.m b/OSM POI Editor/OPETextEdit.m index 35b3f8c..64a413e 100644 --- a/OSM POI Editor/OPETextEdit.m +++ b/OSM POI Editor/OPETextEdit.m @@ -75,8 +75,8 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface - (void) saveButtonPressed { - [self.navigationController popViewControllerAnimated:YES]; [[self delegate] setText:textView.text]; + [self.navigationController popViewControllerAnimated:YES]; } @end diff --git a/OSM POI Editor/OPEViewController.m b/OSM POI Editor/OPEViewController.m index 2c75d77..2c9b11e 100644 --- a/OSM POI Editor/OPEViewController.m +++ b/OSM POI Editor/OPEViewController.m @@ -220,7 +220,9 @@ - (IBAction)addPointButtonPressed:(id)sender -(IBAction)locationButtonPressed:(id)sender { + CLLocationCoordinate2D currentLocation = [[locationManager location] coordinate]; + [mapView moveToLatLong: currentLocation]; } - (IBAction)infoButtonPressed:(id)sender diff --git a/iphone_delete_button.png b/iphone_delete_button.png new file mode 100644 index 0000000..2ea897e Binary files /dev/null and b/iphone_delete_button.png differ