Merge branch 'master' of github.com:highfidelity/hifi into moreToolbarTinkering

This commit is contained in:
Preston Bezos 2019-06-12 14:55:37 -07:00
commit 038747e645
22 changed files with 148 additions and 50 deletions

View file

@ -88,7 +88,7 @@ Rectangle {
Image { Image {
id: accent id: accent
source: "../images/accent.svg" source: "images/accent.svg"
anchors.top: parent.top anchors.top: parent.top
anchors.right: parent.right anchors.right: parent.right
width: 60 width: 60

View file

Before

Width:  |  Height:  |  Size: 268 B

After

Width:  |  Height:  |  Size: 268 B

View file

@ -165,11 +165,21 @@ Rectangle {
} }
Image { Image {
source: "../images/accent.svg" source: {
if (root.activeTabView === "generalTabView") {
"images/accent1.svg"
} else if (root.activeTabView === "audioTabView") {
"images/accent2.svg"
} else if (root.activeTabView === "vrTabView") {
"images/accent3.svg"
} else {
"images/accent3.svg"
}
}
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.top: tabContainer.bottom
width: 94 width: 106
height: 175 height: 200
} }

View file

@ -57,7 +57,7 @@ Flickable {
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
spacing: 0 spacing: 0
HifiStylesUit.GraphikRegular { HifiStylesUit.GraphikSemiBold {
id: volumeControlsTitle id: volumeControlsTitle
text: "Volume Controls" text: "Volume Controls"
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
@ -154,7 +154,7 @@ Flickable {
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
spacing: 0 spacing: 0
HifiStylesUit.GraphikRegular { HifiStylesUit.GraphikSemiBold {
id: micControlsTitle id: micControlsTitle
text: "Default Mute Controls" text: "Default Mute Controls"
Layout.maximumWidth: parent.width Layout.maximumWidth: parent.width
@ -196,7 +196,7 @@ Flickable {
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
spacing: 0 spacing: 0
HifiStylesUit.GraphikRegular { HifiStylesUit.GraphikSemiBold {
id: inputDeviceTitle id: inputDeviceTitle
text: "Which input device?" text: "Which input device?"
Layout.maximumWidth: parent.width Layout.maximumWidth: parent.width
@ -291,7 +291,7 @@ Flickable {
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
spacing: 0 spacing: 0
HifiStylesUit.GraphikRegular { HifiStylesUit.GraphikSemiBold {
id: outputDeviceTitle id: outputDeviceTitle
text: "Which output device?" text: "Which output device?"
Layout.maximumWidth: parent.width Layout.maximumWidth: parent.width

View file

@ -47,7 +47,7 @@ Flickable {
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
spacing: 0 spacing: 0
HifiStylesUit.GraphikRegular { HifiStylesUit.GraphikSemiBold {
id: uiControlsTitle id: uiControlsTitle
text: "User Interface" text: "User Interface"
Layout.maximumWidth: parent.width Layout.maximumWidth: parent.width

View file

@ -51,7 +51,7 @@ Flickable {
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
spacing: 0 spacing: 0
HifiStylesUit.GraphikRegular { HifiStylesUit.GraphikSemiBold {
id: avatarNameTagsTitle id: avatarNameTagsTitle
text: "Avatar Name Tags" text: "Avatar Name Tags"
Layout.maximumWidth: parent.width Layout.maximumWidth: parent.width
@ -99,7 +99,7 @@ Flickable {
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
spacing: 0 spacing: 0
HifiStylesUit.GraphikRegular { HifiStylesUit.GraphikSemiBold {
id: performanceTitle id: performanceTitle
text: "Graphics Settings" text: "Graphics Settings"
Layout.maximumWidth: parent.width Layout.maximumWidth: parent.width
@ -147,7 +147,7 @@ Flickable {
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
spacing: 0 spacing: 0
HifiStylesUit.GraphikRegular { HifiStylesUit.GraphikSemiBold {
id: cameraTitle id: cameraTitle
text: "Camera View" text: "Camera View"
Layout.maximumWidth: parent.width Layout.maximumWidth: parent.width
@ -199,7 +199,7 @@ Flickable {
wrapMode: Text.Wrap wrapMode: Text.Wrap
width: paintedWidth width: paintedWidth
height: paintedHeight height: paintedHeight
size: 22 size: 14
color: simplifiedUI.colors.text.lightBlue color: simplifiedUI.colors.text.lightBlue
MouseArea { MouseArea {

View file

@ -0,0 +1,4 @@
<svg width="106" height="200" viewBox="0 0 106 200" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0L106 -9.26681e-06L83.1739 10.0481L0 0Z" fill="#FFED00"/>
<path d="M83.1738 10.0481L106 -1.99552e-06L106 200L83.1738 10.0481Z" fill="#FF42A7"/>
</svg>

After

Width:  |  Height:  |  Size: 263 B

View file

@ -0,0 +1,4 @@
<svg width="106" height="200" viewBox="0 0 106 200" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0L106 -9.26681e-06L83.1739 10.0481L0 0Z" fill="#FF42A7"/>
<path d="M83.1738 10.0481L106 -1.99552e-06L106 200L83.1738 10.0481Z" fill="#009EE0"/>
</svg>

After

Width:  |  Height:  |  Size: 263 B

View file

@ -0,0 +1,4 @@
<svg width="106" height="200" viewBox="0 0 106 200" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0L106 -9.26681e-06L83.1739 10.0481L0 0Z" fill="#009EE0"/>
<path d="M83.1738 10.0481L106 -1.99552e-06L106 200L83.1738 10.0481Z" fill="#FFED00"/>
</svg>

After

Width:  |  Height:  |  Size: 263 B

View file

@ -57,7 +57,7 @@ Flickable {
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
spacing: 0 spacing: 0
HifiStylesUit.GraphikRegular { HifiStylesUit.GraphikSemiBold {
id: controlsTitle id: controlsTitle
text: "VR Movement Controls" text: "VR Movement Controls"
Layout.maximumWidth: parent.width Layout.maximumWidth: parent.width
@ -143,7 +143,7 @@ Flickable {
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
spacing: 0 spacing: 0
HifiStylesUit.GraphikRegular { HifiStylesUit.GraphikSemiBold {
id: micControlsTitle id: micControlsTitle
text: "Default Mute Controls" text: "Default Mute Controls"
Layout.maximumWidth: parent.width Layout.maximumWidth: parent.width
@ -185,7 +185,7 @@ Flickable {
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
spacing: 0 spacing: 0
HifiStylesUit.GraphikRegular { HifiStylesUit.GraphikSemiBold {
id: inputDeviceTitle id: inputDeviceTitle
text: "Which input device?" text: "Which input device?"
Layout.maximumWidth: parent.width Layout.maximumWidth: parent.width
@ -280,7 +280,7 @@ Flickable {
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
spacing: 0 spacing: 0
HifiStylesUit.GraphikRegular { HifiStylesUit.GraphikSemiBold {
id: outputDeviceTitle id: outputDeviceTitle
text: "Which output device?" text: "Which output device?"
Layout.maximumWidth: parent.width Layout.maximumWidth: parent.width

View file

@ -183,7 +183,7 @@ QtObject {
readonly property QtObject settings: QtObject { readonly property QtObject settings: QtObject {
property int subtitleTopMargin: 2 property int subtitleTopMargin: 2
property int settingsGroupTopMargin: 24 property int settingsGroupTopMargin: 14
property int spacingBetweenSettings: 48 property int spacingBetweenSettings: 48
property int spacingBetweenRadiobuttons: 14 property int spacingBetweenRadiobuttons: 14
} }

View file

@ -7,8 +7,9 @@
- (void) confirmCredentials:(NSString*)username :(NSString*)password { - (void) confirmCredentials:(NSString*)username :(NSString*)password {
NSLog(@"web request started"); NSLog(@"web request started");
NSString* trimmedUsername = [username stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSString *post = [NSString stringWithFormat:@"grant_type=password&username=%@&password=%@&scope=owner", NSString *post = [NSString stringWithFormat:@"grant_type=password&username=%@&password=%@&scope=owner",
[username stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet alphanumericCharacterSet]], [trimmedUsername stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet alphanumericCharacterSet]],
[password stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet alphanumericCharacterSet]]]; [password stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet alphanumericCharacterSet]]];
NSData *postData = [post dataUsingEncoding:NSUTF8StringEncoding]; NSData *postData = [post dataUsingEncoding:NSUTF8StringEncoding];
NSString *postLength = [NSString stringWithFormat:@"%ld", (unsigned long)[postData length]]; NSString *postLength = [NSString stringWithFormat:@"%ld", (unsigned long)[postData length]];

View file

@ -54,7 +54,9 @@
-(void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error { -(void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error {
NSLog(@"completed; error: %@", error); NSLog(@"completed; error: %@", error);
if (error) {
[[Launcher sharedLauncher] displayErrorPage];
}
} }
@end @end

View file

@ -66,6 +66,9 @@
-(void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error { -(void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error {
NSLog(@"completed; error: %@", error); NSLog(@"completed; error: %@", error);
if (error) {
[[Launcher sharedLauncher] displayErrorPage];
}
} }

View file

@ -4,15 +4,15 @@
#import "Launcher.h" #import "Launcher.h"
static NSString* const organizationURL = @"https://s3.amazonaws.com/hifi-public/huffman/organizations/"; static NSString* const organizationURL = @"https://orgs.highfidelity.com/organizations/";
@implementation OrganizationRequest @implementation OrganizationRequest
- (void) confirmOrganization:(NSString*)aOrganization :(NSString*)aUsername { - (void) confirmOrganization:(NSString*)aOrganization :(NSString*)aUsername {
self.username = aUsername; self.username = aUsername;
NSString* trimmedOrgString = [aOrganization stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
const char *cKey = LAUNCHER_HMAC_SECRET; const char *cKey = LAUNCHER_HMAC_SECRET;
const char *cData = [[aOrganization lowercaseString] cStringUsingEncoding:NSASCIIStringEncoding]; const char *cData = [[trimmedOrgString lowercaseString] cStringUsingEncoding:NSASCIIStringEncoding];
unsigned char cHMAC[CC_SHA256_DIGEST_LENGTH]; unsigned char cHMAC[CC_SHA256_DIGEST_LENGTH];
CCHmac(kCCHmacAlgSHA256, cKey, strlen(cKey), cData, strlen(cData), cHMAC); CCHmac(kCCHmacAlgSHA256, cKey, strlen(cKey), cData, strlen(cData), cHMAC);
NSData *HMACData = [NSData dataWithBytes:cHMAC length:sizeof(cHMAC)]; NSData *HMACData = [NSData dataWithBytes:cHMAC length:sizeof(cHMAC)];

View file

@ -120,8 +120,16 @@ BOOL CLauncherDlg::OnInitDialog() {
BOOL CLauncherDlg::PreTranslateMessage(MSG* pMsg) { BOOL CLauncherDlg::PreTranslateMessage(MSG* pMsg) {
if ((pMsg->message == WM_KEYDOWN)) if ((pMsg->message == WM_KEYDOWN))
{ {
if (pMsg->wParam == VK_RETURN) if (pMsg->wParam == 'A' && GetKeyState(VK_CONTROL) < 0) {
{ CWnd* wnd = GetFocus();
CWnd* myWnd = this->GetDlgItem(IDC_ORGNAME);
if (wnd && (wnd == this->GetDlgItem(IDC_ORGNAME) ||
wnd == this->GetDlgItem(IDC_USERNAME) ||
wnd == this->GetDlgItem(IDC_PASSWORD))) {
((CEdit*)wnd)->SetSel(0, -1);
}
return TRUE;
} else if (pMsg->wParam == VK_RETURN) {
OnNextClicked(); OnNextClicked();
return TRUE; return TRUE;
} }
@ -140,7 +148,6 @@ void CLauncherDlg::setCustomDialog() {
SetWindowLong(GetSafeHwnd(), GWL_EXSTYLE, lExStyle); SetWindowLong(GetSafeHwnd(), GWL_EXSTYLE, lExStyle);
SetWindowPos(NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER); SetWindowPos(NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
// theApp.setDialogOnFront();
} }
void CLauncherDlg::OnPaint() void CLauncherDlg::OnPaint()
@ -210,7 +217,7 @@ BOOL CLauncherDlg::getHQInfo(const CString& orgname) {
} }
afx_msg void CLauncherDlg::OnTroubleClicked() { afx_msg void CLauncherDlg::OnTroubleClicked() {
ShellExecute(0, NULL, TROUBLE_URL, NULL, NULL, SW_SHOWDEFAULT); LauncherUtils::executeOnForeground(TROUBLE_URL, _T(""));
} }
afx_msg void CLauncherDlg::OnNextClicked() { afx_msg void CLauncherDlg::OnNextClicked() {
@ -584,10 +591,14 @@ void CLauncherDlg::OnTimer(UINT_PTR nIDEvent) {
} else { } else {
theApp._manager.addToLog(_T("Start splash screen")); theApp._manager.addToLog(_T("Start splash screen"));
setDrawDialog(DrawStep::DrawLogo); setDrawDialog(DrawStep::DrawLogo);
} }
} else if (_splashStep > 100) { } else if (_splashStep > 100) {
_showSplash = false; _showSplash = false;
if (theApp._manager.shouldShutDown()) { if (theApp._manager.shouldShutDown()) {
if (_applicationWND != NULL) {
::SetForegroundWindow(_applicationWND);
::SetActiveWindow(_applicationWND);
}
if (LauncherUtils::IsProcessRunning(L"interface.exe")) { if (LauncherUtils::IsProcessRunning(L"interface.exe")) {
exit(0); exit(0);
} }
@ -607,6 +618,9 @@ void CLauncherDlg::OnTimer(UINT_PTR nIDEvent) {
exit(0); exit(0);
} }
} }
if (theApp._manager.shouldLaunch()) {
_applicationWND = theApp._manager.launchApplication();
}
} }
void CLauncherDlg::setDrawDialog(DrawStep step, BOOL isUpdate) { void CLauncherDlg::setDrawDialog(DrawStep step, BOOL isUpdate) {

View file

@ -90,6 +90,8 @@ protected:
CStatic* m_username_banner; CStatic* m_username_banner;
CStatic* m_password_banner; CStatic* m_password_banner;
HWND _applicationWND { 0 };
void drawBackground(CHwndRenderTarget* pRenderTarget); void drawBackground(CHwndRenderTarget* pRenderTarget);
void drawLogo(CHwndRenderTarget* pRenderTarget); void drawLogo(CHwndRenderTarget* pRenderTarget);
void drawSmallLogo(CHwndRenderTarget* pRenderTarget); void drawSmallLogo(CHwndRenderTarget* pRenderTarget);

View file

@ -34,7 +34,7 @@ void LauncherManager::init() {
addToLog(_T("Installed version: ") + currentVersion); addToLog(_T("Installed version: ") + currentVersion);
if (_latestVersion.Compare(currentVersion) == 0) { if (_latestVersion.Compare(currentVersion) == 0) {
addToLog(_T("Already running most recent build. Launching interface.exe")); addToLog(_T("Already running most recent build. Launching interface.exe"));
launchApplication(); _shouldLaunch = TRUE;
_shouldShutdown = TRUE; _shouldShutdown = TRUE;
} else { } else {
addToLog(_T("New build found. Updating")); addToLog(_T("New build found. Updating"));
@ -94,7 +94,7 @@ BOOL LauncherManager::installLauncher() {
// The installer is not running on the desired location and has to be installed // The installer is not running on the desired location and has to be installed
// Kill of running before self-copy // Kill of running before self-copy
if (LauncherUtils::IsProcessRunning(LAUNCHER_EXE_FILENAME)) { if (LauncherUtils::IsProcessRunning(LAUNCHER_EXE_FILENAME)) {
::ShellExecute(NULL, NULL, L"taskkill", L"/F /T /IM " + LAUNCHER_EXE_FILENAME, NULL, SW_HIDE); ShellExecute(NULL, NULL, L"taskkill", L"/F /T /IM " + LAUNCHER_EXE_FILENAME, NULL, SW_HIDE);
} }
CopyFile(appPath, instalationPath, FALSE); CopyFile(appPath, instalationPath, FALSE);
} }
@ -218,24 +218,27 @@ BOOL LauncherManager::getInstalledVersion(const CString& path, CString& version)
} }
BOOL LauncherManager::launchApplication(const CString& tokensJSON) { HWND LauncherManager::launchApplication() {
CString installDir; CString installDir;
LauncherManager::getAndCreatePaths(PathType::Interface_Directory, installDir); LauncherManager::getAndCreatePaths(PathType::Interface_Directory, installDir);
CString interfaceExe = installDir + _T("\\interface.exe"); CString interfaceExe = installDir + _T("\\interface.exe");
CString params1 = _T("--url \"") + _domainURL + ("\" "); CString urlParam = _T("--url \"") + _domainURL + ("\" ");
CString scriptsURL = installDir + _T("\\scripts\\simplifiedUI"); CString scriptsURL = installDir + _T("\\scripts\\simplifiedUI");
CString params2 = _T("--scripts \"") + scriptsURL + ("\" "); CString scriptsParam = _T("--scripts \"") + scriptsURL + ("\" ");
CString cacheDir; CString cacheDir;
LauncherManager::getAndCreatePaths(PathType::Content_Directory, cacheDir); LauncherManager::getAndCreatePaths(PathType::Content_Directory, cacheDir);
CString params3 = _T("--cache \"") + cacheDir + ("\" "); CString cacheParam = _T("--cache \"") + cacheDir + ("\" ");
CString params4 = !_displayName.IsEmpty() ? _T("--displayName \"") + _displayName + ("\" ") : _T(""); CString nameParam = !_displayName.IsEmpty() ? _T("--displayName \"") + _displayName + ("\" ") : _T("");
CString parsedTokens = tokensJSON; CString tokensParam = _T("");
parsedTokens.Replace(_T("\""), _T("\\\"")); if (!_tokensJSON.IsEmpty()) {
CString params5 = !tokensJSON.IsEmpty() ? _T("--tokens \"") + parsedTokens + ("\"") : _T(""); CString parsedTokens = _tokensJSON;
CString params = params1 + params2 + params3 + params4 + params5 + EXTRA_PARAMETERS; parsedTokens.Replace(_T("\""), _T("\\\""));
tokensParam = _T("--tokens \"");
auto rs = ShellExecute(NULL, L"open", interfaceExe, params, NULL, SW_SHOW); tokensParam += parsedTokens + _T("\"");
return (rs != NULL); }
CString params = urlParam + scriptsParam + cacheParam + nameParam + tokensParam + EXTRA_PARAMETERS;
_shouldLaunch = FALSE;
return LauncherUtils::executeOnForeground(interfaceExe, params);
} }
BOOL LauncherManager::createConfigJSON() { BOOL LauncherManager::createConfigJSON() {
@ -288,8 +291,8 @@ LauncherUtils::ResponseError LauncherManager::readConfigJSON(CString& version, C
LauncherUtils::ResponseError LauncherManager::readOrganizationJSON(const CString& hash) { LauncherUtils::ResponseError LauncherManager::readOrganizationJSON(const CString& hash) {
CString contentTypeJson = L"content-type:application/json"; CString contentTypeJson = L"content-type:application/json";
CString response; CString response;
CString url = _T("/hifi-public/huffman/organizations/") + hash + _T(".json"); CString url = _T("/organizations/") + hash + _T(".json");
LauncherUtils::ResponseError error = LauncherUtils::makeHTTPCall(L"HQ Launcher", L"s3.amazonaws.com", url, LauncherUtils::ResponseError error = LauncherUtils::makeHTTPCall(L"HQ Launcher", L"orgs.highfidelity.com", url,
contentTypeJson, CStringA(), response, false); contentTypeJson, CStringA(), response, false);
if (error != LauncherUtils::ResponseError::NoError) { if (error != LauncherUtils::ResponseError::NoError) {
return error; return error;
@ -407,9 +410,11 @@ void LauncherManager::onZipExtracted(ZipType type, int size) {
addToLog(_T("Creating config.json")); addToLog(_T("Creating config.json"));
createConfigJSON(); createConfigJSON();
addToLog(_T("Launching application.")); addToLog(_T("Launching application."));
launchApplication(_tokensJSON); _shouldLaunch = TRUE;
addToLog(_T("Creating registry keys.")); if (!_shouldUpdate) {
createApplicationRegistryKeys(size); addToLog(_T("Creating registry keys."));
createApplicationRegistryKeys(size);
}
_shouldShutdown = TRUE; _shouldShutdown = TRUE;
} }
} }
@ -429,7 +434,7 @@ void LauncherManager::onFileDownloaded(DownloadType type) {
addToLog(_T("Installing content.")); addToLog(_T("Installing content."));
installContent(); installContent();
} else if (type == DownloadType::DownloadApplication) { } else if (type == DownloadType::DownloadApplication) {
addToLog(_T("Installing application.")); addToLog(_T("Installing application."));
extractApplication(); extractApplication();
} }
} }

View file

@ -70,7 +70,7 @@ public:
BOOL deleteApplicationRegistryKeys(); BOOL deleteApplicationRegistryKeys();
BOOL createShortcuts(); BOOL createShortcuts();
BOOL deleteShortcuts(); BOOL deleteShortcuts();
BOOL launchApplication(const CString& tokensJSON = _T("")); HWND launchApplication();
BOOL uninstallApplication(); BOOL uninstallApplication();
BOOL installLauncher(); BOOL installLauncher();
@ -79,6 +79,7 @@ public:
const CString& getdomainURL() const { return _domainURL; } const CString& getdomainURL() const { return _domainURL; }
const CString& getVersion() const { return _version; } const CString& getVersion() const { return _version; }
BOOL shouldShutDown() const { return _shouldShutdown; } BOOL shouldShutDown() const { return _shouldShutdown; }
BOOL shouldLaunch() const { return _shouldLaunch; }
BOOL needsUpdate() { return _shouldUpdate; } BOOL needsUpdate() { return _shouldUpdate; }
BOOL needsUninstall() { return _shouldUninstall; } BOOL needsUninstall() { return _shouldUninstall; }
void setDisplayName(const CString& displayName) { _displayName = displayName; } void setDisplayName(const CString& displayName) { _displayName = displayName; }
@ -108,6 +109,7 @@ private:
BOOL _shouldUpdate{ FALSE }; BOOL _shouldUpdate{ FALSE };
BOOL _shouldUninstall{ FALSE }; BOOL _shouldUninstall{ FALSE };
BOOL _shouldShutdown{ FALSE }; BOOL _shouldShutdown{ FALSE };
BOOL _shouldLaunch{ FALSE };
CStdioFile _logFile; CStdioFile _logFile;
}; };

View file

@ -13,6 +13,7 @@
#include <tlhelp32.h> #include <tlhelp32.h>
#include <strsafe.h> #include <strsafe.h>
#include <winhttp.h> #include <winhttp.h>
#pragma comment(lib, "winhttp") #pragma comment(lib, "winhttp")
#include "LauncherUtils.h" #include "LauncherUtils.h"
@ -450,3 +451,38 @@ BOOL LauncherUtils::deleteDirectoriesOnThread(const CString& applicationDir,
} }
return FALSE; return FALSE;
} }
HWND LauncherUtils::executeOnForeground(const CString& path, const CString& params) {
SHELLEXECUTEINFO info;
info.cbSize = sizeof(SHELLEXECUTEINFO);
info.lpVerb = _T("open");
info.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_NOASYNC | SEE_MASK_WAITFORINPUTIDLE;
info.hwnd = NULL;
info.lpVerb = NULL;
info.lpParameters = NULL;
info.lpDirectory = NULL;
info.nShow = SW_SHOWNORMAL;
info.hInstApp = NULL;
info.lpFile = path;
info.lpParameters = params;
HWND hwnd = NULL;
if (!ShellExecuteEx(&info)) {
return FALSE;
} else {
DWORD infopid = GetProcessId(info.hProcess);
AllowSetForegroundWindow(infopid);
hwnd = GetTopWindow(0);
while (hwnd) {
DWORD pid;
DWORD dwTheardId = ::GetWindowThreadProcessId(hwnd, &pid);
if (pid == infopid) {
SetForegroundWindow(hwnd);
SetActiveWindow(hwnd);
break;
}
hwnd = ::GetNextWindow(hwnd, GW_HWNDNEXT);
}
CloseHandle(info.hProcess);
}
return hwnd;
}

View file

@ -87,6 +87,7 @@ public:
const CString& downloadsDir, const CString& downloadsDir,
std::function<void(int)> callback); std::function<void(int)> callback);
static CString urlEncodeString(const CString& url); static CString urlEncodeString(const CString& url);
static HWND executeOnForeground(const CString& path, const CString& params);
private: private:
// Threads // Threads

View file

@ -457,9 +457,19 @@ function onGeometryChanged(rect) {
} }
} }
<<<<<<< HEAD
=======
var TIMEOUT_BEFORE_REHIDE_TOOLBAR_MS = 700;
>>>>>>> f360adccbc827bb52dc4a73ebe2c6890e8be039e
function onDisplayModeChanged(isHMDMode) { function onDisplayModeChanged(isHMDMode) {
if (isHMDMode) { if (isHMDMode) {
Camera.setModeString("first person"); Camera.setModeString("first person");
} else if (Settings.getValue("simplifiedUI/keepExistingUIAndScripts", false)) {
// works for now, but not a permanent fix by any means.
Script.setTimeout(function () {
var toolbar = Toolbars.getToolbar(TOOLBAR_NAME);
toolbar.writeProperty("visible", false);
}, TIMEOUT_BEFORE_REHIDE_TOOLBAR_MS);
} }
} }