Add a new "System" request for a username-password dialog box

This commit is contained in:
Henrik Rydgård committed 2023-06-22 08:58:29 +02:00
1 parent d35c17229c
commit 2708f0b93e
7 files changed
+93 -7

No files matched your search

+13
View File
@@ -358,6 +358,8 @@ bool System_GetPropertyBool(SystemProperty prop) {
return true;
case SYSPROP_HAS_BACK_BUTTON:
return true;
case SYSPROP_HAS_LOGIN_DIALOG:
return true;
case SYSPROP_APP_GOLD:
#ifdef GOLD
return true;
@@ -498,6 +500,17 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string
}
}).detach();
return true;
case SystemRequestType::ASK_USERNAME_PASSWORD:
std::thread([=] {
std::string username;
std::string password;
if (UserPasswordBox_GetStrings(MainWindow::GetHInstance(), MainWindow::GetHWND(), ConvertUTF8ToWString(param1).c_str(), &username, &password)) {
g_requestManager.PostSystemSuccess(requestId, (username + '\n' + password).c_str());
} else {
g_requestManager.PostSystemFailure(requestId);
}
}).detach();
return true;
case SystemRequestType::BROWSE_FOR_IMAGE:
std::thread([=] {
std::string out;