host view improvements
This commit is contained in:
@@ -595,22 +595,24 @@ static NSMutableSet* hostList;
|
||||
Log(LOG_D, @"Long clicked host: %@", host.name);
|
||||
NSString* message;
|
||||
|
||||
NSString* hostAddress = [host.activeAddress componentsSeparatedByString:@":"].firstObject;
|
||||
|
||||
switch (host.state) {
|
||||
case StateOffline:
|
||||
message = [LocalizationHelper localizedStringForKey:@"Offline"];
|
||||
message = [LocalizationHelper localizedStringForKey:@"Offline\n%@", hostAddress ? hostAddress : @"Unknown address"];
|
||||
break;
|
||||
|
||||
case StateOnline:
|
||||
if (host.pairState == PairStatePaired) {
|
||||
message = [LocalizationHelper localizedStringForKey:@"Online - Paired"];
|
||||
message = [LocalizationHelper localizedStringForKey:@"Online - Paired\n%@", hostAddress ? hostAddress : @"Unknown address"];
|
||||
}
|
||||
else {
|
||||
message = [LocalizationHelper localizedStringForKey:@"Online - Not Paired"];
|
||||
message = [LocalizationHelper localizedStringForKey:@"Online - Not Paired\n%@", hostAddress ? hostAddress : @"Unknown address"];
|
||||
}
|
||||
break;
|
||||
|
||||
case StateUnknown:
|
||||
message = [LocalizationHelper localizedStringForKey:@"Connecting"];
|
||||
message = [LocalizationHelper localizedStringForKey:@"Connecting\n"];
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -620,7 +622,7 @@ static NSMutableSet* hostList;
|
||||
UIAlertController* longClickAlert = [UIAlertController alertControllerWithTitle:host.name message:message preferredStyle:UIAlertControllerStyleActionSheet];
|
||||
|
||||
if (host.state != StateOnline) {
|
||||
/*[longClickAlert addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Wake PC"] style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
||||
[longClickAlert addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Wake PC"] style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
||||
UIAlertController* wolAlert = [UIAlertController alertControllerWithTitle:[LocalizationHelper localizedStringForKey:@"Wake-On-LAN"] message:@"" preferredStyle:UIAlertControllerStyleAlert];
|
||||
[wolAlert addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Ok"] style:UIAlertActionStyleDefault handler:nil]];
|
||||
if (host.mac == nil || [host.mac isEqualToString:@"00:00:00:00:00:00"]) {
|
||||
@@ -632,7 +634,7 @@ static NSMutableSet* hostList;
|
||||
wolAlert.message = [LocalizationHelper localizedStringForKey:@"Successfully sent wake-up request. It may take a few moments for the PC to wake. If it never wakes up, ensure it's properly configured for Wake-on-LAN."];
|
||||
}
|
||||
[[self activeViewController] presentViewController:wolAlert animated:YES completion:nil];
|
||||
}]];*/
|
||||
}]];
|
||||
}
|
||||
else if (host.pairState == PairStatePaired) {
|
||||
/*
|
||||
@@ -642,18 +644,14 @@ static NSMutableSet* hostList;
|
||||
}]]; */
|
||||
|
||||
#if !TARGET_OS_TV
|
||||
if (false) {
|
||||
[longClickAlert addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"NVIDIA GameStream End-of-Service"] style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
||||
[Utils launchUrl:@"https://github.com/moonlight-stream/moonlight-docs/wiki/NVIDIA-GameStream-End-Of-Service-Announcement-FAQ"];
|
||||
}]];
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
[longClickAlert addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Test Network"] style:UIAlertActionStyleDefault handler:^(UIAlertAction* action) {
|
||||
/*[longClickAlert addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Test Network"] style:UIAlertActionStyleDefault handler:^(UIAlertAction* action) {
|
||||
[self showLoadingFrame:^{
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
// Perform the network test on a GCD worker thread. It may take a while.
|
||||
unsigned int portTestResult = LiTestClientConnectivity(CONN_TEST_SERVER, 443, ML_PORT_FLAG_ALL);
|
||||
unsigned int portTestResult = LiTestClientConnectivity([host.activeAddress UTF8String], 443, ML_PORT_FLAG_ALL);
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
[self hideLoadingFrame:^{
|
||||
NSString* message;
|
||||
@@ -679,8 +677,9 @@ static NSMutableSet* hostList;
|
||||
});
|
||||
});
|
||||
}];
|
||||
}]];
|
||||
}]];*/
|
||||
#if !TARGET_OS_TV
|
||||
/*
|
||||
if (host.state != StateOnline) {
|
||||
[longClickAlert addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"NVIDIA GameStream End-of-Service"] style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
||||
[Utils launchUrl:@"https://github.com/moonlight-stream/moonlight-docs/wiki/NVIDIA-GameStream-End-Of-Service-Announcement-FAQ"];
|
||||
@@ -688,7 +687,7 @@ static NSMutableSet* hostList;
|
||||
[longClickAlert addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Connection Help"] style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
||||
[Utils launchUrl:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"];
|
||||
}]];
|
||||
}
|
||||
}*/
|
||||
#endif
|
||||
[longClickAlert addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Remove Host"] style:UIAlertActionStyleDestructive handler:^(UIAlertAction* action) { // host removed here
|
||||
[self->_discMan removeHostFromDiscovery:host];
|
||||
@@ -746,7 +745,7 @@ static NSMutableSet* hostList;
|
||||
}];
|
||||
});
|
||||
} else {
|
||||
unsigned int portTestResults = LiTestClientConnectivity(CONN_TEST_SERVER, 443,
|
||||
unsigned int portTestResults = LiTestClientConnectivity([host.activeAddress UTF8String], 443,
|
||||
ML_PORT_FLAG_TCP_47984 | ML_PORT_FLAG_TCP_47989);
|
||||
if (portTestResults != ML_TEST_RESULT_INCONCLUSIVE && portTestResults != 0) {
|
||||
error = [error stringByAppendingString:[LocalizationHelper localizedStringForKey:@"!ML_TEST_RESULT_INCONCLUSIVE"]];
|
||||
@@ -1932,7 +1931,7 @@ static NSMutableSet* hostList;
|
||||
[self updateHostShortcuts];
|
||||
|
||||
// Update the title in case we now have a PC
|
||||
[self updateTitle];
|
||||
// [self updateTitle];
|
||||
|
||||
// Reset state first so we can rediscover hosts that were deleted before
|
||||
[_discMan resetDiscoveryState];
|
||||
|
||||
Reference in New Issue
Block a user