Browse Source

Dropbox: add button to go up in the folder hierachy to the parent folder

Felix Paul Kühne 12 years ago
parent
commit
d6ff54221b
1 changed files with 10 additions and 0 deletions
  1. 10 0
      AspenProject/VLCDropboxTableViewController.m

+ 10 - 0
AspenProject/VLCDropboxTableViewController.m

@@ -44,6 +44,10 @@
 
 
     UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"BUTTON_DONE", @"") style:UIBarButtonItemStyleDone target:self action:@selector(dismiss:)];
     UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"BUTTON_DONE", @"") style:UIBarButtonItemStyleDone target:self action:@selector(dismiss:)];
     self.navigationItem.rightBarButtonItem = addButton;
     self.navigationItem.rightBarButtonItem = addButton;
+
+    UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@".." style:UIBarButtonItemStyleBordered target:self action:@selector(folderUp:)];
+    self.navigationItem.leftBarButtonItem = backButton;
+
     self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"dropbox-white"]];
     self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"dropbox-white"]];
 
 
     self.tableView.rowHeight = [VLCDropboxTableViewCell heightOfCell];
     self.tableView.rowHeight = [VLCDropboxTableViewCell heightOfCell];
@@ -60,6 +64,12 @@
     [self.navigationController dismissModalViewControllerAnimated:YES];
     [self.navigationController dismissModalViewControllerAnimated:YES];
 }
 }
 
 
+- (IBAction)folderUp:(id)sender
+{
+    _currentPath = [_currentPath stringByDeletingLastPathComponent];
+    [_dropboxController requestDirectoryListingAtPath:_currentPath];
+}
+
 #pragma mark - Table view data source
 #pragma mark - Table view data source
 
 
 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView