added support for custom host

This commit is contained in:
Diego Waxemberg
2014-10-20 20:08:12 -04:00
parent 37428c8c77
commit 85ee4f6518
6 changed files with 35 additions and 7 deletions
+1
View File
@@ -14,5 +14,6 @@
@property BOOL paired; @property BOOL paired;
- (id) initWithHost:(NSNetService*)host; - (id) initWithHost:(NSNetService*)host;
- (id) initWithIp:(NSString*)host;
@end @end
+9
View File
@@ -19,4 +19,13 @@
return self; return self;
} }
- (id) initWithIp:(NSString*)host {
self = [super init];
self.hostName = host;
self.displayName = host;
return self;
}
@end @end
+1 -2
View File
@@ -18,8 +18,7 @@
@property (strong, nonatomic) IBOutlet UIPickerView *StreamConfigs; @property (strong, nonatomic) IBOutlet UIPickerView *StreamConfigs;
@property (strong, nonatomic) NSArray* streamConfigVals; @property (strong, nonatomic) NSArray* streamConfigVals;
@property (strong, nonatomic) NSArray* hostPickerVals; @property (strong, nonatomic) NSArray* hostPickerVals;
@property (strong, nonatomic) IBOutlet UITextField *hostTextField;
- (void) segueIntoStream;
+ (NSString*) getHost; + (NSString*) getHost;
+8
View File
@@ -29,6 +29,10 @@ static NSString* host;
- (void)PairButton:(UIButton *)sender - (void)PairButton:(UIButton *)sender
{ {
NSLog(@"Pair Button Pressed!"); 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]; [CryptoManager generateKeyPairUsingSSl];
NSString* uniqueId = [CryptoManager getUniqueID]; NSString* uniqueId = [CryptoManager getUniqueID];
NSData* cert = [CryptoManager readCertFromFile]; NSData* cert = [CryptoManager readCertFromFile];
@@ -65,6 +69,10 @@ static NSString* host;
- (void)StreamButton:(UIButton *)sender - (void)StreamButton:(UIButton *)sender
{ {
NSLog(@"Stream Button Pressed!"); 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; host = _selectedHost.hostName;
[self performSegueWithIdentifier:@"createStreamFrame" sender:self]; [self performSegueWithIdentifier:@"createStreamFrame" sender:self];
} }
+8 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="14A389" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="wb7-af-jn8"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6250" systemVersion="14A388a" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="wb7-af-jn8">
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--Main Frame View Controller--> <!--Main Frame View Controller-->
@@ -50,6 +50,11 @@
<action selector="PairButton:" destination="wb7-af-jn8" eventType="touchUpInside" id="Ct1-6m-aYg"/> <action selector="PairButton:" destination="wb7-af-jn8" eventType="touchUpInside" id="Ct1-6m-aYg"/>
</connections> </connections>
</button> </button>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Geforce Host" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="OCq-Pr-kFE">
<rect key="frame" x="374" y="235" width="276" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view> </view>
@@ -57,6 +62,7 @@
<connections> <connections>
<outlet property="HostPicker" destination="bJR-sz-8uh" id="pWB-P3-ZJ2"/> <outlet property="HostPicker" destination="bJR-sz-8uh" id="pWB-P3-ZJ2"/>
<outlet property="StreamConfigs" destination="rnA-uG-hAA" id="LPP-jQ-5eW"/> <outlet property="StreamConfigs" destination="rnA-uG-hAA" id="LPP-jQ-5eW"/>
<outlet property="hostTextField" destination="OCq-Pr-kFE" id="HS2-KF-inc"/>
<segue destination="OIm-0n-i9v" kind="modal" identifier="createStreamFrame" modalPresentationStyle="fullScreen" id="MOD-9A-3Sk"/> <segue destination="OIm-0n-i9v" kind="modal" identifier="createStreamFrame" modalPresentationStyle="fullScreen" id="MOD-9A-3Sk"/>
</connections> </connections>
</viewController> </viewController>
+8 -3
View File
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="dgh-JZ-Q7z"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6250" systemVersion="14A388a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="dgh-JZ-Q7z">
<dependencies> <dependencies>
<deployment defaultVersion="2048" identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--Main Frame View Controller--> <!--Main Frame View Controller-->
@@ -52,6 +51,11 @@
<outlet property="delegate" destination="dgh-JZ-Q7z" id="dTy-8g-aj1"/> <outlet property="delegate" destination="dgh-JZ-Q7z" id="dTy-8g-aj1"/>
</connections> </connections>
</pickerView> </pickerView>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Geforce Host" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="unc-nO-WPH">
<rect key="frame" x="82" y="193" width="156" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints> <constraints>
@@ -73,6 +77,7 @@
<connections> <connections>
<outlet property="HostPicker" destination="nFR-to-qQs" id="lTE-tT-lYY"/> <outlet property="HostPicker" destination="nFR-to-qQs" id="lTE-tT-lYY"/>
<outlet property="StreamConfigs" destination="0xb-lk-PHK" id="VxB-Ur-PNy"/> <outlet property="StreamConfigs" destination="0xb-lk-PHK" id="VxB-Ur-PNy"/>
<outlet property="hostTextField" destination="unc-nO-WPH" id="MbD-KQ-MoG"/>
<segue destination="mI3-9F-XwU" kind="modal" identifier="createStreamFrame" id="cPc-eP-un1"/> <segue destination="mI3-9F-XwU" kind="modal" identifier="createStreamFrame" id="cPc-eP-un1"/>
</connections> </connections>
</viewController> </viewController>