Commit 0d3ea673 authored by Carola's avatar Carola
Browse files

LocalServer: fix behaviour for failed server login

parent c785257c
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -43,6 +43,10 @@
#define kVLCFTPLogin @"ftp-login"
#define kVLCFTPPassword @"ftp-pass"
#define kVLCLastFTPServer @"last-ftp-server"
#define kVLCLastFTPLogin @"last-ftp-login"
#define kVLCLastFTPPassword @"last-ftp-pass"
#define kSupportedFileExtensions @"\\.(3gp|3gp|3gp2|3gpp|amv|asf|avi|axv|divx|dv|flv|f4v|gvi|gxf|m1v|m2p|m2t|m2ts|m2v|m4v|mks|mkv|moov|mov|mp2v|mp4|mpeg|mpeg1|mpeg2|mpeg4|mpg|mpv|mt2s|mts|mxf|nsv|nuv|oga|ogg|ogm|ogv|ogx|spx|ps|qt|rec|rm|rmvb|tod|ts|tts|vob|vro|webm|wm|wmv|wtv|xesc)$"
#define kSupportedSubtitleFileExtensions @"\\.(cdg|idx|srt|sub|utf|ass|ssa|aqt|jss|psb|rt|smi|txt|smil)$"
#define kSupportedAudioFileExtensions @"\\.(aac|aiff|aif|amr|aob|ape|axa|flac|it|m2a|m4a|mka|mlp|mod|mp1|mp2|mp3|mpa|mpc|oga|oma|opus|rmi|s3m|spx|tta|voc|vqf|wav|wma|wv|xa|xm)$"
......
......@@ -395,7 +395,7 @@
- (void)requestFailed:(WRRequest *)request
{
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@"ERROR_NUMBER", @""), request.error.errorCode] message:request.error.message delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"") otherButtonTitles:nil];
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"LOCAL_SERVER_CONNECTION_FAILED_TITLE", nil) message:NSLocalizedString(@"LOCAL_SERVER_CONNECTION_FAILED_MESSAGE", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"") otherButtonTitles:nil];
[alert show];
APLog(@"request %@ failed with error %i", request, request.error.errorCode);
......
......@@ -288,7 +288,6 @@
- (void)loginToURL:(NSURL *)url confirmedWithUsername:(NSString *)username andPassword:(NSString *)password
{
_loginViewController = nil;
if ([url.scheme isEqualToString:@"ftp"]) {
if (url.host.length > 0) {
VLCLocalServerFolderListViewController *targetViewController = [[VLCLocalServerFolderListViewController alloc] initWithFTPServer:url.host userName:username andPassword:password atPath:@"/"];
......
......@@ -81,6 +81,14 @@
_savePass = [NSMutableArray arrayWithArray:[defaults objectForKey:kVLCFTPPassword]];
[super viewWillAppear:animated];
if ([defaults stringForKey:kVLCLastFTPServer])
self.serverAddressField.text = [defaults stringForKey:kVLCLastFTPServer];
if ([defaults stringForKey:kVLCLastFTPLogin])
self.usernameField.text = [defaults stringForKey:kVLCLastFTPLogin];
if ([defaults stringForKey:kVLCLastFTPPassword])
self.passwordField.text = [defaults stringForKey:kVLCLastFTPPassword];
if (_hostname.length > 0)
self.serverAddressField.text = _hostname;
if (_username.length > 0)
......@@ -89,6 +97,16 @@
self.passwordField.text = _password;
}
- (void)viewWillDisappear:(BOOL)animated
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:self.serverAddressField.text forKey:kVLCLastFTPServer];
[defaults setObject:self.usernameField.text forKey:kVLCLastFTPLogin];
[defaults setObject:self.passwordField.text forKey:kVLCLastFTPPassword];
[super viewWillDisappear:animated];
}
- (IBAction)dismissWithAnimation:(id)sender
{
if (SYSTEM_RUNS_IOS7_OR_LATER)
......
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