Commit 1de26dad authored by Felix Paul Kühne's avatar Felix Paul Kühne

Dropbox: add a toolbar showing the number of files in the current directory

parent d6ff5422
......@@ -17,6 +17,9 @@
{
VLCDropboxController *_dropboxController;
NSString *_currentPath;
UIBarButtonItem *_numberOfFilesBarButtonItem;
UIBarButtonItem *_progressBarButtonItem;
}
@end
......@@ -52,6 +55,13 @@
self.tableView.rowHeight = [VLCDropboxTableViewCell heightOfCell];
self.tableView.separatorColor = [UIColor colorWithWhite:.2 alpha:1.];
_numberOfFilesBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@"NUM_OF_FILES", @""), 0] style:UIBarButtonItemStylePlain target:self action:nil];
[_numberOfFilesBarButtonItem setTitleTextAttributes:@{ UITextAttributeFont : [UIFont systemFontOfSize:11.] } forState:UIControlStateNormal];
self.navigationController.toolbarHidden = NO;
self.navigationController.toolbar.barStyle = UIBarStyleBlack;
[self setToolbarItems:@[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil], _numberOfFilesBarButtonItem, [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]] animated:NO];
}
- (void)viewWillAppear:(BOOL)animated
......@@ -117,6 +127,12 @@
- (void)mediaListUpdated
{
[self.tableView reloadData];
NSUInteger count = _dropboxController.currentListFiles.count;
if (count != 1)
_numberOfFilesBarButtonItem.title = [NSString stringWithFormat:NSLocalizedString(@"NUM_OF_FILES", @""), count];
else
_numberOfFilesBarButtonItem.title = NSLocalizedString(@"ONE_FILE", @"");
}
#pragma mark - communication with app delegate
......
......@@ -36,7 +36,7 @@
<object class="IBUITableView" id="873029372">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<string key="NSFrame">{{0, 20}, {320, 548}}</string>
<string key="NSFrame">{{0, 20}, {320, 504}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<object class="NSColor" key="IBUIBackgroundColor" id="651013553">
......@@ -47,6 +47,9 @@
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUISimulatedToolbarMetrics" key="IBUISimulatedBottomBarMetrics">
<int key="IBUIBarStyle">1</int>
</object>
<object class="IBUIScreenMetrics" key="IBUISimulatedDestinationMetrics" id="507962971">
<string key="IBUISimulatedSizeMetricsClass">IBUIScreenMetrics</string>
<object class="NSMutableDictionary" key="IBUINormalizedOrientationToSizeMap">
......
B"CHOOSE_AUDIO_TRACK"="Audiospur wählen";
......
B"CHOOSE_AUDIO_TRACK"="Choose Audio Track";
......
B"CHOOSE_AUDIO_TRACK"="Choisir Piste Audio";
......
B"CHOOSE_AUDIO_TRACK"="Выберите аудио поток";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment