mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 14:11:35 +00:00
Remove help links from tvOS version due to lack of browser and WebKit
This commit is contained in:
@@ -20,6 +20,7 @@ FOUNDATION_EXPORT NSString *const deviceName;
|
|||||||
+ (NSString*) bytesToHex:(NSData*)data;
|
+ (NSString*) bytesToHex:(NSData*)data;
|
||||||
+ (NSData*) hexToBytes:(NSString*) hex;
|
+ (NSData*) hexToBytes:(NSString*) hex;
|
||||||
+ (int) resolveHost:(NSString*)host;
|
+ (int) resolveHost:(NSString*)host;
|
||||||
|
+ (void) addHelpOptionToDialog:(UIAlertController*)dialog;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,15 @@ NSString *const deviceName = @"roth";
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (void) addHelpOptionToDialog:(UIAlertController*)dialog {
|
||||||
|
#if !TARGET_OS_TV
|
||||||
|
// tvOS doesn't have a browser
|
||||||
|
[dialog addAction:[UIAlertAction actionWithTitle:@"Help" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
||||||
|
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"]];
|
||||||
|
}]];
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation NSString (NSStringWithTrim)
|
@implementation NSString (NSStringWithTrim)
|
||||||
|
|||||||
@@ -74,9 +74,7 @@ static NSMutableSet* hostList;
|
|||||||
UIAlertController* failedDialog = [UIAlertController alertControllerWithTitle:@"Pairing Failed"
|
UIAlertController* failedDialog = [UIAlertController alertControllerWithTitle:@"Pairing Failed"
|
||||||
message:message
|
message:message
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
[failedDialog addAction:[UIAlertAction actionWithTitle:@"Help" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
[Utils addHelpOptionToDialog:failedDialog];
|
||||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"]];
|
|
||||||
}]];
|
|
||||||
[failedDialog addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
|
[failedDialog addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
|
||||||
|
|
||||||
[self hideLoadingFrame: ^{
|
[self hideLoadingFrame: ^{
|
||||||
@@ -154,9 +152,7 @@ static NSMutableSet* hostList;
|
|||||||
UIAlertController* applistAlert = [UIAlertController alertControllerWithTitle:@"Fetching App List Failed"
|
UIAlertController* applistAlert = [UIAlertController alertControllerWithTitle:@"Fetching App List Failed"
|
||||||
message:@"The connection to the PC was interrupted."
|
message:@"The connection to the PC was interrupted."
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
[applistAlert addAction:[UIAlertAction actionWithTitle:@"Help" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
[Utils addHelpOptionToDialog:applistAlert];
|
||||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"]];
|
|
||||||
}]];
|
|
||||||
[applistAlert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
|
[applistAlert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
|
||||||
[self hideLoadingFrame: ^{
|
[self hideLoadingFrame: ^{
|
||||||
[[self activeViewController] presentViewController:applistAlert animated:YES completion:nil];
|
[[self activeViewController] presentViewController:applistAlert animated:YES completion:nil];
|
||||||
@@ -272,9 +268,7 @@ static NSMutableSet* hostList;
|
|||||||
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Network Error"
|
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Network Error"
|
||||||
message:@"Failed to resolve host."
|
message:@"Failed to resolve host."
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
[alert addAction:[UIAlertAction actionWithTitle:@"Help" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
[Utils addHelpOptionToDialog:alert];
|
||||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"]];
|
|
||||||
}]];
|
|
||||||
[alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
|
[alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
|
||||||
[[self activeViewController] presentViewController:alert animated:YES completion:nil];
|
[[self activeViewController] presentViewController:alert animated:YES completion:nil];
|
||||||
}
|
}
|
||||||
@@ -329,9 +323,7 @@ static NSMutableSet* hostList;
|
|||||||
UIAlertController* applistAlert = [UIAlertController alertControllerWithTitle:@"Fetching Server Info Failed"
|
UIAlertController* applistAlert = [UIAlertController alertControllerWithTitle:@"Fetching Server Info Failed"
|
||||||
message:@"The connection to the PC was interrupted."
|
message:@"The connection to the PC was interrupted."
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
[applistAlert addAction:[UIAlertAction actionWithTitle:@"Help" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
[Utils addHelpOptionToDialog:applistAlert];
|
||||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"]];
|
|
||||||
}]];
|
|
||||||
[applistAlert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
|
[applistAlert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
|
||||||
|
|
||||||
if (view != nil) {
|
if (view != nil) {
|
||||||
@@ -401,9 +393,11 @@ static NSMutableSet* hostList;
|
|||||||
[[self activeViewController] presentViewController:wolAlert animated:YES completion:nil];
|
[[self activeViewController] presentViewController:wolAlert animated:YES completion:nil];
|
||||||
}]];
|
}]];
|
||||||
|
|
||||||
|
#if !TARGET_OS_TV
|
||||||
[longClickAlert addAction:[UIAlertAction actionWithTitle:@"Connection Help" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
[longClickAlert addAction:[UIAlertAction actionWithTitle:@"Connection Help" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
||||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"]];
|
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"]];
|
||||||
}]];
|
}]];
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
[longClickAlert addAction:[UIAlertAction actionWithTitle:@"Remove Host" style:UIAlertActionStyleDestructive handler:^(UIAlertAction* action) {
|
[longClickAlert addAction:[UIAlertAction actionWithTitle:@"Remove Host" style:UIAlertActionStyleDestructive handler:^(UIAlertAction* action) {
|
||||||
[self->_discMan removeHostFromDiscovery:host];
|
[self->_discMan removeHostFromDiscovery:host];
|
||||||
@@ -444,9 +438,7 @@ static NSMutableSet* hostList;
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
UIAlertController* hostNotFoundAlert = [UIAlertController alertControllerWithTitle:@"Add Host" message:error preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController* hostNotFoundAlert = [UIAlertController alertControllerWithTitle:@"Add Host" message:error preferredStyle:UIAlertControllerStyleAlert];
|
||||||
[hostNotFoundAlert addAction:[UIAlertAction actionWithTitle:@"Help" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
[Utils addHelpOptionToDialog:hostNotFoundAlert];
|
||||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"]];
|
|
||||||
}]];
|
|
||||||
[hostNotFoundAlert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
|
[hostNotFoundAlert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
[[self activeViewController] presentViewController:hostNotFoundAlert animated:YES completion:nil];
|
[[self activeViewController] presentViewController:hostNotFoundAlert animated:YES completion:nil];
|
||||||
|
|||||||
@@ -187,9 +187,7 @@
|
|||||||
message:[NSString stringWithFormat:@"%s failed with error %ld",
|
message:[NSString stringWithFormat:@"%s failed with error %ld",
|
||||||
stageName, errorCode]
|
stageName, errorCode]
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
[alert addAction:[UIAlertAction actionWithTitle:@"Help" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
[Utils addHelpOptionToDialog:alert];
|
||||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"]];
|
|
||||||
}]];
|
|
||||||
[alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
[alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
||||||
[self returnToMainFrame];
|
[self returnToMainFrame];
|
||||||
}]];
|
}]];
|
||||||
@@ -209,9 +207,7 @@
|
|||||||
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Connection Failed"
|
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Connection Failed"
|
||||||
message:message
|
message:message
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
[alert addAction:[UIAlertAction actionWithTitle:@"Help" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
[Utils addHelpOptionToDialog:alert];
|
||||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"]];
|
|
||||||
}]];
|
|
||||||
[alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
[alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
||||||
[self returnToMainFrame];
|
[self returnToMainFrame];
|
||||||
}]];
|
}]];
|
||||||
|
|||||||
Reference in New Issue
Block a user