From d5c12a3eb65539e922708a583b5320ca3f4df7ce Mon Sep 17 00:00:00 2001 From: Yuki MIZUNO Date: Thu, 4 Dec 2014 19:54:21 +0900 Subject: [PATCH] Add current host name button Add re-select host button and show current host name. --- Limelight/ViewControllers/MainFrameViewController.h | 1 + Limelight/ViewControllers/MainFrameViewController.m | 12 ++++++++++++ iPad.storyboard | 4 ++++ iPhone.storyboard | 4 ++++ 4 files changed, 21 insertions(+) diff --git a/Limelight/ViewControllers/MainFrameViewController.h b/Limelight/ViewControllers/MainFrameViewController.h index 43d1df8..60ccbca 100644 --- a/Limelight/ViewControllers/MainFrameViewController.h +++ b/Limelight/ViewControllers/MainFrameViewController.h @@ -17,6 +17,7 @@ @interface MainFrameViewController : UICollectionViewController @property (strong, nonatomic) IBOutlet UIButton *limelightLogoButton; +@property (weak, nonatomic) IBOutlet UIBarButtonItem *computerNameButton; + (StreamConfiguration*) getStreamConfiguration; diff --git a/Limelight/ViewControllers/MainFrameViewController.m b/Limelight/ViewControllers/MainFrameViewController.m index 3cf3a9a..e52db0f 100644 --- a/Limelight/ViewControllers/MainFrameViewController.m +++ b/Limelight/ViewControllers/MainFrameViewController.m @@ -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]; diff --git a/iPad.storyboard b/iPad.storyboard index b383b41..3f8b574 100644 --- a/iPad.storyboard +++ b/iPad.storyboard @@ -46,9 +46,13 @@ + + + + diff --git a/iPhone.storyboard b/iPhone.storyboard index 4d811c0..e9eb55f 100644 --- a/iPhone.storyboard +++ b/iPhone.storyboard @@ -47,9 +47,13 @@ + + + +