Merge remote-tracking branch 'upstream/Integration' into feat/frame_pacing_metal
# Conflicts: # VoidLink/ViewControllers/MainFrameViewController.m # VoidLink/ViewControllers/ToolboxViewController.swift
This commit is contained in:
@@ -260,6 +260,29 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"[ Disconnect & quit app ]" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "[ 断开连接并退出应用 ]"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "[ 斷開連線並退出應用程式 ]"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "[ 斷開連線並退出應用程式 ]"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"[ Enter picture-in-picture mode ]" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
@@ -4707,29 +4730,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"Tip: Swipe from screen edge to a certiain distance (configured by Swipe & Exit settings) to disconnect from your PC" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "提示: 从屏幕连续滑动一定距离退出远程桌面. 滑动边缘和距离取决于菜单设置."
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "提示:從螢幕邊緣滑動一段距離(由滑動和離開設定配置)以中斷與您電腦的連線"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "提示:從螢幕邊緣滑動一段距離(由滑動和離開設定配置)以中斷與您電腦的連線"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Tips" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
|
||||
@@ -31,8 +31,9 @@
|
||||
|
||||
-(void)expandSettingsView;
|
||||
- (void)closeSettingViewAnimated:(BOOL)anaimated;
|
||||
-(void)reloadStreamConfig;
|
||||
-(bool)isIPhonePortrait;
|
||||
- (void)reloadStreamConfig;
|
||||
- (bool)isIPhonePortrait;
|
||||
- (void)quitRunningApp;
|
||||
#endif
|
||||
- (void)fillResolutionTable:(CGSize*)resolutionTable externalDisplayMode:(NSInteger)externalDisplayMode;
|
||||
|
||||
|
||||
@@ -73,7 +73,8 @@
|
||||
SettingsViewController* settingsViewController;
|
||||
StreamFrameViewController* streamFrameViewController;
|
||||
id navBarAppearanceStandard;
|
||||
bool _viewJustAppeared;
|
||||
bool _viewJustAppeared;
|
||||
TemporaryApp * launchedApp;
|
||||
|
||||
NSTimer *_foregroundHostUpdateTimer;
|
||||
|
||||
@@ -771,6 +772,7 @@ static NSMutableSet* hostList;
|
||||
}
|
||||
|
||||
- (void) prepareToStreamApp:(TemporaryApp *)app {
|
||||
launchedApp = app;
|
||||
[self updateResolutionAccordingly];
|
||||
self.revealViewController.isStreaming = true; // tell the revealViewController streaming is started.
|
||||
_streamConfig = [[StreamConfiguration alloc] init];
|
||||
@@ -912,6 +914,55 @@ static NSMutableSet* hostList;
|
||||
#endif
|
||||
}
|
||||
|
||||
- (HttpResponse* )requestToQuitApp:(TemporaryApp* )app{
|
||||
HttpManager* hMan = [[HttpManager alloc] initWithHost:app.host];
|
||||
HttpResponse* quitResponse = [[HttpResponse alloc] init];
|
||||
HttpRequest* quitRequest = [HttpRequest requestForResponse: quitResponse withUrlRequest:[hMan newQuitAppRequest]];
|
||||
|
||||
// Exempt this host from discovery while handling the quit operation
|
||||
[self->_discMan pauseDiscoveryForHost:app.host];
|
||||
[hMan executeRequestSynchronously:quitRequest];
|
||||
if (quitResponse.statusCode == 200) {
|
||||
ServerInfoResponse* serverInfoResp = [[ServerInfoResponse alloc] init];
|
||||
[hMan executeRequestSynchronously:[HttpRequest requestForResponse:serverInfoResp withUrlRequest:[hMan newServerInfoRequest:false]
|
||||
fallbackError:401 fallbackRequest:[hMan newHttpServerInfoRequest]]];
|
||||
if (![serverInfoResp isStatusOk] || [[serverInfoResp getStringTag:@"state"] hasSuffix:@"_SERVER_BUSY"]) {
|
||||
// On newer GFE versions, the quit request succeeds even though the app doesn't
|
||||
// really quit if another client tries to kill your app. We'll patch the response
|
||||
// to look like the old error in that case, so the UI behaves.
|
||||
quitResponse.statusCode = 599;
|
||||
}
|
||||
else if ([serverInfoResp isStatusOk]) {
|
||||
// Update the host object with this info
|
||||
[serverInfoResp populateHost:app.host];
|
||||
}
|
||||
}
|
||||
[self->_discMan resumeDiscoveryForHost:app.host];
|
||||
return quitResponse;
|
||||
}
|
||||
|
||||
- (void)quitRunningApp{
|
||||
[self showLoadingFrame: ^{
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
HttpResponse* quitResponse = [self requestToQuitApp:self->launchedApp];
|
||||
// If it fails, display an error and stop the current operation
|
||||
if (quitResponse.statusCode != 200) {
|
||||
UIAlertController* alert = [UIAlertController alertControllerWithTitle:[LocalizationHelper localizedStringForKey:@"Quitting App Failed"]
|
||||
message:[LocalizationHelper localizedStringForKey:@"Failed to quit app. If this app was started by another device, you'll need to quit from that device."]
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Ok"] style:UIAlertActionStyleDefault handler:nil]];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self updateAppsForHost:self->launchedApp.host];
|
||||
[self hideLoadingFrame: ^{
|
||||
[[self activeViewController] presentViewController:alert animated:YES completion:nil];
|
||||
}];
|
||||
});
|
||||
}
|
||||
else dispatch_async(dispatch_get_main_queue(), ^{[self hideLoadingFrame:nil];});
|
||||
});
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)appLongClicked:(TemporaryApp *)app view:(UIView *)view {
|
||||
Log(LOG_D, @"Long clicked app: %@", app.name);
|
||||
|
||||
@@ -967,30 +1018,7 @@ static NSMutableSet* hostList;
|
||||
Log(LOG_I, @"Quitting application: %@", currentApp.name);
|
||||
[self showLoadingFrame: ^{
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
HttpManager* hMan = [[HttpManager alloc] initWithHost:app.host];
|
||||
HttpResponse* quitResponse = [[HttpResponse alloc] init];
|
||||
HttpRequest* quitRequest = [HttpRequest requestForResponse: quitResponse withUrlRequest:[hMan newQuitAppRequest]];
|
||||
|
||||
// Exempt this host from discovery while handling the quit operation
|
||||
[self->_discMan pauseDiscoveryForHost:app.host];
|
||||
[hMan executeRequestSynchronously:quitRequest];
|
||||
if (quitResponse.statusCode == 200) {
|
||||
ServerInfoResponse* serverInfoResp = [[ServerInfoResponse alloc] init];
|
||||
[hMan executeRequestSynchronously:[HttpRequest requestForResponse:serverInfoResp withUrlRequest:[hMan newServerInfoRequest:false]
|
||||
fallbackError:401 fallbackRequest:[hMan newHttpServerInfoRequest]]];
|
||||
if (![serverInfoResp isStatusOk] || [[serverInfoResp getStringTag:@"state"] hasSuffix:@"_SERVER_BUSY"]) {
|
||||
// On newer GFE versions, the quit request succeeds even though the app doesn't
|
||||
// really quit if another client tries to kill your app. We'll patch the response
|
||||
// to look like the old error in that case, so the UI behaves.
|
||||
quitResponse.statusCode = 599;
|
||||
}
|
||||
else if ([serverInfoResp isStatusOk]) {
|
||||
// Update the host object with this info
|
||||
[serverInfoResp populateHost:app.host];
|
||||
}
|
||||
}
|
||||
[self->_discMan resumeDiscoveryForHost:app.host];
|
||||
|
||||
HttpResponse* quitResponse = [self requestToQuitApp:app];
|
||||
// If it fails, display an error and stop the current operation
|
||||
if (quitResponse.statusCode != 200) {
|
||||
UIAlertController* alert = [UIAlertController alertControllerWithTitle:[LocalizationHelper localizedStringForKey:@"Quitting App Failed"]
|
||||
|
||||
@@ -647,7 +647,7 @@
|
||||
#if TARGET_OS_TV
|
||||
[_tipLabel setText:@"Tip: Tap the Play/Pause button on the Apple TV Remote to disconnect from your PC"];
|
||||
#else
|
||||
[_tipLabel setText:[LocalizationHelper localizedStringForKey:@"Tip: Swipe from screen edge to a certiain distance (configured by Swipe & Exit settings) to disconnect from your PC"]];
|
||||
// [_tipLabel setText:[LocalizationHelper localizedStringForKey:@"Tip: Swipe from screen edge to a certiain distance (configured by Swipe & Exit settings) to disconnect from your PC"]];
|
||||
#endif
|
||||
|
||||
[_tipLabel sizeToFit];
|
||||
@@ -1089,6 +1089,17 @@
|
||||
- (void)disconnectRemoteSession {
|
||||
Log(LOG_I, @"Settings view disconnect the session in stream view");
|
||||
[self returnToMainFrame];
|
||||
|
||||
}
|
||||
|
||||
- (void)disconnectAndQuitApp{
|
||||
[self returnToMainFrame];
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
sleep(1.5);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.mainFrameViewcontroller quitRunningApp];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
- (void) connectionStarted {
|
||||
|
||||
@@ -14,6 +14,7 @@ import UIKit
|
||||
@objc optional func bringUpSoftKeyboard()
|
||||
@objc optional func enterPip()
|
||||
@objc optional func toggleStatsOverlay()
|
||||
@objc optional func disconnectAndQuitApp()
|
||||
}
|
||||
|
||||
|
||||
@@ -29,13 +30,14 @@ import UIKit
|
||||
private let viewBackgroundColor = UIColor(white: 0.2, alpha: 0.8);
|
||||
private let highlightColor = UIColor(white: 0.55, alpha: 0.8);
|
||||
private let titleLabel = UILabel()
|
||||
@objc public var specialEntries : NSMutableArray = ["widgetSwitchTool", "widgetLayoutTool", "bringUpSoftKeyboard", "enterPip", "toggleStatsOverlay"]
|
||||
@objc public var specialEntries : NSMutableArray = ["widgetSwitchTool", "widgetLayoutTool", "bringUpSoftKeyboard", "enterPip", "toggleStatsOverlay", "disconnectAndQuitApp"]
|
||||
private let specialEntryAliasDic : [String:String] = [
|
||||
"widgetSwitchTool":SwiftLocalizationHelper.localizedString(forKey: "[ Switch on-screen widget profile ]"),
|
||||
"widgetLayoutTool":SwiftLocalizationHelper.localizedString(forKey: "[ On-screen widget tool ]"),
|
||||
"bringUpSoftKeyboard":SwiftLocalizationHelper.localizedString(forKey: "[ Bring up soft keyboard ]"),
|
||||
"enterPip":SwiftLocalizationHelper.localizedString(forKey: "[ Enter picture-in-picture mode ]"),
|
||||
"toggleStatsOverlay":SwiftLocalizationHelper.localizedString(forKey: "[ Toggle stats overlay & graphs ]")
|
||||
"disconnectAndQuitApp":SwiftLocalizationHelper.localizedString(forKey: "[ Disconnect & quit app ]")
|
||||
]
|
||||
|
||||
private var viewPinned: Bool = false
|
||||
@@ -383,6 +385,8 @@ import UIKit
|
||||
specialEntryDelegate?.enterPip?()
|
||||
case "toggleStatsOverlay":
|
||||
specialEntryDelegate?.toggleStatsOverlay?()
|
||||
case "disconnectAndQuitApp":
|
||||
specialEntryDelegate?.disconnectAndQuitApp?()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user