Commit e2a556f4 authored by Pierre SAGASPE's avatar Pierre SAGASPE Committed by Carola Nitz

networkLogin : add alert view if the protocol are not selected for saving or connecting

(cherry picked from commit 529bf307)
parent e2333144
Pipeline #122 failed with stage
in 0 seconds
......@@ -188,6 +188,9 @@
- (void)saveLoginDataSource:(VLCNetworkLoginDataSourceLogin *)dataSource
{
if (!self.protocolSelected)
return;
VLCNetworkServerLoginInformation *login = dataSource.loginInformation;
// TODO: move somewere else?
// Normalize Plex login
......@@ -213,6 +216,9 @@
- (void)connectLoginDataSource:(VLCNetworkLoginDataSourceLogin *)dataSource
{
if (!self.protocolSelected)
return;
VLCNetworkServerLoginInformation *loginInformation = dataSource.loginInformation;
self.loginInformation = loginInformation;
......@@ -222,8 +228,7 @@
_activityBackgroundView.hidden = NO;
[_activityIndicator startAnimating];
[self performSelectorInBackground:@selector(_plexLogin)
withObject:nil];
[self performSelectorInBackground:@selector(_plexLogin) withObject:nil];
} else {
[self.delegate loginWithLoginViewController:self loginInfo:dataSource.loginInformation];
}
......@@ -231,6 +236,21 @@
[self.tableView deselectRowAtIndexPath:self.tableView.indexPathForSelectedRow animated:YES];
}
- (BOOL)protocolSelected
{
if (self.protocolDataSource.protocol == VLCServerProtocolUndefined) {
VLCAlertView *alertView = [[VLCAlertView alloc] initWithTitle:NSLocalizedString(@"PROTOCOL_NOT_SELECTED", nil)
message:NSLocalizedString(@"PROTOCOL_NOT_SELECTED", nil)
cancelButtonTitle:NSLocalizedString(@"BUTTON_OK", nil)
otherButtonTitles:nil];
[alertView performSelectorOnMainThread:@selector(show) withObject:nil waitUntilDone:NO];
[self.tableView deselectRowAtIndexPath:self.tableView.indexPathForSelectedRow animated:YES];
return NO;
}
return YES;
}
#pragma mark - VLCNetworkLoginDataSourceSavedLoginsDelegate
- (void)loginsDataSource:(VLCNetworkLoginDataSourceSavedLogins *)dataSource selectedLogin:(VLCNetworkServerLoginInformation *)login
{
......
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