Changeset 671
- Timestamp:
- 01/19/10 15:57:18 (8 weeks ago)
- Location:
- apps/iphone/my.tel/trunk/Classes
- Files:
-
- 2 modified
-
RootViewController.h (modified) (1 diff)
-
RootViewController.m (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
apps/iphone/my.tel/trunk/Classes/RootViewController.h
r653 r671 17 17 kKRootTableViewSectionAccounts, // Existing .tel accounts 18 18 kKRootTableViewSectionAddAccount, // Single section to add an account 19 kKRootTableViewSectionBuyAccount, // Single section to buy an account 19 20 kKRootTableViewSectionsCount, // Keep this last to get the count of sections 20 21 // Anything below is disabled 21 22 // move it above the SectionsCount item to enable it 22 kKRootTableViewSectionBuyAccount, // Single section to buy an account23 23 }; 24 24 -
apps/iphone/my.tel/trunk/Classes/RootViewController.m
r659 r671 33 33 self.title = @"Accounts"; 34 34 self.tableView.allowsSelectionDuringEditing = YES; 35 self.view.backgroundColor = [UIColor darkGrayColor];35 // self.view.backgroundColor = [UIColor darkGrayColor]; 36 36 self.navigationItem.rightBarButtonItem = self.editButtonItem; 37 37 self.navigationItem.rightBarButtonItem.enabled = YES; … … 158 158 if (forced || mustLogin) { 159 159 NSDictionary *selectedAccount = [self.accountsArray objectAtIndex:self.currentAccountIndex]; 160 NSString *apiRoot = [selectedAccount objectForKey:@"apiUrl"]; 161 if ((apiRoot == nil) || [apiRoot length] == 0) { 162 // nonexistent api Root URL. Send to edit view 163 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Missing API URL" 164 message:@"Please verify your account settings" 165 delegate:nil 166 cancelButtonTitle:@"OK" 167 otherButtonTitles:nil]; 168 [alert show]; 169 [alert release]; 170 [self objectWillGetEditedInController:self]; 171 return; 172 } 160 173 [[[UIApplication sharedApplication] keyWindow] addSubview:[MyTelConnect sharedInstance].view]; 161 174 [[MyTelConnect sharedInstance] loginToTelAccountWithName:[selectedAccount objectForKey:@"userName"] … … 275 288 } 276 289 cell.textLabel.textAlignment = UITextAlignmentCenter; 277 cell.textLabel.text = @"Add a ccount";290 cell.textLabel.text = @"Add a .tel account"; 278 291 break; 279 292 case kKRootTableViewSectionBuyAccount: … … 293 306 } 294 307 308 - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 309 NSString *footerString = nil; 310 switch (section) { 311 case kKRootTableViewSectionBuyAccount: 312 footerString = @"Don't own a .tel domain?"; 313 break; 314 default: 315 break; 316 } 317 return footerString; 318 } 319 320 - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section { 321 NSString *footerString = nil; 322 switch (section) { 323 case kKRootTableViewSectionBuyAccount: 324 footerString = @"Download DomainApp:\na free third party app to buy domains"; 325 break; 326 default: 327 break; 328 } 329 return footerString; 330 } 331 295 332 296 333 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 297 334 [tableView deselectRowAtIndexPath:indexPath animated:YES]; 298 335 AccountEditController *eVC; 336 NSURL *appURL; 299 337 switch (indexPath.section) { 300 338 case kKRootTableViewSectionAccounts: … … 313 351 break; 314 352 case kKRootTableViewSectionBuyAccount: 353 appURL = [NSURL URLWithString:@"http://itunes.apple.com/us/app/domainapp/id295892753?mt=8&uo=6"]; 354 [[UIApplication sharedApplication] openURL:appURL]; 355 // Note: The above doesn't work in the simulator because iTunes is missing 315 356 break; 316 357 }








