- Timestamp:
- 01/11/10 10:29:58 (3 years ago)
- Location:
- apps/iphone/my.tel/trunk
- Files:
-
- 2 removed
- 2 modified
-
Classes/RecordViewController.m (modified) (6 diffs)
-
English.lproj/TabNaptr.xib (deleted)
-
English.lproj/TabStatus.xib (deleted)
-
VIP.tel.xcodeproj/project.pbxproj (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
apps/iphone/my.tel/trunk/Classes/RecordViewController.m
r615 r625 33 33 34 34 + (RecordViewController *)controllerWithDelegate:(id <TelControllerDelegate>)aDelegate preload:(BOOL)preload { 35 RecordViewController *theC = [[[RecordViewController alloc] initWith NibName:@"TabNaptr" bundle:nil] autorelease];35 RecordViewController *theC = [[[RecordViewController alloc] initWithStyle:UITableViewStyleGrouped] autorelease]; 36 36 theC.delegate = aDelegate; 37 37 theC.skeysDict = [NSMutableDictionary dictionaryWithContentsOfFile: … … 156 156 } 157 157 NSMutableDictionary *uiItem = [[uiArray objectAtIndex:indexPath.row] retain]; 158 if ([[uiItem objectForKey:@"isSupported"] integerValue] == 0) { 159 cell.accessoryType = UITableViewCellAccessoryNone; 160 } else { 161 cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 162 } 163 158 164 [cell.labelService setText:[NSString stringWithFormat:@"%@", [uiItem objectForKey:@"service"]]]; 159 165 [cell.labelLabel setText:[NSString stringWithFormat:@"%@", [uiItem objectForKey:@"longLabel"]]]; … … 174 180 if ([tableView cellForRowAtIndexPath:indexPath].editingStyle == UITableViewCellEditingStyleDelete) { 175 181 // Do not go into the record edit view when the table is in editing mode 182 return nil; 183 } 184 // Do not edit an unsupported NAPTR record 185 NSDictionary *uiItem = [uiArray objectAtIndex:indexPath.row]; 186 if ([[uiItem objectForKey:@"isSupported"] integerValue] == 0) { 176 187 return nil; 177 188 } … … 330 341 // locations: ["x-home", "x-mobile"], editable: true, 331 342 // longLabel: "Some text to describe my home number"} 343 // 344 // we also add the parameter "isSupported": we don't support 345 // editing of custom records where the serviceType doesn't exist 332 346 #ifdef DEBUG 333 347 NSLog(@"Naptr Rec in JSON: %@", [jsonItem descriptionInStringsFileFormat]); … … 340 354 uiItem = [NSMutableDictionary dictionaryWithCapacity:7]; 341 355 356 // default to item supporting editing 357 [uiItem setObject:@"1" forKey:@"isSupported"]; 358 342 359 // set apiId 343 360 [uiItem setObject:(NSString *)[jsonItem objectForKey:@"apiId"] forKey:@"apiId"]; … … 376 393 if ([jsonItem objectForKey:@"serviceKeys"]) { 377 394 NSUInteger i, count = [[jsonItem objectForKey:@"serviceKeys"] count]; 378 for (i = 0; i < count; i++) { 379 NSString *anS = [[jsonItem objectForKey:@"serviceKeys"] objectAtIndex:i]; 380 if (i == 0) { 381 // set the icon image to the first service key 382 if ([imageMappings objectForKey:anS]) { 383 [uiItem setObject:[[RecordViewController imageMappings] objectForKey:anS] forKey:@"imageName"]; 395 if (count == 0) { 396 [sPart setString:@"<unsupported>"]; 397 [uiItem setObject:@"0" forKey:@"isSupported"]; 398 } else { 399 for (i = 0; i < count; i++) { 400 NSString *anS = [[jsonItem objectForKey:@"serviceKeys"] objectAtIndex:i]; 401 if (i == 0) { 402 // set the icon image to the first service key 403 if ([imageMappings objectForKey:anS]) { 404 [uiItem setObject:[[RecordViewController imageMappings] objectForKey:anS] forKey:@"imageName"]; 405 } else { 406 [uiItem setObject:[[RecordViewController imageMappings] objectForKey:@"unknown"] forKey:@"imageName"]; 407 } 408 // Check for mobile phones (yes mobile phones SHOULD have been their own 409 // type, but blame the IETF for this ridiculous state of things) 410 if ([anS isEqualToString:@"voice"]) 411 couldbeMobilePhone = YES; // Could be a mobile. see below 384 412 } else { 385 [ uiItem setObject:[[RecordViewController imageMappings] objectForKey:@"unknown"] forKey:@"imageName"];413 [sPart appendString:@" & "]; 386 414 } 387 // Check for mobile phones (yes mobile phones SHOULD have been their own 388 // type, but blame the IETF for this ridiculous state of things) 389 if ([anS isEqualToString:@"voice"]) 390 couldbeMobilePhone = YES; // Could be a mobile. see below 391 } else { 392 [sPart appendString:@" & "]; 393 } 394 if ([self.skeysDict objectForKey:anS]) { 395 [sPart appendString:[self.skeysDict objectForKey:anS]]; 396 } else { 397 [sPart appendString:anS]; 398 } 415 if ([self.skeysDict objectForKey:anS]) { 416 [sPart appendString:[self.skeysDict objectForKey:anS]]; 417 } else { 418 [sPart appendString:anS]; 419 } 420 } 399 421 } 400 } 422 } else { 423 [sPart setString:@"<unsupported>"]; 424 [uiItem setObject:@"0" forKey:@"isSupported"]; 425 } 426 401 427 if ([jsonItem objectForKey:@"locations"]) { 402 428 NSUInteger i, count = [[jsonItem objectForKey:@"locations"] count]; -
apps/iphone/my.tel/trunk/VIP.tel.xcodeproj/project.pbxproj
r622 r625 138 138 38B96AF10F30B1BA006772B4 /* button-set-tel.png in Resources */ = {isa = PBXBuildFile; fileRef = 38B96AF00F30B1BA006772B4 /* button-set-tel.png */; }; 139 139 38D9CFF610CFB65100EC529B /* AccountEditCells.xib in Resources */ = {isa = PBXBuildFile; fileRef = 38D9CFF510CFB65100EC529B /* AccountEditCells.xib */; }; 140 38D9D34210CFFB8000EC529B /* TabNaptr.xib in Resources */ = {isa = PBXBuildFile; fileRef = 38D9D34110CFFB8000EC529B /* TabNaptr.xib */; };141 140 38D9D34410CFFB9A00EC529B /* TabLoc.xib in Resources */ = {isa = PBXBuildFile; fileRef = 38D9D34310CFFB9A00EC529B /* TabLoc.xib */; }; 142 38D9D34810CFFBB200EC529B /* TabStatus.xib in Resources */ = {isa = PBXBuildFile; fileRef = 38D9D34710CFFBB200EC529B /* TabStatus.xib */; };143 141 38DA3A4C107A30C600C4DF56 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 38DA3A4B107A30C600C4DF56 /* MapKit.framework */; }; 144 142 38DA3A55107A326900C4DF56 /* TelMapAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 38DA3A54107A326900C4DF56 /* TelMapAnnotation.m */; }; … … 334 332 38D4C1810EF6967C00A190A1 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = English; path = English.lproj/ServiceTypes.plist; plistStructureDefinitionIdentifier = "<none>"; sourceTree = "<group>"; }; 335 333 38D9CFF510CFB65100EC529B /* AccountEditCells.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AccountEditCells.xib; sourceTree = "<group>"; }; 336 38D9D33110CFF80900EC529B /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/TabNaptr.xib; sourceTree = "<group>"; };337 334 38D9D33210CFF80900EC529B /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/TabLoc.xib; sourceTree = "<group>"; }; 338 38D9D33410CFF80900EC529B /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/TabStatus.xib; sourceTree = "<group>"; };339 335 38DA3A4B107A30C600C4DF56 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; 340 336 38DA3A53107A326900C4DF56 /* TelMapAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TelMapAnnotation.h; sourceTree = "<group>"; }; … … 679 675 38ACC4400F9A2B26004B5A31 /* MainWindow.xib */, 680 676 38ACC4420F9A2B26004B5A31 /* AboutView.xib */, 681 38D9D34110CFFB8000EC529B /* TabNaptr.xib */,682 677 38D9D34310CFFB9A00EC529B /* TabLoc.xib */, 683 38D9D34710CFFBB200EC529B /* TabStatus.xib */,684 678 38A33B06108F168A0067C20A /* ProfileRecords.xib */, 685 679 38ACC4460F9A2B26004B5A31 /* Keyword Group Views.xib */, … … 865 859 382CC3D510CE5E9B00DFCF93 /* button-bg-black.png in Resources */, 866 860 38D9CFF610CFB65100EC529B /* AccountEditCells.xib in Resources */, 867 38D9D34210CFFB8000EC529B /* TabNaptr.xib in Resources */,868 861 38D9D34410CFFB9A00EC529B /* TabLoc.xib in Resources */, 869 38D9D34810CFFBB200EC529B /* TabStatus.xib in Resources */,870 862 385F284A10F6136A00BCBB14 /* KeywordTypesLongNames.plist in Resources */, 871 863 ); … … 1055 1047 sourceTree = "<group>"; 1056 1048 }; 1057 38D9D34110CFFB8000EC529B /* TabNaptr.xib */ = {1058 isa = PBXVariantGroup;1059 children = (1060 38D9D33110CFF80900EC529B /* English */,1061 );1062 name = TabNaptr.xib;1063 sourceTree = "<group>";1064 };1065 1049 38D9D34310CFFB9A00EC529B /* TabLoc.xib */ = { 1066 1050 isa = PBXVariantGroup; … … 1069 1053 ); 1070 1054 name = TabLoc.xib; 1071 sourceTree = "<group>";1072 };1073 38D9D34710CFFBB200EC529B /* TabStatus.xib */ = {1074 isa = PBXVariantGroup;1075 children = (1076 38D9D33410CFF80900EC529B /* English */,1077 );1078 name = TabStatus.xib;1079 1055 sourceTree = "<group>"; 1080 1056 };








