From 0811f6a45bdb030d5ded41eb332fa5ed2fc9b8b6 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Tue, 17 Jul 2012 22:36:55 -0700 Subject: [PATCH] [ios] Removed unused code --- iphone/Maps/Bookmarks/AddBookmarkVC.h | 13 -- iphone/Maps/Bookmarks/AddBookmarkVC.mm | 145 --------------------- iphone/Maps/Bookmarks/BookmarksVC.mm | 18 +-- iphone/Maps/Maps.xcodeproj/project.pbxproj | 26 ++-- 4 files changed, 10 insertions(+), 192 deletions(-) delete mode 100644 iphone/Maps/Bookmarks/AddBookmarkVC.h delete mode 100644 iphone/Maps/Bookmarks/AddBookmarkVC.mm diff --git a/iphone/Maps/Bookmarks/AddBookmarkVC.h b/iphone/Maps/Bookmarks/AddBookmarkVC.h deleted file mode 100644 index b93eb0c346..0000000000 --- a/iphone/Maps/Bookmarks/AddBookmarkVC.h +++ /dev/null @@ -1,13 +0,0 @@ -#import - -@class BalloonView; - -@interface AddBookmarkVC : UITableViewController -{ - // @TODO store as a property to retain reference - BalloonView * m_balloon; -} - -- (id) initWithBalloonView:(BalloonView *)view; - -@end diff --git a/iphone/Maps/Bookmarks/AddBookmarkVC.mm b/iphone/Maps/Bookmarks/AddBookmarkVC.mm deleted file mode 100644 index 8d08e296e2..0000000000 --- a/iphone/Maps/Bookmarks/AddBookmarkVC.mm +++ /dev/null @@ -1,145 +0,0 @@ -#import "AddBookmarkVC.h" -#import "BalloonView.h" -#import "Framework.h" -#import "SelectSetVC.h" -#import "SelectColorVC.h" - -@implementation AddBookmarkVC - -- (id) initWithBalloonView:(BalloonView *)view -{ - self = [super initWithStyle:UITableViewStyleGrouped]; - if (self) - { - m_balloon = view; - - self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(onAddClicked)]; - self.title = NSLocalizedString(@"Add Bookmark", @"Add bookmark dialog title"); - } - return self; -} - -- (void)onAddClicked -{ - GetFramework().AddBookmark([m_balloon.setName UTF8String], - Bookmark(m2::PointD(m_balloon.globalPosition.x, m_balloon.globalPosition.y), - [m_balloon.title UTF8String], [m_balloon.color UTF8String])); - [m_balloon hide]; - // Don't forget to hide navbar - [self.navigationController setNavigationBarHidden:YES animated:YES]; - [self.navigationController popToRootViewControllerAnimated:YES]; -} - -- (void)viewWillAppear:(BOOL)animated -{ - [self.navigationController setNavigationBarHidden:NO animated:YES]; - // Update the table - we can display it after changing set or color - [self.tableView reloadData]; - [super viewWillAppear:animated]; -} - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation -{ - return YES; -} - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView -{ - return 1; -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section -{ - return 3; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - NSString * cellId = @"DefaultCell"; - switch (indexPath.row) - { - case 0: cellId = @"NameCell"; break; - case 1: cellId = @"SetCell"; break; - case 2: cellId = @"ColorCell"; break; - } - - UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellId]; - if (!cell) - { - cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellId] autorelease]; - switch (indexPath.row) - { - case 0: - { - UITextField * f = [[[UITextField alloc] initWithFrame:CGRectMake(0, 0, 200, 21)] autorelease]; - f.textAlignment = UITextAlignmentRight; - f.returnKeyType = UIReturnKeyDone; - f.clearButtonMode = UITextFieldViewModeWhileEditing; - f.autocorrectionType = UITextAutocorrectionTypeNo; - f.delegate = self; - f.placeholder = NSLocalizedString(@"Name", @"Add bookmark dialog - bookmark name"); - f.textColor = cell.detailTextLabel.textColor; - cell.accessoryView = f; - cell.textLabel.text = NSLocalizedString(@"Name", @"Add bookmark dialog - bookmark name"); - cell.selectionStyle = UITableViewCellSelectionStyleNone; - } - break; - - case 1: - cell.textLabel.text = NSLocalizedString(@"Set", @"Add bookmark dialog - bookmark set"); - break; - - case 2: - cell.textLabel.text = NSLocalizedString(@"Color", @"Add bookmark dialog - bookmark color"); - break; - } - } - // Update variable cell values - switch (indexPath.row) - { - case 0: - ((UITextField *)(cell.accessoryView)).text = m_balloon.title; - break; - - case 1: - cell.detailTextLabel.text = m_balloon.setName; - break; - - case 2: - cell.accessoryView = m_balloon.pinImage; - break; - } - return cell; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath -{ - [[tableView cellForRowAtIndexPath:indexPath] setSelected:NO animated:YES]; - - switch (indexPath.row) - { - case 1: - { - SelectSetVC * vc = [[SelectSetVC alloc] initWithBalloonView:m_balloon andEditMode:YES]; - [self.navigationController pushViewController:vc animated:YES]; - [vc release]; - } - break; - - case 2: - { - SelectColorVC * vc = [[SelectColorVC alloc] initWithBalloonView:m_balloon]; - [self.navigationController pushViewController:vc animated:YES]; - [vc release]; - } - break; - } -} - -- (BOOL)textFieldShouldReturn:(UITextField *)textField -{ - [textField resignFirstResponder]; - return NO; -} - -@end diff --git a/iphone/Maps/Bookmarks/BookmarksVC.mm b/iphone/Maps/Bookmarks/BookmarksVC.mm index c9eb8f2bab..41c244939a 100644 --- a/iphone/Maps/Bookmarks/BookmarksVC.mm +++ b/iphone/Maps/Bookmarks/BookmarksVC.mm @@ -53,7 +53,7 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if (section == 0) - return 2; + return 1; BookmarkCategory * cat = GetFramework().GetBmCategory([m_balloon.setName UTF8String]); if (cat) return cat->GetBookmarksCount(); @@ -175,20 +175,4 @@ } } -/* -// Override to support rearranging the table view. -- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath -{ -} -*/ - -/* -// Override to support conditional rearranging of the table view. -- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath -{ - // Return NO if you do not want the item to be re-orderable. - return YES; -} -*/ - @end diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 449bc392dd..6ace2d58b9 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -118,8 +118,6 @@ FA4B0A1415136C4C00758203 /* World.mwm.nosearch in Resources */ = {isa = PBXBuildFile; fileRef = FA4B0A1315136C4C00758203 /* World.mwm.nosearch */; }; FA4B0A16151372BA00758203 /* countries.txt.nosearch in Resources */ = {isa = PBXBuildFile; fileRef = FA4B0A15151372BA00758203 /* countries.txt.nosearch */; }; FA500588128907F0002961F0 /* visibility.txt in Resources */ = {isa = PBXBuildFile; fileRef = FA500587128907F0002961F0 /* visibility.txt */; }; - FA5D4F171557F79900E7D8BB /* AddBookmarkVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA5D4F141557F79900E7D8BB /* AddBookmarkVC.mm */; }; - FA5D4F181557F79900E7D8BB /* AddBookmarkVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA5D4F141557F79900E7D8BB /* AddBookmarkVC.mm */; }; FA5D4F191557F79900E7D8BB /* PlacePageVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA5D4F161557F79900E7D8BB /* PlacePageVC.mm */; }; FA5D4F1A1557F79900E7D8BB /* PlacePageVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA5D4F161557F79900E7D8BB /* PlacePageVC.mm */; }; FA64D9A913F975AD00350ECF /* types.txt in Resources */ = {isa = PBXBuildFile; fileRef = FA64D9A813F975AD00350ECF /* types.txt */; }; @@ -1337,7 +1335,7 @@ EE16192B126E374500622BD0 /* RenderContext.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; name = RenderContext.hpp; path = Classes/RenderContext.hpp; sourceTree = SOURCE_ROOT; }; EE164810135CEE49003B8A3E /* 06_code2000.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 06_code2000.ttf; path = ../../data/06_code2000.ttf; sourceTree = SOURCE_ROOT; }; EE583CBA12F773F00042CBE3 /* unicode_blocks.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = unicode_blocks.txt; path = ../../data/unicode_blocks.txt; sourceTree = ""; }; - EE5A34E5156FCB9500E34FFE /* libgui.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libgui.a"; sourceTree = SOURCE_ROOT; }; + EE5A34E5156FCB9500E34FFE /* libgui.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgui.a; sourceTree = SOURCE_ROOT; }; EE7F297C1219ECA300EB67A9 /* RenderBuffer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; name = RenderBuffer.hpp; path = Classes/RenderBuffer.hpp; sourceTree = SOURCE_ROOT; }; EE7F297D1219ECA300EB67A9 /* RenderBuffer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = RenderBuffer.mm; path = Classes/RenderBuffer.mm; sourceTree = SOURCE_ROOT; }; EE7F297E1219ECA300EB67A9 /* RenderContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = RenderContext.mm; path = Classes/RenderContext.mm; sourceTree = SOURCE_ROOT; }; @@ -1363,21 +1361,21 @@ F7DD848614FE7FE0005695E1 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = ""; }; F7FDD822147F30CC005900FA /* drules_proto.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; name = drules_proto.bin; path = ../../data/drules_proto.bin; sourceTree = ""; }; FA04373112CAB83F00017494 /* libstorage.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libstorage.a; sourceTree = SOURCE_ROOT; }; - FA0545E0155C22D4001F4E37 /* placemark-blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = placemark-blue.png; path = Bookmarks/placemark-blue.png; sourceTree = SOURCE_ROOT; }; + FA0545E0155C22D4001F4E37 /* placemark-blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placemark-blue.png"; path = "Bookmarks/placemark-blue.png"; sourceTree = SOURCE_ROOT; }; FA0545E1155C22D4001F4E37 /* placemark-blue@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placemark-blue@2x.png"; path = "Bookmarks/placemark-blue@2x.png"; sourceTree = SOURCE_ROOT; }; - FA0545E2155C22D4001F4E37 /* placemark-brown.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = placemark-brown.png; path = Bookmarks/placemark-brown.png; sourceTree = SOURCE_ROOT; }; + FA0545E2155C22D4001F4E37 /* placemark-brown.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placemark-brown.png"; path = "Bookmarks/placemark-brown.png"; sourceTree = SOURCE_ROOT; }; FA0545E3155C22D4001F4E37 /* placemark-brown@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placemark-brown@2x.png"; path = "Bookmarks/placemark-brown@2x.png"; sourceTree = SOURCE_ROOT; }; - FA0545E4155C22D4001F4E37 /* placemark-green.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = placemark-green.png; path = Bookmarks/placemark-green.png; sourceTree = SOURCE_ROOT; }; + FA0545E4155C22D4001F4E37 /* placemark-green.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placemark-green.png"; path = "Bookmarks/placemark-green.png"; sourceTree = SOURCE_ROOT; }; FA0545E5155C22D4001F4E37 /* placemark-green@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placemark-green@2x.png"; path = "Bookmarks/placemark-green@2x.png"; sourceTree = SOURCE_ROOT; }; - FA0545E6155C22D4001F4E37 /* placemark-orange.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = placemark-orange.png; path = Bookmarks/placemark-orange.png; sourceTree = SOURCE_ROOT; }; + FA0545E6155C22D4001F4E37 /* placemark-orange.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placemark-orange.png"; path = "Bookmarks/placemark-orange.png"; sourceTree = SOURCE_ROOT; }; FA0545E7155C22D4001F4E37 /* placemark-orange@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placemark-orange@2x.png"; path = "Bookmarks/placemark-orange@2x.png"; sourceTree = SOURCE_ROOT; }; - FA0545E8155C22D4001F4E37 /* placemark-pink.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = placemark-pink.png; path = Bookmarks/placemark-pink.png; sourceTree = SOURCE_ROOT; }; + FA0545E8155C22D4001F4E37 /* placemark-pink.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placemark-pink.png"; path = "Bookmarks/placemark-pink.png"; sourceTree = SOURCE_ROOT; }; FA0545E9155C22D4001F4E37 /* placemark-pink@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placemark-pink@2x.png"; path = "Bookmarks/placemark-pink@2x.png"; sourceTree = SOURCE_ROOT; }; - FA0545EA155C22D4001F4E37 /* placemark-purple.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = placemark-purple.png; path = Bookmarks/placemark-purple.png; sourceTree = SOURCE_ROOT; }; + FA0545EA155C22D4001F4E37 /* placemark-purple.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placemark-purple.png"; path = "Bookmarks/placemark-purple.png"; sourceTree = SOURCE_ROOT; }; FA0545EB155C22D4001F4E37 /* placemark-purple@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placemark-purple@2x.png"; path = "Bookmarks/placemark-purple@2x.png"; sourceTree = SOURCE_ROOT; }; - FA0545EC155C22D4001F4E37 /* placemark-red.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = placemark-red.png; path = Bookmarks/placemark-red.png; sourceTree = SOURCE_ROOT; }; + FA0545EC155C22D4001F4E37 /* placemark-red.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placemark-red.png"; path = "Bookmarks/placemark-red.png"; sourceTree = SOURCE_ROOT; }; FA0545ED155C22D4001F4E37 /* placemark-red@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placemark-red@2x.png"; path = "Bookmarks/placemark-red@2x.png"; sourceTree = SOURCE_ROOT; }; - FA0545EE155C22D4001F4E37 /* placemark-yellow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = placemark-yellow.png; path = Bookmarks/placemark-yellow.png; sourceTree = SOURCE_ROOT; }; + FA0545EE155C22D4001F4E37 /* placemark-yellow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placemark-yellow.png"; path = "Bookmarks/placemark-yellow.png"; sourceTree = SOURCE_ROOT; }; FA0545EF155C22D4001F4E37 /* placemark-yellow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "placemark-yellow@2x.png"; path = "Bookmarks/placemark-yellow@2x.png"; sourceTree = SOURCE_ROOT; }; FA054610155C465E001F4E37 /* SelectSetVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SelectSetVC.h; path = Bookmarks/SelectSetVC.h; sourceTree = SOURCE_ROOT; }; FA054611155C465E001F4E37 /* SelectSetVC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SelectSetVC.mm; path = Bookmarks/SelectSetVC.mm; sourceTree = SOURCE_ROOT; }; @@ -1414,8 +1412,6 @@ FA4B0A1315136C4C00758203 /* World.mwm.nosearch */ = {isa = PBXFileReference; lastKnownFileType = file; name = World.mwm.nosearch; path = ../../data/World.mwm.nosearch; sourceTree = ""; }; FA4B0A15151372BA00758203 /* countries.txt.nosearch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = countries.txt.nosearch; path = ../../data/countries.txt.nosearch; sourceTree = ""; }; FA500587128907F0002961F0 /* visibility.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = visibility.txt; path = ../../data/visibility.txt; sourceTree = SOURCE_ROOT; }; - FA5D4F131557F79900E7D8BB /* AddBookmarkVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddBookmarkVC.h; path = Bookmarks/AddBookmarkVC.h; sourceTree = SOURCE_ROOT; }; - FA5D4F141557F79900E7D8BB /* AddBookmarkVC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AddBookmarkVC.mm; path = Bookmarks/AddBookmarkVC.mm; sourceTree = SOURCE_ROOT; }; FA5D4F151557F79900E7D8BB /* PlacePageVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlacePageVC.h; path = Bookmarks/PlacePageVC.h; sourceTree = SOURCE_ROOT; }; FA5D4F161557F79900E7D8BB /* PlacePageVC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PlacePageVC.mm; path = Bookmarks/PlacePageVC.mm; sourceTree = SOURCE_ROOT; }; FA64D9A813F975AD00350ECF /* types.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = types.txt; path = ../../data/types.txt; sourceTree = SOURCE_ROOT; }; @@ -2290,8 +2286,6 @@ FAA614B7155F16950031C345 /* AddSetVC.mm */, FA054610155C465E001F4E37 /* SelectSetVC.h */, FA054611155C465E001F4E37 /* SelectSetVC.mm */, - FA5D4F131557F79900E7D8BB /* AddBookmarkVC.h */, - FA5D4F141557F79900E7D8BB /* AddBookmarkVC.mm */, FA5D4F151557F79900E7D8BB /* PlacePageVC.h */, FA5D4F161557F79900E7D8BB /* PlacePageVC.mm */, FA36B80315403A4F004560CC /* BalloonView.h */, @@ -4222,7 +4216,6 @@ F7B90CD31521E6D200C054EE /* CustomNavigationView.mm in Sources */, FA36B80B15403A4F004560CC /* BalloonView.mm in Sources */, FA36B80D15403A4F004560CC /* BookmarksVC.mm in Sources */, - FA5D4F171557F79900E7D8BB /* AddBookmarkVC.mm in Sources */, FA5D4F191557F79900E7D8BB /* PlacePageVC.mm in Sources */, FAF457E715597D4600DCCC49 /* Framework.cpp in Sources */, FA054612155C465E001F4E37 /* SelectSetVC.mm in Sources */, @@ -4255,7 +4248,6 @@ F7B90CD41521E6D200C054EE /* CustomNavigationView.mm in Sources */, FA36B80C15403A4F004560CC /* BalloonView.mm in Sources */, FA36B80E15403A4F004560CC /* BookmarksVC.mm in Sources */, - FA5D4F181557F79900E7D8BB /* AddBookmarkVC.mm in Sources */, FA5D4F1A1557F79900E7D8BB /* PlacePageVC.mm in Sources */, FAF457E815597D4600DCCC49 /* Framework.cpp in Sources */, FA054613155C465E001F4E37 /* SelectSetVC.mm in Sources */,