if ([request isSuccess]) {
account.authToken = [[request responseHeaders] objectForKey:@"X-Auth-Token"];
account.serversURL = [NSURL URLWithString:[[request responseHeaders] objectForKey:@"X-Server-Management-Url"]];
- account.filesURL = [NSURL URLWithString:[[request responseHeaders] objectForKey:@"X-Storage-Url"]];
+
+ if (![[request responseHeaders] objectForKey:@"X-Storage-URL"] && [account.provider isGRNet]) {
+ NSString *filesStorageURL = [NSString stringWithFormat:@"%@%@",
+ [[[NSBundle mainBundle] infoDictionary] objectForKey:@"GRNetStorageUrlPrefix"],
+ [account username]];
+ account.filesURL = [NSURL URLWithString:filesStorageURL];
+ } else {
+ account.filesURL = [NSURL URLWithString:[[request responseHeaders] objectForKey:@"X-Storage-Url"]];
+ }
NSString *cdnStr = [[request responseHeaders] objectForKey:@"X-Cdn-Management-Url"];
if (!cdnStr) {
if ([request isSuccess]) {
self.account.authToken = [[request responseHeaders] objectForKey:@"X-Auth-Token"];
self.account.serversURL = [NSURL URLWithString:[[request responseHeaders] objectForKey:@"X-Server-Management-Url"]];
- self.account.filesURL = [NSURL URLWithString:[[request responseHeaders] objectForKey:@"X-Storage-Url"]];
+
+ if ([account.provider isGRNet]) {
+ NSString *filesStorageURL = [NSString stringWithFormat:@"%@%@",
+ [[[NSBundle mainBundle] infoDictionary] objectForKey:@"GRNetStorageUrlPrefix"],
+ [self.account username]];
+ self.account.filesURL = [NSURL URLWithString:filesStorageURL];
+ } else {
+ self.account.filesURL = [NSURL URLWithString:[[request responseHeaders] objectForKey:@"X-Storage-Url"]];
+ }
+
self.account.cdnURL = [NSURL URLWithString:[[request responseHeaders] objectForKey:@"X-Cdn-Management-Url"]];
[self.account persist];
if ([request isSuccess]) {
account.authToken = [[request responseHeaders] objectForKey:@"X-Auth-Token"];
account.serversURL = [NSURL URLWithString:[[request responseHeaders] objectForKey:@"X-Server-Management-Url"]];
- account.filesURL = [NSURL URLWithString:[[request responseHeaders] objectForKey:@"X-Storage-Url"]];
+ if (![[request responseHeaders] objectForKey:@"X-Storage-URL"] && [account.provider isGRNet]) {
+ NSString *filesStorageURL = [NSString stringWithFormat:@"%@%@",
+ [[[NSBundle mainBundle] infoDictionary] objectForKey:@"GRNetStorageUrlPrefix"],
+ [self.account username]];
+ account.filesURL = [NSURL URLWithString:filesStorageURL];
+ } else {
+ account.filesURL = [NSURL URLWithString:[[request responseHeaders] objectForKey:@"X-Storage-Url"]];
+ }
+
NSString *cdnStr = [[request responseHeaders] objectForKey:@"X-Cdn-Management-Url"];
if (!cdnStr) {
cdnStr = [[request responseHeaders] objectForKey:@"X-CDN-Management-Url"];
@property (nonatomic, assign) BOOL contentsLoaded;
@property (nonatomic, retain) IBOutlet UITableView *tableView;
-- (void)reloadFolders;
+- (void)reloadFolderViewControllers;
- (IBAction)homeButtonPressed:(id)sender;
- (IBAction)refreshButtonPressed:(id)sender;
queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification* notification)
{
contentsLoaded = YES;
- [self reloadFolders];
+ [self reloadFolderViewControllers];
[[NSNotificationCenter defaultCenter] removeObserver:successObserver];
[activityIndicatorView removeFromSuperviewAndRelease];
}];
}
-- (void)reloadFolders
+- (void)reloadFolderViewControllers
{
NSArray *viewControllers = [self.navigationController viewControllers];
int rootFolderControllerIndex = [viewControllers indexOfObject:self.containersViewController] + 1;
if ([actionSheet isEqual:deleteActionSheet]) {
if (buttonIndex == 0) {
// delete the file and pop out
- [self showToolbarActivityMessage:@"Deleting file..."];
+
+ NSString *activityMessage = @"Deleting file";
+
+ activityIndicatorView = [[ActivityIndicatorView alloc] initWithFrame:[ActivityIndicatorView frameForText:activityMessage] text:activityMessage];
+ [activityIndicatorView addToView:self.view];
[self.account.manager deleteObject:self.container object:self.object];
deleteSuccessObserver = [[NSNotificationCenter defaultCenter] addObserverForName:@"deleteObjectSucceeded" object:self.object
queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification* notification)
{
- [self hideToolbarActivityMessage];
+ [activityIndicatorView removeFromSuperviewAndRelease];
performingAction = NO;
[self.folder.objects removeObjectForKey:self.object.name];
[self.navigationController popViewControllerAnimated:YES];
deleteFailureObserver = [[NSNotificationCenter defaultCenter] addObserverForName:@"deleteObjectFailed" object:self.object
queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification* notification)
{
+ [activityIndicatorView removeFromSuperviewAndRelease];
[self hideToolbarActivityMessage];
performingAction = NO;
[self alert:@"There was a problem deleting this file." request:[notification.userInfo objectForKey:@"request"]];
<string>MainWindow-iPad</string>
<key>PithosLoginURLPrefix</key>
<string>https://pithos.dev.grnet.gr/login</string>
+ <key>GRNetStorageUrlPrefix</key>
+ <string>http://pithos.dev.grnet.gr/v1/</string>
<key>UIApplicationExitsOnSuspend</key>
<false/>
<key>UIFileSharingEnabled</key>
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
INFOPLIST_FILE = "OpenStack-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 4.3;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/Classes\"",
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
INFOPLIST_FILE = "OpenStack-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 4.3;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/Classes\"",