Revision 3a8071d4
b/Classes/AccountGroupsViewController.m | ||
---|---|---|
54 | 54 |
[account release]; |
55 | 55 |
[groups release]; |
56 | 56 |
[metadata release]; |
57 |
[activityIndicatorView release]; |
|
57 | 58 |
[super dealloc]; |
58 | 59 |
} |
59 | 60 |
|
... | ... | |
68 | 69 |
metadata = [[NSMutableDictionary alloc] init]; |
69 | 70 |
|
70 | 71 |
NSString *activityMessage = @"Loading.."; |
72 |
[activityIndicatorView release]; |
|
71 | 73 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
72 | 74 |
[activityIndicatorView addToView:self.view]; |
73 | 75 |
|
74 | 76 |
[[self.account.manager getStorageAccountInfo] |
75 | 77 |
success:^(OpenStackRequest *request) { |
76 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
78 |
[activityIndicatorView removeFromSuperview]; |
|
77 | 79 |
for (NSString *key in request.responseHeaders) { |
78 | 80 |
if ([key hasPrefix:@"X-Account-Group-"]) { |
79 | 81 |
NSString *groupUsers = [NSString decodeFromPercentEscape:[request.responseHeaders objectForKey:key]]; |
... | ... | |
94 | 96 |
|
95 | 97 |
} |
96 | 98 |
failure:^(OpenStackRequest *request) { |
97 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
99 |
[activityIndicatorView removeFromSuperview]; |
|
98 | 100 |
[self alert:@"Error" message:@"Failed to get account information"]; |
99 | 101 |
}]; |
100 | 102 |
} |
b/Classes/AccountManager.m | ||
---|---|---|
542 | 542 |
self.objectDownloadRequests = [NSMutableDictionary dictionary]; |
543 | 543 |
[objectDownloadRequests setObject:request forKey:object.fullPath]; |
544 | 544 |
return [self callbackWithRequest:request success:^(OpenStackRequest *request) { |
545 |
|
|
546 | 545 |
OpenStackAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate]; |
547 | 546 |
NSString *filePath = [appDelegate.cacheDirectoryPath stringByAppendingFormat:@"/%@.%@",object.hash, object.name.pathExtension]; |
548 | 547 |
[[request responseData] writeToFile:filePath atomically:YES]; |
549 | 548 |
@synchronized(appDelegate.cachedObjectsDictionary) { |
549 |
if (!object.hash) |
|
550 |
object.hash = [request.responseHeaders objectForKey:@"X-Object-Hash"]; |
|
550 | 551 |
[appDelegate.cachedObjectsDictionary setObject:filePath forKey:object.hash]; |
551 | 552 |
[appDelegate saveCacheDictionary]; |
552 | 553 |
} |
b/Classes/AccountSettingsViewController.m | ||
---|---|---|
232 | 232 |
|
233 | 233 |
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
234 | 234 |
if (indexPath.section == getTokenSection) { |
235 |
NSString *loginURL = [NSString stringWithFormat:@"%@?next=pithos://login&force=", account.pithosLoginURLPrefix]; |
|
236 |
|
|
235 |
NSString *loginURL = [NSString stringWithFormat:@"%@?next=pithos://login&force=", account.pithosLoginURLPrefix]; |
|
237 | 236 |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:loginURL]]; |
238 | 237 |
[tableView deselectRowAtIndexPath:indexPath animated:NO]; |
239 | 238 |
} |
b/Classes/AddFolderViewController.m | ||
---|---|---|
82 | 82 |
NSString *activityMessage = @"Adding folder..."; |
83 | 83 |
|
84 | 84 |
// figure out how many folders to create |
85 |
|
|
85 |
[activityIndicatorView release]; |
|
86 | 86 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
87 | 87 |
[activityIndicatorView addToView:self.view]; |
88 | 88 |
|
... | ... | |
117 | 117 |
[folderViewController setDetailViewController]; |
118 | 118 |
|
119 | 119 |
allowOverwrite = NO; |
120 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
120 |
[activityIndicatorView removeFromSuperview]; |
|
121 | 121 |
[self dismissModalViewControllerAnimated:YES]; |
122 | 122 |
[newFolder release]; |
123 | 123 |
[object release]; |
... | ... | |
125 | 125 |
} |
126 | 126 |
failure:^(OpenStackRequest *request) { |
127 | 127 |
allowOverwrite = NO; |
128 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
128 |
[activityIndicatorView removeFromSuperview]; |
|
129 | 129 |
[self alert:@"There was a problem creating this folder." request:request]; |
130 | 130 |
[object release]; |
131 | 131 |
}]; |
... | ... | |
189 | 189 |
[container release]; |
190 | 190 |
[folder release]; |
191 | 191 |
[folderViewController release]; |
192 |
[activityIndicatorView release]; |
|
192 | 193 |
[super dealloc]; |
193 | 194 |
} |
194 | 195 |
|
b/Classes/AddPhotoViewController.m | ||
---|---|---|
99 | 99 |
|
100 | 100 |
- (void)viewDidAppear:(BOOL)animated { |
101 | 101 |
[super viewDidAppear:animated]; |
102 |
|
|
102 |
[qualityActivityIndicatorView release]; |
|
103 | 103 |
qualityActivityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:@"Calculating size..."] text:@"Calculating size..."]; |
104 | 104 |
[qualityActivityIndicatorView addToView:self.view]; |
105 | 105 |
[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(calculateSize) userInfo:nil repeats:NO]; |
... | ... | |
277 | 277 |
// move the text field to make room for the numbers label |
278 | 278 |
CGSize size = [formatLabel.text sizeWithFont:formatLabel.font constrainedToSize:CGSizeMake(280.0, 900.0f)]; |
279 | 279 |
nameTextField.frame = CGRectMake(79.0, 13.0, 222.0 - size.width, 24.0); |
280 |
|
|
280 |
[qualityActivityIndicatorView release]; |
|
281 | 281 |
qualityActivityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:@"Calculating size..."] text:@"Calculating size..."]; |
282 | 282 |
[qualityActivityIndicatorView addToView:self.view]; |
283 | 283 |
[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(calculateSize) userInfo:nil repeats:NO]; |
... | ... | |
327 | 327 |
} |
328 | 328 |
|
329 | 329 |
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:1 inSection:kName]] withRowAnimation:UITableViewRowAnimationNone]; |
330 |
[qualityActivityIndicatorView removeFromSuperviewAndRelease];
|
|
330 |
[qualityActivityIndicatorView removeFromSuperview]; |
|
331 | 331 |
} |
332 | 332 |
|
333 | 333 |
- (void)sliderFinished:(id)sender { |
334 |
[qualityActivityIndicatorView release]; |
|
334 | 335 |
qualityActivityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:@"Calculating size..."] text:@"Calculating size..."]; |
335 | 336 |
[qualityActivityIndicatorView addToView:self.view]; |
336 | 337 |
[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(calculateSize) userInfo:nil repeats:NO]; |
... | ... | |
373 | 374 |
[alert release]; |
374 | 375 |
return; |
375 | 376 |
} |
376 |
|
|
377 |
[activityIndicatorView release]; |
|
377 | 378 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:@"Uploading..." withProgress:YES] text:@"Uploading..." withProgress:YES]; |
378 | 379 |
[activityIndicatorView addToView:self.view]; |
379 | 380 |
|
... | ... | |
393 | 394 |
|
394 | 395 |
[[self.account.manager writeObject:self.container object:object downloadProgressDelegate:activityIndicatorView.progressView] |
395 | 396 |
success:^(OpenStackRequest *request) { |
396 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
397 |
[activityIndicatorView removeFromSuperview]; |
|
397 | 398 |
object.data = nil; |
398 | 399 |
object.sharing = folder.sharing; |
399 | 400 |
BOOL currentFolderIsRoot = NO; |
... | ... | |
413 | 414 |
[self dismissModalViewControllerAnimated:YES]; |
414 | 415 |
} |
415 | 416 |
failure:^(OpenStackRequest *request) { |
416 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
417 |
[activityIndicatorView removeFromSuperview]; |
|
417 | 418 |
allowOverwrite = NO; |
418 | 419 |
[self alert:@"There was a problem uploading this file." request:request]; |
419 | 420 |
}]; |
... | ... | |
441 | 442 |
[nameTextField release]; |
442 | 443 |
[formatLabel release]; |
443 | 444 |
[slider release]; |
445 |
[qualityActivityIndicatorView release]; |
|
446 |
[activityIndicatorView release]; |
|
444 | 447 |
[super dealloc]; |
445 | 448 |
} |
446 | 449 |
|
b/Classes/ContainerDetailViewController.m | ||
---|---|---|
22 | 22 |
#import "FolderViewController.h" |
23 | 23 |
#import "OpenStackRequest.h" |
24 | 24 |
#import "APICallback.h" |
25 |
#import "NSString+Conveniences.h" |
|
25 | 26 |
|
26 | 27 |
#define kOverview 0 |
27 | 28 |
#define kMetadata 1 |
... | ... | |
120 | 121 |
[self.tableView reloadData]; |
121 | 122 |
} |
122 | 123 |
|
124 |
- (void)viewDidAppear:(BOOL)animated { |
|
125 |
[super viewDidAppear:animated]; |
|
126 |
if (self.container && !container.metadata && (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)) |
|
127 |
[self reloadMetadataSection]; |
|
128 |
} |
|
129 |
|
|
123 | 130 |
- (void)viewWillDisappear:(BOOL)animated { |
124 | 131 |
[super viewWillDisappear:animated]; |
125 | 132 |
} |
... | ... | |
623 | 630 |
if (buttonIndex == 0) { |
624 | 631 |
|
625 | 632 |
NSString *activityMessage = @"Deleting container..."; |
633 |
[activityIndicatorView release]; |
|
626 | 634 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
627 | 635 |
[activityIndicatorView addToView:self.view scrollOffset:self.tableView.contentOffset.y]; |
628 | 636 |
|
629 | 637 |
[[self.account.manager deleteContainer:self.container] success:^(OpenStackRequest *request) { |
630 | 638 |
|
631 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
639 |
[activityIndicatorView removeFromSuperview]; |
|
632 | 640 |
[self.account.containers removeObjectForKey:self.container.name]; |
633 | 641 |
[self.account persist]; |
634 | 642 |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) |
... | ... | |
647 | 655 |
[self.account persist]; |
648 | 656 |
|
649 | 657 |
} else { |
650 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
658 |
[activityIndicatorView removeFromSuperview]; |
|
651 | 659 |
[self alert:@"There was a problem deleting this container." request:request]; |
652 | 660 |
} |
653 | 661 |
}]; |
... | ... | |
671 | 679 |
[containersViewController release]; |
672 | 680 |
[selectedContainerIndexPath release]; |
673 | 681 |
[rootFolderViewController release]; |
682 |
[activityIndicatorView release]; |
|
674 | 683 |
[super dealloc]; |
675 | 684 |
} |
676 | 685 |
|
... | ... | |
679 | 688 |
|
680 | 689 |
- (void)reloadMetadataSection { |
681 | 690 |
NSString *activityMessage = @"Loading metadata..."; |
691 |
[activityIndicatorView release]; |
|
682 | 692 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
683 | 693 |
[activityIndicatorView addToView:self.view scrollOffset:self.tableView.contentOffset.y]; |
684 | 694 |
[[self.account.manager getContainerInfo:container] |
685 | 695 |
success:^(OpenStackRequest *request) { |
686 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
696 |
[activityIndicatorView removeFromSuperview]; |
|
687 | 697 |
container.metadata = [NSMutableDictionary dictionary]; |
688 | 698 |
for (NSString *header in request.responseHeaders) { |
689 | 699 |
NSString *metadataKey; |
690 | 700 |
NSString *metadataValue; |
691 | 701 |
if ([header rangeOfString:@"X-Container-Meta-"].location != NSNotFound) { |
692 |
metadataKey = [header substringFromIndex:17];
|
|
693 |
metadataValue = [request.responseHeaders objectForKey:header];
|
|
702 |
metadataKey = [NSString decodeFromPercentEscape:[header substringFromIndex:17]];
|
|
703 |
metadataValue = [NSString decodeFromPercentEscape:[request.responseHeaders objectForKey:header]];
|
|
694 | 704 |
[container.metadata setObject:metadataValue forKey:metadataKey]; |
695 | 705 |
} |
696 | 706 |
} |
... | ... | |
698 | 708 |
[self.tableView reloadSections:metadataSections withRowAnimation:UITableViewRowAnimationFade]; |
699 | 709 |
} |
700 | 710 |
failure:^(OpenStackRequest *request) { |
701 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
711 |
[activityIndicatorView removeFromSuperview]; |
|
702 | 712 |
[self alert:@"There was a problem retrieving the container's metadata." request:request]; |
703 | 713 |
}]; |
704 | 714 |
} |
b/Classes/EditAccountGroupsViewController.m | ||
---|---|---|
59 | 59 |
[account release]; |
60 | 60 |
[metadata release]; |
61 | 61 |
[groups release]; |
62 |
|
|
62 |
[activityIndicatorView release]; |
|
63 | 63 |
[super dealloc]; |
64 | 64 |
} |
65 | 65 |
|
... | ... | |
212 | 212 |
} |
213 | 213 |
|
214 | 214 |
activityMessage = @"Saving group"; |
215 |
|
|
215 |
[activityIndicatorView release]; |
|
216 | 216 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage]text:activityMessage]; |
217 | 217 |
[activityIndicatorView addToView:self.view]; |
218 | 218 |
|
... | ... | |
224 | 224 |
]; |
225 | 225 |
[[self.account.manager writeAccountMetadata:accountInfo] |
226 | 226 |
success:^(OpenStackRequest *request) { |
227 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
227 |
[activityIndicatorView removeFromSuperview]; |
|
228 | 228 |
self.groupName = newGroupName; |
229 | 229 |
self.groupUsers = newGroupUsers; |
230 | 230 |
self.removeGroupEnabled = YES; |
... | ... | |
233 | 233 |
[self.tableView reloadData]; |
234 | 234 |
} |
235 | 235 |
failure:^(OpenStackRequest *request) { |
236 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
236 |
[activityIndicatorView removeFromSuperview]; |
|
237 | 237 |
[groups removeObjectForKey:newGroupName]; |
238 | 238 |
[groups setObject:self.groupUsers forKey:self.groupName]; |
239 | 239 |
[self.tableView reloadData]; |
... | ... | |
242 | 242 |
}]; |
243 | 243 |
} else if (indexPath.section == kRemove) { |
244 | 244 |
activityMessage = @"Removing group"; |
245 |
[activityIndicatorView release]; |
|
245 | 246 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
246 | 247 |
[activityIndicatorView addToView:self.view]; |
247 | 248 |
|
... | ... | |
253 | 254 |
|
254 | 255 |
[[self.account.manager writeAccountMetadata:accountInfo] |
255 | 256 |
success:^(OpenStackRequest *request) { |
256 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
257 |
[activityIndicatorView removeFromSuperview]; |
|
257 | 258 |
self.groupName = @""; |
258 | 259 |
self.groupUsers = @""; |
259 | 260 |
self.removeGroupEnabled = NO; |
... | ... | |
261 | 262 |
[self.tableView deselectRowAtIndexPath:indexPath animated:YES]; |
262 | 263 |
} |
263 | 264 |
failure:^(OpenStackRequest *request) { |
264 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
265 |
[activityIndicatorView removeFromSuperview]; |
|
265 | 266 |
[groups setObject:groupUsers forKey:groupName]; |
266 | 267 |
[self.tableView deselectRowAtIndexPath:indexPath animated:YES]; |
267 | 268 |
[self alert:@"There was a problem removing the group information." request:request]; |
b/Classes/EditMetadataViewController.m | ||
---|---|---|
69 | 69 |
[metadataValue release]; |
70 | 70 |
[userInputMetaKey release]; |
71 | 71 |
[userInputMetaValue release]; |
72 |
[activityIndicatorView release]; |
|
72 | 73 |
[super dealloc]; |
73 | 74 |
} |
74 | 75 |
|
... | ... | |
237 | 238 |
return; |
238 | 239 |
} else { |
239 | 240 |
activityMessage = @"Saving metadata..."; |
241 |
[activityIndicatorView release]; |
|
240 | 242 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
241 | 243 |
[activityIndicatorView addToView:self.view]; |
242 | 244 |
|
... | ... | |
249 | 251 |
} |
250 | 252 |
|
251 | 253 |
activityMessage = @"Saving metadata"; |
254 |
[activityIndicatorView release]; |
|
252 | 255 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
253 | 256 |
[activityIndicatorView addToView:self.view]; |
254 |
|
|
255 | 257 |
[[self.account.manager writeObjectMetadata:container object:object] |
256 | 258 |
success:^(OpenStackRequest *request) { |
257 | 259 |
self.metadataKey = userInputMetaKey; |
258 | 260 |
self.metadataValue = userInputMetaValue; |
259 | 261 |
removeMetadataEnabled = YES; |
260 | 262 |
[self.tableView reloadData]; |
261 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
263 |
[activityIndicatorView removeFromSuperview]; |
|
262 | 264 |
[self.tableView deselectRowAtIndexPath:indexPath animated:YES]; |
263 | 265 |
if (objectIsContainer) { |
264 | 266 |
container.metadata = object.metadata; |
... | ... | |
268 | 270 |
failure:^(OpenStackRequest *request) { |
269 | 271 |
[object.metadata removeObjectForKey:userInputMetaKey]; |
270 | 272 |
[object.metadata setObject:metadataValue forKey:metadataKey]; |
271 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
273 |
[activityIndicatorView removeFromSuperview]; |
|
272 | 274 |
[self.tableView deselectRowAtIndexPath:indexPath animated:YES]; |
273 | 275 |
[self alert:@"There was a problem saving the metadata." request:request]; |
274 | 276 |
}]; |
... | ... | |
276 | 278 |
break; |
277 | 279 |
case kDeleteMetadata: |
278 | 280 |
activityMessage = @"Deleting metadata"; |
281 |
[activityIndicatorView release]; |
|
279 | 282 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
280 | 283 |
[activityIndicatorView addToView:self.view]; |
281 | 284 |
|
282 | 285 |
[object.metadata removeObjectForKey:metadataKey]; |
283 | 286 |
[[self.account.manager writeObjectMetadata:container object:object] |
284 | 287 |
success:^(OpenStackRequest *request) { |
285 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
288 |
[activityIndicatorView removeFromSuperview]; |
|
286 | 289 |
[self.tableView deselectRowAtIndexPath:indexPath animated:YES]; |
287 | 290 |
self.metadataKey = @""; |
288 | 291 |
self.metadataValue = @""; |
... | ... | |
295 | 298 |
} |
296 | 299 |
failure:^(OpenStackRequest *request) { |
297 | 300 |
[object.metadata setObject:metadataValue forKey:metadataKey]; |
298 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
301 |
[activityIndicatorView removeFromSuperview]; |
|
299 | 302 |
[self.tableView deselectRowAtIndexPath:indexPath animated:YES]; |
300 | 303 |
[self alert:@"There was a problem saving the metadata." request:request]; |
301 | 304 |
|
... | ... | |
310 | 313 |
{ |
311 | 314 |
if (buttonIndex == 1) { |
312 | 315 |
NSString *activityMessage = @"Applying permissions..."; |
313 |
|
|
316 |
[activityIndicatorView release]; |
|
314 | 317 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
315 | 318 |
[activityIndicatorView addToView:self.view]; |
316 | 319 |
|
... | ... | |
359 | 362 |
newFolder.sharing = folderViewController.folder.sharing; |
360 | 363 |
newFolder.metadata = object.metadata; |
361 | 364 |
[folderViewController.folder.folders setObject:newFolder forKey:newFolder.name]; |
362 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
365 |
[activityIndicatorView removeFromSuperview]; |
|
363 | 366 |
[newFolder release]; |
364 | 367 |
self.metadataKey = userInputMetaKey; |
365 | 368 |
self.metadataValue = userInputMetaValue; |
... | ... | |
377 | 380 |
failure:^(OpenStackRequest *request) { |
378 | 381 |
[object.metadata removeObjectForKey:userInputMetaKey]; |
379 | 382 |
[object.metadata setObject:metadataValue forKey:metadataKey]; |
380 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
383 |
[activityIndicatorView removeFromSuperview]; |
|
381 | 384 |
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES]; |
382 | 385 |
[self.tableView reloadData]; |
383 | 386 |
[self alert:@"There was a problem saving the metadata." request:request]; |
b/Classes/EditPermissionsViewController.m | ||
---|---|---|
58 | 58 |
|
59 | 59 |
- (void)dealloc |
60 | 60 |
{ |
61 |
[account release]; |
|
62 |
[container release]; |
|
63 |
[object release]; |
|
64 |
[user release]; |
|
65 |
[permissions release]; |
|
66 |
[oldPermissionsString release]; |
|
67 |
[activityIndicatorView release]; |
|
61 | 68 |
[super dealloc]; |
62 | 69 |
} |
63 | 70 |
|
... | ... | |
269 | 276 |
return; |
270 | 277 |
} else { |
271 | 278 |
NSString *activityMessage = @"Applying permissions..."; |
279 |
[activityIndicatorView release]; |
|
272 | 280 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
273 | 281 |
[activityIndicatorView addToView:self.view]; |
274 | 282 |
|
... | ... | |
281 | 289 |
} |
282 | 290 |
|
283 | 291 |
NSString *activityMessage = @"Applying permissions..."; |
292 |
[activityIndicatorView release]; |
|
284 | 293 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
285 | 294 |
|
286 | 295 |
[activityIndicatorView addToView:self.view]; |
287 | 296 |
[[self.account.manager writeObjectMetadata:container object:object] |
288 | 297 |
success:^(OpenStackRequest *request) { |
289 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
298 |
[activityIndicatorView removeFromSuperview]; |
|
290 | 299 |
[self.tableView deselectRowAtIndexPath:indexPath animated:YES]; |
291 | 300 |
removePermissionsEnabled = YES; |
292 | 301 |
[self.tableView reloadData]; |
... | ... | |
309 | 318 |
else if (writePermissionSelected) |
310 | 319 |
[self.permissions setObject:@"write" forKey:user]; |
311 | 320 |
|
312 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
321 |
[activityIndicatorView removeFromSuperview]; |
|
313 | 322 |
[self.tableView deselectRowAtIndexPath:indexPath animated:YES]; |
314 | 323 |
[self.tableView reloadData]; |
315 | 324 |
[self alert:@"There was a problem applying the permissions." request:request]; |
316 | 325 |
}]; |
317 | 326 |
} |
318 | 327 |
else if (indexPath.section == kRemovePermissions) { |
319 |
NSString *activityMessage = @"Removing permissions..."; |
|
328 |
NSString *activityMessage = @"Removing permissions..."; |
|
329 |
[activityIndicatorView release]; |
|
320 | 330 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
321 | 331 |
[activityIndicatorView addToView:self.view]; |
322 | 332 |
|
... | ... | |
330 | 340 |
self.writePermissionSelected = FALSE; |
331 | 341 |
removePermissionsEnabled = NO; |
332 | 342 |
[self.tableView reloadData]; |
333 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
343 |
[activityIndicatorView removeFromSuperview]; |
|
334 | 344 |
[self.tableView deselectRowAtIndexPath:indexPath animated:YES]; |
335 | 345 |
if (objectIsFolder || (account.shared && ![oldPermissionsString isEqualToString:object.sharing])) { |
336 | 346 |
self.folderViewController.needsRefreshing = YES; |
... | ... | |
347 | 357 |
else if (writePermissionSelected) |
348 | 358 |
[self.permissions setObject:@"write" forKey:user]; |
349 | 359 |
|
350 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
360 |
[activityIndicatorView removeFromSuperview]; |
|
351 | 361 |
[self.tableView deselectRowAtIndexPath:indexPath animated:YES]; |
352 | 362 |
[self.tableView reloadData]; |
353 | 363 |
[self alert:@"There was a problem removing the permissions." request:request]; |
... | ... | |
372 | 382 |
{ |
373 | 383 |
if (buttonIndex == 1) { |
374 | 384 |
NSString *activityMessage = @"Applying permissions..."; |
375 |
|
|
385 |
[activityIndicatorView release]; |
|
376 | 386 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
377 | 387 |
[activityIndicatorView addToView:self.view]; |
378 | 388 |
|
... | ... | |
393 | 403 |
newFolder.parent = folderViewController.folder; |
394 | 404 |
newFolder.sharing = folderViewController.folder.sharing; |
395 | 405 |
[folderViewController.folder.folders setObject:newFolder forKey:newFolder.name]; |
396 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
406 |
[activityIndicatorView removeFromSuperview]; |
|
397 | 407 |
[newFolder release]; |
398 | 408 |
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES]; |
399 | 409 |
removePermissionsEnabled = YES; |
... | ... | |
416 | 426 |
else if (writePermissionSelected) |
417 | 427 |
[self.permissions setObject:@"write" forKey:user]; |
418 | 428 |
|
419 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
429 |
[activityIndicatorView removeFromSuperview]; |
|
420 | 430 |
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES]; |
421 | 431 |
[self.tableView reloadData]; |
422 | 432 |
[self alert:@"There was a problem applying the permissions." request:request]; |
b/Classes/EditPolicyViewController.m | ||
---|---|---|
56 | 56 |
[account release]; |
57 | 57 |
[container release]; |
58 | 58 |
[oldVersioning release]; |
59 |
[activityIndicatorView release]; |
|
59 | 60 |
[super dealloc]; |
60 | 61 |
} |
61 | 62 |
|
... | ... | |
270 | 271 |
container.versioning = @"none"; |
271 | 272 |
|
272 | 273 |
NSString *activityMessage = @"Applying policy..."; |
274 |
[activityIndicatorView release]; |
|
273 | 275 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
274 | 276 |
[activityIndicatorView addToView:self.view]; |
275 | 277 |
|
... | ... | |
278 | 280 |
[self.tableView reloadData]; |
279 | 281 |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) |
280 | 282 |
[self.containerDetailViewController.containersViewController refreshButtonPressed:nil]; |
281 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
283 |
[activityIndicatorView removeFromSuperview]; |
|
282 | 284 |
[self.tableView deselectRowAtIndexPath:indexPath animated:YES]; |
283 | 285 |
} |
284 | 286 |
failure:^(OpenStackRequest *request) { |
... | ... | |
287 | 289 |
[self configVersioningVariables]; |
288 | 290 |
[self.tableView reloadData]; |
289 | 291 |
|
290 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
292 |
[activityIndicatorView removeFromSuperview]; |
|
291 | 293 |
[self.tableView deselectRowAtIndexPath:indexPath animated:YES]; |
292 | 294 |
[self.tableView reloadData]; |
293 | 295 |
[self alert:@"There was a problem applying the policy." request:request]; |
b/Classes/ErrorAlerter.h | ||
---|---|---|
16 | 16 |
UIViewController *viewController; |
17 | 17 |
} |
18 | 18 |
|
19 |
@property (nonatomic, retain) OpenStackRequest *failedRequest; |
|
20 |
@property (nonatomic, retain) LogEntryModalViewController *logEntryModalViewController; |
|
21 |
@property (nonatomic, retain) UIViewController *viewController; |
|
22 |
|
|
19 | 23 |
- (void)alert:(NSString *)message request:(OpenStackRequest *)request viewController:(UIViewController *)viewController; |
20 | 24 |
|
21 | 25 |
@end |
b/Classes/ErrorAlerter.m | ||
---|---|---|
15 | 15 |
|
16 | 16 |
@implementation ErrorAlerter |
17 | 17 |
|
18 |
@synthesize failedRequest, logEntryModalViewController, viewController; |
|
19 |
|
|
18 | 20 |
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { |
19 | 21 |
if (buttonIndex == 1) { // details button |
20 | 22 |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { |
21 |
logEntryModalViewController.modalPresentationStyle = UIModalPresentationFormSheet; |
|
23 |
self.logEntryModalViewController.modalPresentationStyle = UIModalPresentationFormSheet;
|
|
22 | 24 |
} |
23 |
[viewController presentModalViewController:logEntryModalViewController animated:YES]; |
|
24 |
[logEntryModalViewController release]; |
|
25 |
[self.viewController presentModalViewController:self.logEntryModalViewController animated:YES]; |
|
25 | 26 |
} |
26 | 27 |
} |
27 | 28 |
|
28 | 29 |
- (void)alert:(NSString *)message request:(OpenStackRequest *)request viewController:(UIViewController *)aViewController { |
29 | 30 |
|
30 |
viewController = aViewController; |
|
31 |
self.viewController = aViewController;
|
|
31 | 32 |
|
32 | 33 |
NSString *title = @"Error"; |
33 | 34 |
if (request.responseStatusCode == 0) { |
... | ... | |
35 | 36 |
message = @"Please check your connection or API URL and try again."; |
36 | 37 |
} |
37 | 38 |
|
38 |
logEntryModalViewController = [[LogEntryModalViewController alloc] initWithNibName:@"LogEntryModalViewController" bundle:nil]; |
|
39 |
logEntryModalViewController.logEntry = [[[APILogEntry alloc] initWithRequest:request] autorelease]; |
|
40 |
logEntryModalViewController.requestDescription = [logEntryModalViewController.logEntry requestDescription]; |
|
41 |
logEntryModalViewController.responseDescription = [logEntryModalViewController.logEntry responseDescription]; |
|
42 |
logEntryModalViewController.requestMethod = [logEntryModalViewController.logEntry requestMethod]; |
|
43 |
logEntryModalViewController.url = [[logEntryModalViewController.logEntry url] description]; |
|
39 |
self.logEntryModalViewController = [[LogEntryModalViewController alloc] initWithNibName:@"LogEntryModalViewController" bundle:nil];
|
|
40 |
self.logEntryModalViewController.logEntry = [[[APILogEntry alloc] initWithRequest:request] autorelease];
|
|
41 |
self.logEntryModalViewController.requestDescription = [logEntryModalViewController.logEntry requestDescription];
|
|
42 |
self.logEntryModalViewController.responseDescription = [logEntryModalViewController.logEntry responseDescription];
|
|
43 |
self.logEntryModalViewController.requestMethod = [logEntryModalViewController.logEntry requestMethod];
|
|
44 |
self.logEntryModalViewController.url = [[logEntryModalViewController.logEntry url] description];
|
|
44 | 45 |
|
45 | 46 |
// present an alert with a Details button to show the API log entry |
46 | 47 |
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:message delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Details", nil]; |
... | ... | |
48 | 49 |
[alert release]; |
49 | 50 |
} |
50 | 51 |
|
52 |
- (void)dealloc { |
|
53 |
[failedRequest release]; |
|
54 |
[logEntryModalViewController release]; |
|
55 |
[viewController release]; |
|
56 |
[super dealloc]; |
|
57 |
} |
|
58 |
|
|
51 | 59 |
|
52 | 60 |
@end |
b/Classes/FolderDetailViewController.m | ||
---|---|---|
42 | 42 |
#import "APICallback.h" |
43 | 43 |
#import "AccountManager.h" |
44 | 44 |
#import "UIViewController+Conveniences.h" |
45 |
#import "NSString+Conveniences.h" |
|
45 | 46 |
|
46 | 47 |
#define kOverview 0 |
47 | 48 |
#define kMetadata 1 |
... | ... | |
383 | 384 |
NSString *metadataKey; |
384 | 385 |
NSString *metadataValue; |
385 | 386 |
if ([header rangeOfString:@"X-Object-Meta-"].location != NSNotFound) { |
386 |
metadataKey = [header substringFromIndex:14];
|
|
387 |
metadataValue = [request.responseHeaders objectForKey:header];
|
|
387 |
metadataKey = [NSString decodeFromPercentEscape:[header substringFromIndex:14]];
|
|
388 |
metadataValue = [NSString decodeFromPercentEscape:[request.responseHeaders objectForKey:header]];
|
|
388 | 389 |
[folder.metadata setObject:metadataValue forKey:metadataKey]; |
389 | 390 |
} |
390 | 391 |
} |
b/Classes/ObjectVersionsViewController.h | ||
---|---|---|
38 | 38 |
#import <UIKit/UIKit.h> |
39 | 39 |
#import "OpenStackViewController.h" |
40 | 40 |
|
41 |
@class OpenStackAccount, Container, StorageObject; |
|
41 |
@class OpenStackAccount, Container, StorageObject, ActivityIndicatorView;
|
|
42 | 42 |
|
43 | 43 |
@interface ObjectVersionsViewController : OpenStackViewController <UITableViewDelegate, UITableViewDataSource> { |
44 | 44 |
|
... | ... | |
47 | 47 |
OpenStackAccount *account; |
48 | 48 |
Container *container; |
49 | 49 |
StorageObject *object; |
50 |
ActivityIndicatorView *activityIndicatorView; |
|
50 | 51 |
BOOL versionsLoaded; |
51 | 52 |
|
52 | 53 |
} |
b/Classes/ObjectVersionsViewController.m | ||
---|---|---|
59 | 59 |
self.versions = [NSMutableArray array]; |
60 | 60 |
versionsLoaded = NO; |
61 | 61 |
NSString *activityMessage = @"Loading.."; |
62 |
ActivityIndicatorView *activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
|
62 |
[activityIndicatorView release]; |
|
63 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
|
63 | 64 |
[activityIndicatorView addToView:self.view]; |
64 | 65 |
|
65 | 66 |
[[self.account.manager getObjectVersionsList:container object:object] |
... | ... | |
72 | 73 |
nil]]; |
73 | 74 |
} |
74 | 75 |
[parser release]; |
75 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
76 |
[activityIndicatorView removeFromSuperview]; |
|
76 | 77 |
versionsLoaded = YES; |
77 | 78 |
[self.tableView reloadData]; |
78 | 79 |
} |
79 | 80 |
failure:^(OpenStackRequest *request) { |
80 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
81 |
[activityIndicatorView removeFromSuperview]; |
|
81 | 82 |
[self alert:@"Couldn't get versions from server" request:request]; |
82 | 83 |
}]; |
83 | 84 |
} |
... | ... | |
141 | 142 |
|
142 | 143 |
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
143 | 144 |
NSString *activityMessage = @"Loading.."; |
144 |
ActivityIndicatorView *activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
|
145 |
[activityIndicatorView release]; |
|
146 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
|
145 | 147 |
[activityIndicatorView addToView:self.view]; |
146 | 148 |
|
147 | 149 |
NSDictionary *versionDetails = [versions objectAtIndex:indexPath.row]; |
... | ... | |
149 | 151 |
|
150 | 152 |
[[self.account.manager getObjectInfo:container object:object version:versionID] |
151 | 153 |
success:^(OpenStackRequest *request) { |
152 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
154 |
[activityIndicatorView removeFromSuperview]; |
|
153 | 155 |
StorageObject *versionedObject = [[[StorageObject alloc] init] autorelease]; |
154 | 156 |
versionedObject.name = object.name; |
155 | 157 |
versionedObject.fullPath = object.fullPath; |
... | ... | |
165 | 167 |
[self.tableView deselectRowAtIndexPath:indexPath animated:YES]; |
166 | 168 |
} |
167 | 169 |
failure:^(OpenStackRequest *request) { |
168 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
170 |
[activityIndicatorView removeFromSuperview]; |
|
169 | 171 |
[self alert:[NSString stringWithFormat:@"Failed to get file info for version: %@", versionID] request:request]; |
170 | 172 |
}]; |
171 | 173 |
} |
b/Classes/OpenStackAppDelegate.m | ||
---|---|---|
251 | 251 |
} |
252 | 252 |
|
253 | 253 |
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { |
254 |
if (!url) |
|
254 |
if (!url)
|
|
255 | 255 |
return NO; |
256 | 256 |
|
257 | 257 |
NSString *host = [url host]; |
... | ... | |
291 | 291 |
stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; |
292 | 292 |
} |
293 | 293 |
|
294 |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { |
|
295 |
if (authToken) |
|
296 |
[masterNavigationController.visibleViewController setValue:authToken forKey:@"apiKey"]; |
|
297 |
if (authUser) |
|
298 |
[masterNavigationController.visibleViewController setValue:authUser forKey:@"userName"]; |
|
299 |
[((UITableViewController *)masterNavigationController.visibleViewController).tableView reloadData]; |
|
300 |
} else { |
|
301 |
if (authToken) |
|
302 |
[navigationController.visibleViewController setValue:authToken forKey:@"apiKey"]; |
|
303 |
if (authUser) |
|
304 |
[navigationController.visibleViewController setValue:authUser forKey:@"userName"]; |
|
305 |
[((UITableViewController *)navigationController.visibleViewController).tableView reloadData]; |
|
294 |
if (authToken || authUser) { |
|
295 |
UIViewController *vc = nil; |
|
296 |
if (([navigationController.visibleViewController class] == [AccountDetailsViewController class]) || |
|
297 |
([navigationController.visibleViewController class] == [AccountSettingsViewController class])) |
|
298 |
vc = navigationController.visibleViewController; |
|
299 |
else if (([masterNavigationController.visibleViewController class] == [AccountDetailsViewController class]) || |
|
300 |
([masterNavigationController.visibleViewController class] == [AccountSettingsViewController class])) |
|
301 |
vc = masterNavigationController.visibleViewController; |
|
302 |
if (vc) { |
|
303 |
if (authToken) |
|
304 |
[vc setValue:authToken forKey:@"apiKey"]; |
|
305 |
if (authUser) |
|
306 |
[vc setValue:authUser forKey:@"userName"]; |
|
307 |
[((UITableViewController *)vc).tableView reloadData]; |
|
308 |
} |
|
306 | 309 |
} |
307 | 310 |
} |
308 | 311 |
// XXX else maybe show an error message? |
309 |
|
|
310 | 312 |
return YES; |
311 | 313 |
} |
312 | 314 |
|
b/Classes/RootViewController.h | ||
---|---|---|
17 | 17 |
id detailItem; |
18 | 18 |
|
19 | 19 |
BOOL restoreAccountView; |
20 |
BOOL viewHasAppearedBefore; |
|
20 | 21 |
} |
21 | 22 |
|
22 | 23 |
@property (nonatomic, retain) IBOutlet UITableView *tableView; |
b/Classes/RootViewController.m | ||
---|---|---|
171 | 171 |
|
172 | 172 |
- (void)viewDidLoad { |
173 | 173 |
[super viewDidLoad]; |
174 |
|
|
174 | 175 |
self.navigationItem.title = @"Accounts"; |
175 | 176 |
|
176 | 177 |
self.navigationItem.leftBarButtonItem = self.editButtonItem; |
177 | 178 |
|
178 | 179 |
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addButtonPressed:)]; |
179 | 180 |
self.navigationItem.rightBarButtonItem = addButton; |
180 |
[addButton release]; |
|
181 |
|
|
182 |
if ([[OpenStackAccount accounts] count] == 0) { |
|
183 |
// if there are no accounts, go straight to the add account screen on launch |
|
184 |
ProvidersViewController *vc = [[ProvidersViewController alloc] initWithNibName:@"ProvidersViewController" bundle:nil]; |
|
185 |
vc.rootViewController = self; |
|
186 |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { |
|
187 |
vc.modalPresentationStyle = UIModalPresentationFormSheet; |
|
188 |
} |
|
189 |
[self presentModalViewControllerWithNavigation:vc animated:NO]; |
|
190 |
[vc release]; |
|
191 |
|
|
192 |
} else if ([[OpenStackAccount accounts] count] == 1 && UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) { |
|
193 |
// if there's only one account, go to its home screen |
|
194 |
// NOTE: not doing this on iPad because it screws up the split view controller. |
|
195 |
// TODO: make this work well with split view on iPad |
|
196 |
AccountHomeViewController *vc = [[AccountHomeViewController alloc] initWithNibName:@"AccountHomeViewController" bundle:nil]; |
|
197 |
vc.account = [[OpenStackAccount accounts] objectAtIndex:0]; |
|
198 |
vc.rootViewController = self; |
|
199 |
vc.rootViewIndexPath = [NSIndexPath indexPathForRow:0 inSection:0]; |
|
200 |
[self.navigationController pushViewController:vc animated:NO]; |
|
201 |
[vc release]; |
|
202 |
} |
|
203 |
|
|
181 |
[addButton release]; |
|
204 | 182 |
} |
205 | 183 |
|
206 | 184 |
- (void)viewWillAppear:(BOOL)animated { |
... | ... | |
212 | 190 |
[self.navigationController presentPrimaryViewController:vc]; |
213 | 191 |
[vc release]; |
214 | 192 |
} |
193 |
|
|
215 | 194 |
} |
216 | 195 |
|
217 | 196 |
- (void)viewDidAppear:(BOOL)animated { |
218 | 197 |
[super viewDidAppear:animated]; |
198 |
|
|
199 |
if (!viewHasAppearedBefore) { |
|
200 |
if ([[OpenStackAccount accounts] count] == 0) { |
|
201 |
// if there are no accounts, go straight to the add account screen on launch |
|
202 |
ProvidersViewController *vc = [[ProvidersViewController alloc] initWithNibName:@"ProvidersViewController" bundle:nil]; |
|
203 |
vc.rootViewController = self; |
|
204 |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { |
|
205 |
vc.modalPresentationStyle = UIModalPresentationFormSheet; |
|
206 |
} |
|
207 |
[self presentModalViewControllerWithNavigation:vc]; |
|
208 |
[vc release]; |
|
209 |
} else if (([[OpenStackAccount accounts] count] == 1) && (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad)) { |
|
210 |
// if there's only one account, go to its home screen |
|
211 |
// NOTE: not doing this on iPad because it screws up the split view controller. |
|
212 |
// TODO: make this work well with split view on iPad |
|
213 |
AccountHomeViewController *vc = [[AccountHomeViewController alloc] initWithNibName:@"AccountHomeViewController" bundle:nil]; |
|
214 |
vc.account = [[OpenStackAccount accounts] objectAtIndex:0]; |
|
215 |
vc.rootViewController = self; |
|
216 |
vc.rootViewIndexPath = [NSIndexPath indexPathForRow:0 inSection:0]; |
|
217 |
[self.navigationController pushViewController:vc animated:NO]; |
|
218 |
[vc release]; |
|
219 |
} |
|
220 |
viewHasAppearedBefore = YES; |
|
221 |
} |
|
219 | 222 |
} |
220 | 223 |
|
221 | 224 |
/* |
b/Classes/SettingsViewController.m | ||
---|---|---|
126 | 126 |
cell.detailTextLabel.text = @""; |
127 | 127 |
cell.accessoryType = UITableViewCellAccessoryNone; |
128 | 128 |
} else if (indexPath.section == aboutSection) { |
129 |
cell.textLabel.text = @"About This App"; |
|
129 |
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; |
|
130 |
cell.textLabel.text = [NSString stringWithFormat:@"About This App (v%@ %@)", |
|
131 |
[infoDictionary objectForKey:@"CFBundleShortVersionString"], |
|
132 |
[infoDictionary objectForKey:@"CFBundleVersion"]]; |
|
130 | 133 |
cell.detailTextLabel.text = @""; |
131 | 134 |
cell.accessoryType = UITableViewCellAccessoryNone; |
132 | 135 |
} else { |
b/Classes/StorageObjectViewController.m | ||
---|---|---|
648 | 648 |
#pragma mark Action Sheet Delegate |
649 | 649 |
|
650 | 650 |
- (void)deleteObjectRow { |
651 |
[self.folder.objects removeObjectForKey:self.object.name]; |
|
651 | 652 |
[self.folderViewController.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:selectedIndexPath] withRowAnimation:UITableViewRowAnimationLeft]; |
652 | 653 |
} |
653 | 654 |
|
... | ... | |
657 | 658 |
// delete the file and pop out |
658 | 659 |
|
659 | 660 |
NSString *activityMessage = @"Deleting file"; |
660 |
|
|
661 |
[activityIndicatorView release]; |
|
661 | 662 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
662 | 663 |
[activityIndicatorView addToView:self.view]; |
663 | 664 |
|
664 | 665 |
|
665 | 666 |
[[self.account.manager deleteObject:self.container object:self.object] |
666 | 667 |
success:^(OpenStackRequest *request) { |
667 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
668 |
[activityIndicatorView removeFromSuperview]; |
|
668 | 669 |
performingAction = NO; |
669 |
[self.folder.objects removeObjectForKey:self.object.name]; |
|
670 |
|
|
671 | 670 |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { |
672 | 671 |
[self.navigationController popViewControllerAnimated:YES]; |
673 | 672 |
if (account.shared) |
... | ... | |
676 | 675 |
if (!account.shared) |
677 | 676 |
[self.folderViewController setDetailViewController]; |
678 | 677 |
else |
679 |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) |
|
680 |
[self.folderViewController refreshButtonPressed:nil]; |
|
678 |
[self.folderViewController refreshButtonPressed:nil]; |
|
681 | 679 |
} |
680 |
if (self.folder.objects.count == 1) |
|
681 |
[self.folder.objects removeObjectForKey:self.object.name]; |
|
682 | 682 |
|
683 | 683 |
if ([self.folder.objects count] + [self.folder.folders count] == 0) { |
684 | 684 |
[self.folderViewController.tableView reloadData]; |
... | ... | |
688 | 688 |
} |
689 | 689 |
} |
690 | 690 |
failure:^(OpenStackRequest *request) { |
691 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
691 |
[activityIndicatorView removeFromSuperview]; |
|
692 | 692 |
[self hideToolbarActivityMessage]; |
693 | 693 |
performingAction = NO; |
694 | 694 |
[self alert:@"There was a problem deleting this file." request:request]; |
... | ... | |
758 | 758 |
else { |
759 | 759 |
object.publicURI = @"TRUE"; |
760 | 760 |
} |
761 |
|
|
761 |
[activityIndicatorView release]; |
|
762 | 762 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
763 | 763 |
[activityIndicatorView addToView:self.view scrollOffset:self.tableView.contentOffset.y]; |
764 | 764 |
|
... | ... | |
769 | 769 |
if (objectIsPublic) { |
770 | 770 |
[[self.account.manager getObjectInfo:container object:object version:versionID] |
771 | 771 |
success:^(OpenStackRequest *request) { |
772 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
772 |
[activityIndicatorView removeFromSuperview]; |
|
773 | 773 |
object.publicURI = [request.responseHeaders objectForKey:@"X-Object-Public"]; |
774 | 774 |
NSIndexPath *publicURICellIndexPath = [NSIndexPath indexPathForRow:1 inSection:publicLinkSection]; |
775 | 775 |
[self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:publicURICellIndexPath] |
776 | 776 |
withRowAnimation:UITableViewRowAnimationBottom]; |
777 | 777 |
} |
778 | 778 |
failure:^(OpenStackRequest *request) { |
779 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
779 |
[activityIndicatorView removeFromSuperview]; |
|
780 | 780 |
[self alert:@"There was a problem retrieving the public link from the server." request:request]; |
781 | 781 |
}]; |
782 | 782 |
} |
783 | 783 |
else { |
784 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
784 |
[activityIndicatorView removeFromSuperview]; |
|
785 | 785 |
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:publicURICellIndexPath] |
786 | 786 |
withRowAnimation:UITableViewRowAnimationTop]; |
787 | 787 |
} |
788 | 788 |
} |
789 | 789 |
failure:^(OpenStackRequest *request) { |
790 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
790 |
[activityIndicatorView removeFromSuperview]; |
|
791 | 791 |
objectIsPublic = !objectIsPublic; |
792 | 792 |
objectIsPublicSwitch.on = !objectIsPublicSwitch.on; |
793 | 793 |
object.publicURI = oldPubicURI; |
... | ... | |
817 | 817 |
[documentInteractionController release]; |
818 | 818 |
[actionSelectedIndexPath release]; |
819 | 819 |
[versionID release]; |
820 |
|
|
820 |
[activityIndicatorView release]; |
|
821 | 821 |
[super dealloc]; |
822 | 822 |
} |
823 | 823 |
|
... | ... | |
826 | 826 |
|
827 | 827 |
- (void)reloadMetadataSection { |
828 | 828 |
NSString *activityMessage = @"Loading metadata..."; |
829 |
[activityIndicatorView release]; |
|
829 | 830 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage]; |
830 | 831 |
[activityIndicatorView addToView:self.view]; |
831 | 832 |
[[self.account.manager getObjectInfo:container object:object version:versionID] |
832 | 833 |
success:^(OpenStackRequest *request) { |
833 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
834 |
[activityIndicatorView removeFromSuperview];
|
|
834 | 835 |
object.metadata = [NSMutableDictionary dictionary]; |
835 | 836 |
for (NSString *header in request.responseHeaders) { |
836 | 837 |
NSString *metadataKey; |
837 | 838 |
NSString *metadataValue; |
838 | 839 |
if ([header rangeOfString:@"X-Object-Meta-"].location != NSNotFound) { |
839 |
metadataKey = [header substringFromIndex:14];
|
|
840 |
metadataValue = [request.responseHeaders objectForKey:header];
|
|
840 |
metadataKey = [NSString decodeFromPercentEscape:[header substringFromIndex:14]];
|
|
841 |
metadataValue = [NSString decodeFromPercentEscape:[request.responseHeaders objectForKey:header]];
|
|
841 | 842 |
[object.metadata setObject:metadataValue forKey:metadataKey]; |
842 | 843 |
} |
843 | 844 |
} |
... | ... | |
845 | 846 |
[self.tableView reloadSections:metadataSections withRowAnimation:UITableViewRowAnimationFade]; |
846 | 847 |
} |
847 | 848 |
failure:^(OpenStackRequest *request) { |
848 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
849 |
[activityIndicatorView removeFromSuperview]; |
|
849 | 850 |
[self alert:@"There was a problem retrieving the object's metadata." request:request]; |
850 | 851 |
}]; |
851 | 852 |
} |
b/Classes/UploadGenericFileViewController.m | ||
---|---|---|
237 | 237 |
[alert release]; |
238 | 238 |
return; |
239 | 239 |
} |
240 |
|
|
240 |
[activityIndicatorView release]; |
|
241 | 241 |
activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:@"Uploading..." withProgress:YES] text:@"Uploading..." withProgress:YES]; |
242 | 242 |
[activityIndicatorView addToView:self.view]; |
243 | 243 |
|
... | ... | |
256 | 256 |
|
257 | 257 |
[[self.account.manager writeObject:self.container object:object downloadProgressDelegate:activityIndicatorView.progressView] |
258 | 258 |
success:^(OpenStackRequest *request) { |
259 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
259 |
[activityIndicatorView removeFromSuperview]; |
|
260 | 260 |
object.data = nil; |
261 | 261 |
object.sharing = folder.sharing; |
262 | 262 |
BOOL currentFolderIsRoot = NO; |
... | ... | |
277 | 277 |
} |
278 | 278 |
failure:^(OpenStackRequest *request) { |
279 | 279 |
allowOverwrite = NO; |
280 |
[activityIndicatorView removeFromSuperviewAndRelease];
|
|
280 |
[activityIndicatorView removeFromSuperview]; |
|
281 | 281 |
[self alert:@"There was a problem uploading the file." request:request]; |
282 | 282 |
}]; |
283 | 283 |
} |
... | ... | |
312 | 312 |
[data release]; |
313 | 313 |
[format release]; |
314 | 314 |
[contentType release]; |
315 |
[activityIndicatorView release]; |
|
315 | 316 |
[super dealloc]; |
316 | 317 |
} |
317 | 318 |
|
b/OpenStack-Info.plist | ||
---|---|---|
54 | 54 |
</dict> |
55 | 55 |
</array> |
56 | 56 |
<key>CFBundleVersion</key> |
57 |
<string>20120307a</string>
|
|
57 |
<string>20120322a</string>
|
|
58 | 58 |
<key>LSRequiresIPhoneOS</key> |
59 | 59 |
<true/> |
60 | 60 |
<key>NSMainNibFile</key> |
b/OpenStack.xcodeproj/project.pbxproj | ||
---|---|---|
3422 | 3422 |
29B97313FDCFA39411CA2CEA /* Project object */ = { |
3423 | 3423 |
isa = PBXProject; |
3424 | 3424 |
attributes = { |
3425 |
LastUpgradeCheck = 0420;
|
|
3425 |
LastUpgradeCheck = 0430;
|
|
3426 | 3426 |
}; |
3427 | 3427 |
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "OpenStack" */; |
3428 | 3428 |
compatibilityVersion = "Xcode 3.2"; |
b/README2 | ||
---|---|---|
1 | 1 |
This repository is a fork of https://github.com/rackspace/rackspace-ios |
2 |
Merged changes up to 2011-11-21
|
|
2 |
Merged changes selectively up to 2012-02-14
|
|
3 | 3 |
All new code is copyright of the Greek Research and Technology Network - GRNET (http://www.grnet.gr) |
4 |
|
Also available in: Unified diff