mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Try to fix Qt. Still broken due to threading issue.
This commit is contained in:
parent
9d10417f09
commit
604f3b4500
@ -34,7 +34,7 @@
|
||||
#endif
|
||||
|
||||
#include "Common/System/NativeApp.h"
|
||||
#include "Common/System/System.h"
|
||||
#include "Common/System/Request.h"
|
||||
#include "Common/GPU/OpenGL/GLFeatures.h"
|
||||
#include "Common/Math/math_util.h"
|
||||
#include "Common/Profiler/Profiler.h"
|
||||
@ -273,7 +273,24 @@ void System_Notify(SystemNotification notification) {
|
||||
}
|
||||
}
|
||||
|
||||
bool System_MakeRequest(SystemRequestType type, int requestId, const std::string ¶m1, const std::string ¶m2) { return false; }
|
||||
bool System_MakeRequest(SystemRequestType type, int requestId, const std::string ¶m1, const std::string ¶m2) {
|
||||
switch (type) {
|
||||
case SystemRequestType::INPUT_TEXT_MODAL:
|
||||
{
|
||||
// NOTE: This doesn't actually work, we're on the wrong thread!
|
||||
// Was broken even previously to the conversion to System_MakeRequest.
|
||||
QString title = QString::fromStdString(param1);
|
||||
QString defaultValue = QString::fromStdString(param2);
|
||||
QString text = emugl->InputBoxGetQString(title, defaultValue);
|
||||
if (text.isEmpty()) {
|
||||
g_requestManager.PostSystemFailure(requestId);
|
||||
} else {
|
||||
g_requestManager.PostSystemSuccess(requestId, text.toStdString().c_str());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void System_SendMessage(const char *command, const char *parameter) {
|
||||
if (!strcmp(command, "finish")) {
|
||||
@ -307,15 +324,6 @@ void System_Toast(const char *text) {}
|
||||
void System_AskForPermission(SystemPermission permission) {}
|
||||
PermissionStatus System_GetPermissionStatus(SystemPermission permission) { return PERMISSION_STATUS_GRANTED; }
|
||||
|
||||
void System_InputBoxGetString(const std::string &title, const std::string &defaultValue, std::function<void(bool, const std::string &)> cb) {
|
||||
QString text = emugl->InputBoxGetQString(QString::fromStdString(title), QString::fromStdString(defaultValue));
|
||||
if (text.isEmpty()) {
|
||||
NativeInputBoxReceived(cb, false, "");
|
||||
} else {
|
||||
NativeInputBoxReceived(cb, true, text.toStdString());
|
||||
}
|
||||
}
|
||||
|
||||
void System_Vibrate(int length_ms) {
|
||||
if (length_ms == -1 || length_ms == -3)
|
||||
length_ms = 50;
|
||||
|
Loading…
Reference in New Issue
Block a user