mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-15 21:22:40 +00:00
Create alert dialogs on the main thread
This commit is contained in:
@@ -102,6 +102,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void) stageFailed:(char*)stageName withError:(long)errorCode {
|
- (void) stageFailed:(char*)stageName withError:(long)errorCode {
|
||||||
|
Log(LOG_I, @"Stage %s failed: %ld", stageName, errorCode);
|
||||||
|
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Connection Failed"
|
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Connection Failed"
|
||||||
message:[NSString stringWithFormat:@"%s failed with error %ld",
|
message:[NSString stringWithFormat:@"%s failed with error %ld",
|
||||||
stageName, errorCode]
|
stageName, errorCode]
|
||||||
@@ -110,9 +113,13 @@
|
|||||||
[self returnToMainFrame];
|
[self returnToMainFrame];
|
||||||
}]];
|
}]];
|
||||||
[self presentViewController:alert animated:YES completion:nil];
|
[self presentViewController:alert animated:YES completion:nil];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) launchFailed:(NSString*)message {
|
- (void) launchFailed:(NSString*)message {
|
||||||
|
Log(LOG_I, @"Launch failed: %@", message);
|
||||||
|
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Connection Failed"
|
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Connection Failed"
|
||||||
message:message
|
message:message
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
@@ -120,6 +127,7 @@
|
|||||||
[self returnToMainFrame];
|
[self returnToMainFrame];
|
||||||
}]];
|
}]];
|
||||||
[self presentViewController:alert animated:YES completion:nil];
|
[self presentViewController:alert animated:YES completion:nil];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) displayMessage:(char*)message {
|
- (void) displayMessage:(char*)message {
|
||||||
|
|||||||
Reference in New Issue
Block a user