diff --git a/Limelight/Computer.h b/Limelight/Computer.h index 17fec12..854a3dd 100644 --- a/Limelight/Computer.h +++ b/Limelight/Computer.h @@ -14,5 +14,6 @@ @property BOOL paired; - (id) initWithHost:(NSNetService*)host; +- (id) initWithIp:(NSString*)host; @end diff --git a/Limelight/Computer.m b/Limelight/Computer.m index 2d03366..6a7cb22 100644 --- a/Limelight/Computer.m +++ b/Limelight/Computer.m @@ -19,4 +19,13 @@ return self; } +- (id) initWithIp:(NSString*)host { + self = [super init]; + + self.hostName = host; + self.displayName = host; + + return self; +} + @end diff --git a/Limelight/MainFrameViewController.h b/Limelight/MainFrameViewController.h index 3dcb829..93a70c6 100644 --- a/Limelight/MainFrameViewController.h +++ b/Limelight/MainFrameViewController.h @@ -18,8 +18,7 @@ @property (strong, nonatomic) IBOutlet UIPickerView *StreamConfigs; @property (strong, nonatomic) NSArray* streamConfigVals; @property (strong, nonatomic) NSArray* hostPickerVals; - -- (void) segueIntoStream; +@property (strong, nonatomic) IBOutlet UITextField *hostTextField; + (NSString*) getHost; diff --git a/Limelight/MainFrameViewController.m b/Limelight/MainFrameViewController.m index 726eb43..4d78225 100644 --- a/Limelight/MainFrameViewController.m +++ b/Limelight/MainFrameViewController.m @@ -29,6 +29,10 @@ static NSString* host; - (void)PairButton:(UIButton *)sender { NSLog(@"Pair Button Pressed!"); + if ([self.hostTextField.text length] > 0) { + _selectedHost = [[Computer alloc] initWithIp:self.hostTextField.text]; + NSLog(@"Using custom host: %@", self.hostTextField.text); + } [CryptoManager generateKeyPairUsingSSl]; NSString* uniqueId = [CryptoManager getUniqueID]; NSData* cert = [CryptoManager readCertFromFile]; @@ -65,6 +69,10 @@ static NSString* host; - (void)StreamButton:(UIButton *)sender { NSLog(@"Stream Button Pressed!"); + if ([self.hostTextField.text length] > 0) { + _selectedHost = [[Computer alloc] initWithIp:self.hostTextField.text]; + NSLog(@"Using custom host: %@", self.hostTextField.text); + } host = _selectedHost.hostName; [self performSegueWithIdentifier:@"createStreamFrame" sender:self]; } diff --git a/MainFrame-iPad.storyboard b/MainFrame-iPad.storyboard index beb2966..18c5087 100644 --- a/MainFrame-iPad.storyboard +++ b/MainFrame-iPad.storyboard @@ -1,7 +1,7 @@ - + - + @@ -50,6 +50,11 @@ + + + + + @@ -57,6 +62,7 @@ + diff --git a/MainFrame-iPhone.storyboard b/MainFrame-iPhone.storyboard index b00cd4e..8418625 100644 --- a/MainFrame-iPhone.storyboard +++ b/MainFrame-iPhone.storyboard @@ -1,8 +1,7 @@ - + - - + @@ -52,6 +51,11 @@ + + + + + @@ -73,6 +77,7 @@ +