Commit 97a7c334 authored by Pierre SAGASPE's avatar Pierre SAGASPE Committed by Felix Paul Kühne

Remove deprecated API calls and add TextField delegation

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent eae7beff
......@@ -20,7 +20,7 @@
#define kVLCDownloadViaFTP 2
@interface VLCDownloadViewController () <WRRequestDelegate, UITableViewDataSource, UITableViewDelegate,
VLCHTTPFileDownloader>
VLCHTTPFileDownloader, UITextFieldDelegate>
{
NSMutableArray *_currentDownloads;
NSUInteger _currentDownloadType;
......@@ -49,6 +49,7 @@
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
self.title = NSLocalizedString(@"DOWNLOAD_FROM_HTTP", @"");
self.whatToDownloadHelpLabel.text = [NSString stringWithFormat:NSLocalizedString(@"DOWNLOAD_FROM_HTTP_HELP", @""), [[UIDevice currentDevice] model]];
self.urlField.delegate = self;
[super viewDidLoad];
}
......@@ -299,4 +300,10 @@
[self _triggerNextDownload];
}
#pragma mark - text view delegate
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[self.urlField resignFirstResponder];
return NO;
}
@end
......@@ -11,7 +11,7 @@
#import "VLCNetworkLoginViewController.h"
#import "UIBarButtonItem+Theme.h"
@interface VLCNetworkLoginViewController ()
@interface VLCNetworkLoginViewController () <UITextFieldDelegate>
@end
......@@ -34,6 +34,16 @@
self.loginHelpLabel.text = NSLocalizedString(@"ENTER_SERVER_CREDS_HELP",@"");
self.usernameLabel.text = NSLocalizedString(@"USER_LABEL", @"");
self.passwordLabel.text = NSLocalizedString(@"PASSWORD_LABEL", @"");
self.serverAddressField.delegate = self;
self.serverAddressField.returnKeyType = UIReturnKeyNext;
self.serverAddressField.clearButtonMode = UITextFieldViewModeWhileEditing;
self.usernameField.delegate = self;
self.usernameField.returnKeyType = UIReturnKeyNext;
self.usernameField.clearButtonMode = UITextFieldViewModeWhileEditing;
self.passwordField.delegate = self;
self.passwordField.returnKeyType = UIReturnKeyDone;
self.passwordField.clearButtonMode = UITextFieldViewModeWhileEditing;
}
- (void)viewWillAppear:(BOOL)animated
......@@ -78,4 +88,26 @@
}
}
#pragma mark - text view delegate
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
if ([self.serverAddressField isFirstResponder])
{
[self.serverAddressField resignFirstResponder];
[self.usernameField becomeFirstResponder];
}
else if ([self.usernameField isFirstResponder])
{
[self.usernameField resignFirstResponder];
[self.passwordField becomeFirstResponder];
}
else if ([self.passwordField isFirstResponder])
{
[self.passwordField resignFirstResponder];
//[self connectToServer:nil];
}
return NO;
}
@end
......@@ -15,7 +15,7 @@
#import "UINavigationController+Theme.h"
#import "VLCMenuTableViewController.h"
@interface VLCOpenNetworkStreamViewController () <UITableViewDataSource, UITableViewDelegate>
@interface VLCOpenNetworkStreamViewController () <UITableViewDataSource, UITableViewDelegate, UITextFieldDelegate>
{
NSMutableArray *_recentURLs;
}
......@@ -40,6 +40,7 @@
self.title = NSLocalizedString(@"OPEN_NETWORK", @"");
self.navigationItem.leftBarButtonItem = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(goBack:)];
[self.whatToOpenHelpLabel setText:NSLocalizedString(@"OPEN_NETWORK_HELP", @"")];
self.urlField.delegate = self;
}
- (void)viewWillAppear:(BOOL)animated
......@@ -174,4 +175,11 @@
[appDelegate.playlistViewController performSelector:@selector(openMovieFromURL:) withObject:[NSURL URLWithString:url] afterDelay:kGHRevealSidebarDefaultAnimationDuration];
}
#pragma mark - text view delegate
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[self.urlField resignFirstResponder];
return NO;
}
@end
......@@ -46,7 +46,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{5, 8}, {64, 64}}</string>
<reference key="NSSuperview" ref="162418872"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="207506414"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
......@@ -57,7 +56,6 @@
<int key="NSvFlags">290</int>
<string key="NSFrame">{{83, 21}, {177, 21}}</string>
<reference key="NSSuperview" ref="162418872"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1019407525"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
......@@ -88,7 +86,6 @@
<int key="NSvFlags">290</int>
<string key="NSFrame">{{83, 29}, {232, 21}}</string>
<reference key="NSSuperview" ref="162418872"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="350446581"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
......@@ -109,7 +106,6 @@
<int key="NSvFlags">290</int>
<string key="NSFrame">{{83, 44}, {177, 15}}</string>
<reference key="NSSuperview" ref="162418872"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="167761471"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
......@@ -178,7 +174,6 @@
<int key="NSvFlags">-2147483358</int>
<string key="NSFrame">{{83, 29}, {177, 21}}</string>
<reference key="NSSuperview" ref="162418872"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="625431089"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
......@@ -203,7 +198,6 @@
</array>
<string key="NSFrameSize">{320, 79}</string>
<reference key="NSSuperview" ref="962619467"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="784253519"/>
<string key="NSReuseIdentifierKey">_NS:11</string>
<object class="NSColor" key="IBUIBackgroundColor">
......@@ -219,7 +213,6 @@
</array>
<string key="NSFrameSize">{320, 80}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="162418872"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
......@@ -376,71 +369,7 @@
<nil key="sourceID"/>
<int key="maxID">29</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">VLCLocalNetworkListCell</string>
<string key="superclassName">UITableViewCell</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">triggerDownload:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">triggerDownload:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">triggerDownload:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="downloadButton">UIButton</string>
<string key="folderTitleLabel">UILabel</string>
<string key="statusLabel">VLCStatusLabel</string>
<string key="subtitleLabel">UILabel</string>
<string key="thumbnailView">UIImageView</string>
<string key="titleLabel">UILabel</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="downloadButton">
<string key="name">downloadButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="folderTitleLabel">
<string key="name">folderTitleLabel</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo" key="statusLabel">
<string key="name">statusLabel</string>
<string key="candidateClassName">VLCStatusLabel</string>
</object>
<object class="IBToOneOutletInfo" key="subtitleLabel">
<string key="name">subtitleLabel</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo" key="thumbnailView">
<string key="name">thumbnailView</string>
<string key="candidateClassName">UIImageView</string>
</object>
<object class="IBToOneOutletInfo" key="titleLabel">
<string key="name">titleLabel</string>
<string key="candidateClassName">UILabel</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/VLCLocalNetworkListCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">VLCStatusLabel</string>
<string key="superclassName">UILabel</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/VLCStatusLabel.h</string>
</object>
</object>
</array>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
......
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