Add current host name button

Add re-select host button and show current host name.
This commit is contained in:
Yuki MIZUNO
2014-12-04 19:54:21 +09:00
parent 35dc4a7de3
commit d5c12a3eb6
4 changed files with 21 additions and 0 deletions

View File

@@ -17,6 +17,7 @@
@interface MainFrameViewController : UICollectionViewController <MDNSCallback, PairCallback, HostCallback, AppCallback, AppAssetCallback, NSURLConnectionDelegate, SWRevealViewControllerDelegate>
@property (strong, nonatomic) IBOutlet UIButton *limelightLogoButton;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *computerNameButton;
+ (StreamConfiguration*) getStreamConfiguration;

View File

@@ -70,11 +70,19 @@ static StreamConfiguration* streamConfig;
appList = [HttpManager getAppListFromXML:appListResp];
dispatch_async(dispatch_get_main_queue(), ^{
[self updateApps];
_computerNameButton.title = _selectedHost.displayName;
});
[AppManager retrieveAppAssets:appList withManager:hMan andCallback:self];
});
}
- (void)showHostSelectionView {
appList = [[NSArray alloc] init];
_computerNameButton.title = @"";
[self.collectionView reloadData];
[self.view addSubview:hostScrollView];
}
- (void) receivedAssetForApp:(App*)app {
[self.collectionView reloadData];
}
@@ -161,6 +169,10 @@ static StreamConfiguration* streamConfig;
// Set the side bar button action. When it's tapped, it'll show up the sidebar.
[_limelightLogoButton addTarget:self.revealViewController action:@selector(revealToggle:) forControlEvents:UIControlEventTouchDown];
// Set the host name button action. When it's tapped, it'll show up the host selection view.
[_computerNameButton setTarget:self];
[_computerNameButton setAction:@selector(showHostSelectionView)];
// Set the gesture
[self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];

View File

@@ -46,9 +46,13 @@
</state>
</button>
</barButtonItem>
<barButtonItem key="rightBarButtonItem" id="KDy-JC-2sU">
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</barButtonItem>
</navigationItem>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
<connections>
<outlet property="computerNameButton" destination="KDy-JC-2sU" id="Lkg-yz-GE6"/>
<outlet property="limelightLogoButton" destination="Tiq-VS-Ua5" id="cue-NW-Hty"/>
<segue destination="OIm-0n-i9v" kind="push" identifier="createStreamFrame" id="7gN-E7-Ips"/>
</connections>

View File

@@ -47,9 +47,13 @@
</state>
</button>
</barButtonItem>
<barButtonItem key="rightBarButtonItem" id="L1H-n4-HB7">
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</barButtonItem>
</navigationItem>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
<connections>
<outlet property="computerNameButton" destination="L1H-n4-HB7" id="bng-Ky-oQs"/>
<outlet property="limelightLogoButton" destination="pZ9-ft-T24" id="yRw-rK-9lQ"/>
<segue destination="mI3-9F-XwU" kind="push" identifier="createStreamFrame" id="Vgc-B6-lvM"/>
</connections>