Add a GetProperty query for the git version

This commit is contained in:
Henrik Rydgård 2023-07-20 09:56:51 +02:00
parent 16ee5a50c7
commit 85f5136a81
9 changed files with 17 additions and 2 deletions

View File

@ -117,6 +117,7 @@ enum SystemProperty {
SYSPROP_BOARDNAME, SYSPROP_BOARDNAME,
SYSPROP_CLIPBOARD_TEXT, SYSPROP_CLIPBOARD_TEXT,
SYSPROP_GPUDRIVER_VERSION, SYSPROP_GPUDRIVER_VERSION,
SYSPROP_BUILD_VERSION,
// Separate SD cards or similar. // Separate SD cards or similar.
// Need hacky solutions to get at this. // Need hacky solutions to get at this.

View File

@ -55,6 +55,9 @@ class MessagePopupScreen : public PopupScreen {
public: public:
MessagePopupScreen(std::string title, std::string message, std::string button1, std::string button2, std::function<void(bool)> callback) MessagePopupScreen(std::string title, std::string message, std::string button1, std::string button2, std::function<void(bool)> callback)
: PopupScreen(title, button1, button2), message_(message), callback_(callback) {} : PopupScreen(title, button1, button2), message_(message), callback_(callback) {}
const char *tag() const override { return "MessagePopupScreen"; }
UI::Event OnChoice; UI::Event OnChoice;
protected: protected:

View File

@ -1,5 +1,6 @@
#include <algorithm> #include <algorithm>
#include "Common/System/Display.h" #include "Common/System/Display.h"
#include "Common/System/System.h"
#include "Common/Input/InputState.h" #include "Common/Input/InputState.h"
#include "Common/Input/KeyCodes.h" #include "Common/Input/KeyCodes.h"
#include "Common/Math/curves.h" #include "Common/Math/curves.h"
@ -9,7 +10,6 @@
#include "Common/UI/Root.h" #include "Common/UI/Root.h"
#include "Common/Data/Text/I18n.h" #include "Common/Data/Text/I18n.h"
#include "Common/Render/DrawBuffer.h" #include "Common/Render/DrawBuffer.h"
#include "Common/Log.h" #include "Common/Log.h"
static const bool ClickDebug = false; static const bool ClickDebug = false;
@ -426,7 +426,6 @@ void PopupScreen::CreateViews() {
CreatePopupContents(box_); CreatePopupContents(box_);
root_->SetDefaultFocusView(box_); root_->SetDefaultFocusView(box_);
if (ShowButtons() && !button1_.empty()) { if (ShowButtons() && !button1_.empty()) {
// And the two buttons at the bottom. // And the two buttons at the bottom.
LinearLayout *buttonRow = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(200, WRAP_CONTENT)); LinearLayout *buttonRow = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(200, WRAP_CONTENT));

View File

@ -161,6 +161,8 @@ std::string System_GetProperty(SystemProperty prop) {
return result; return result;
} }
#endif #endif
case SYSPROP_BUILD_VERSION:
return PPSSPP_GIT_VERSION;
default: default:
return ""; return "";
} }

View File

@ -431,6 +431,8 @@ std::string System_GetProperty(SystemProperty prop) {
} }
return result; return result;
} }
case SYSPROP_BUILD_VERSION:
return PPSSPP_GIT_VERSION;
default: default:
return ""; return "";
} }

View File

@ -347,6 +347,8 @@ std::string System_GetProperty(SystemProperty prop) {
return ""; return "";
case SYSPROP_GPUDRIVER_VERSION: case SYSPROP_GPUDRIVER_VERSION:
return ""; return "";
case SYSPROP_BUILD_VERSION:
return PPSSPP_GIT_VERSION;
default: default:
return ""; return "";
} }

View File

@ -234,6 +234,8 @@ std::string System_GetProperty(SystemProperty prop) {
gpuDriverVersion = GetVideoCardDriverVersion(); gpuDriverVersion = GetVideoCardDriverVersion();
} }
return gpuDriverVersion; return gpuDriverVersion;
case SYSPROP_BUILD_VERSION:
return PPSSPP_GIT_VERSION;
default: default:
return ""; return "";
} }

View File

@ -412,6 +412,8 @@ std::string System_GetProperty(SystemProperty prop) {
return mogaVersion; return mogaVersion;
case SYSPROP_BOARDNAME: case SYSPROP_BOARDNAME:
return boardName; return boardName;
case SYSPROP_BUILD_VERSION:
return PPSSPP_GIT_VERSION;
default: default:
return ""; return "";
} }

View File

@ -108,6 +108,8 @@ std::string System_GetProperty(SystemProperty prop) {
return StringFromFormat("iOS %s", version.c_str()); return StringFromFormat("iOS %s", version.c_str());
case SYSPROP_LANGREGION: case SYSPROP_LANGREGION:
return [[[NSLocale currentLocale] objectForKey:NSLocaleIdentifier] UTF8String]; return [[[NSLocale currentLocale] objectForKey:NSLocaleIdentifier] UTF8String];
case SYSPROP_BUILD_VERSION:
return PPSSPP_GIT_VERSION;
default: default:
return ""; return "";
} }