diff --git a/Common/System/System.h b/Common/System/System.h index 6f1524ab03..38482d3e41 100644 --- a/Common/System/System.h +++ b/Common/System/System.h @@ -73,6 +73,7 @@ enum SystemProperty { SYSPROP_HAS_IMAGE_BROWSER, SYSPROP_HAS_BACK_BUTTON, SYSPROP_HAS_KEYBOARD, + SYSPROP_HAS_OPEN_DIRECTORY, // Available as Int: SYSPROP_SYSTEMVERSION, diff --git a/Qt/QtMain.cpp b/Qt/QtMain.cpp index 6809e9fec9..10b7f8ca9d 100644 --- a/Qt/QtMain.cpp +++ b/Qt/QtMain.cpp @@ -235,6 +235,7 @@ bool System_GetPropertyBool(SystemProperty prop) { return true; case SYSPROP_HAS_FILE_BROWSER: case SYSPROP_HAS_FOLDER_BROWSER: + case SYSPROP_HAS_OPEN_DIRECTORY: return true; case SYSPROP_SUPPORTS_OPEN_FILE_IN_EDITOR: return true; // FileUtil.cpp: OpenFileInEditor diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index 1acd96e77a..cf77b7e109 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -427,6 +427,12 @@ float System_GetPropertyFloat(SystemProperty prop) { bool System_GetPropertyBool(SystemProperty prop) { switch (prop) { + case SYSPROP_HAS_OPEN_DIRECTORY: +#if PPSSPP_PLATFORM(WINDOWS) + return true; +#elif PPSSPP_PLATFORM(MAC) || (PPSSPP_PLATFORM(LINUX) && !PPSSPP_PLATFORM(ANDROID)) + return true; +#endif case SYSPROP_HAS_BACK_BUTTON: return true; case SYSPROP_APP_GOLD: diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 6d8d0af62e..499765ec7b 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -963,9 +963,12 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) { systemSettings->Add(new ItemHeader(sy->T("PSP Memory Stick"))); -#if (defined(USING_QT_UI) || PPSSPP_PLATFORM(WINDOWS) || PPSSPP_PLATFORM(MAC)) && !PPSSPP_PLATFORM(UWP) - systemSettings->Add(new Choice(sy->T("Show Memory Stick folder")))->OnClick.Handle(this, &GameSettingsScreen::OnOpenMemStick); -#endif + if (System_GetPropertyBool(SYSPROP_HAS_OPEN_DIRECTORY)) { + systemSettings->Add(new Choice(sy->T("Show Memory Stick folder")))->OnClick.Add([](UI::EventParams &p) { + OpenDirectory(File::ResolvePath(g_Config.memStickDirectory.ToString()).c_str()); + return UI::EVENT_DONE; + }); + } #if PPSSPP_PLATFORM(MAC) || PPSSPP_PLATFORM(IOS) systemSettings->Add(new Choice(sy->T("Set Memory Stick folder")))->OnClick.Handle(this, &GameSettingsScreen::OnChangeMemStickDir); @@ -1243,11 +1246,6 @@ UI::EventReturn GameSettingsScreen::OnChangeMemStickDir(UI::EventParams &e) { return UI::EVENT_DONE; } -UI::EventReturn GameSettingsScreen::OnOpenMemStick(UI::EventParams &e) { - OpenDirectory(File::ResolvePath(g_Config.memStickDirectory.ToString()).c_str()); - return UI::EVENT_DONE; -} - #if defined(_WIN32) && !PPSSPP_PLATFORM(UWP) UI::EventReturn GameSettingsScreen::OnSavePathMydoc(UI::EventParams &e) { diff --git a/UI/GameSettingsScreen.h b/UI/GameSettingsScreen.h index 8471af21d3..89f1ce23ad 100644 --- a/UI/GameSettingsScreen.h +++ b/UI/GameSettingsScreen.h @@ -118,7 +118,6 @@ private: UI::EventReturn OnAudioDevice(UI::EventParams &e); UI::EventReturn OnJitAffectingSetting(UI::EventParams &e); UI::EventReturn OnChangeMemStickDir(UI::EventParams &e); - UI::EventReturn OnOpenMemStick(UI::EventParams &e); #if defined(_WIN32) && !PPSSPP_PLATFORM(UWP) UI::EventReturn OnSavePathMydoc(UI::EventParams &e); UI::EventReturn OnSavePathOther(UI::EventParams &e); diff --git a/UWP/PPSSPP_UWPMain.cpp b/UWP/PPSSPP_UWPMain.cpp index 5fabe3a4e1..dd4ae939e7 100644 --- a/UWP/PPSSPP_UWPMain.cpp +++ b/UWP/PPSSPP_UWPMain.cpp @@ -411,6 +411,8 @@ void System_Toast(const char *str) {} bool System_GetPropertyBool(SystemProperty prop) { switch (prop) { + case SYSPROP_HAS_OPEN_DIRECTORY: + return false; case SYSPROP_HAS_FILE_BROWSER: return true; case SYSPROP_HAS_FOLDER_BROWSER: diff --git a/Windows/main.cpp b/Windows/main.cpp index 973243a070..f1be24ef22 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -346,6 +346,7 @@ bool System_GetPropertyBool(SystemProperty prop) { switch (prop) { case SYSPROP_HAS_FILE_BROWSER: case SYSPROP_HAS_FOLDER_BROWSER: + case SYSPROP_HAS_OPEN_DIRECTORY: return true; case SYSPROP_HAS_IMAGE_BROWSER: return true; diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index d7ac20ec4b..e89ec0ec33 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -491,6 +491,8 @@ bool System_GetPropertyBool(SystemProperty prop) { } case SYSPROP_SUPPORTS_SUSTAINED_PERF_MODE: return sustainedPerfSupported; // 7.0 introduced sustained performance mode as an optional feature. + case SYSPROP_HAS_OPEN_DIRECTORY: + return false; case SYSPROP_HAS_ADDITIONAL_STORAGE: return !g_additionalStorageDirs.empty(); case SYSPROP_HAS_BACK_BUTTON: diff --git a/ios/main.mm b/ios/main.mm index 49b35c50b0..3f7e6556d2 100644 --- a/ios/main.mm +++ b/ios/main.mm @@ -152,6 +152,8 @@ float System_GetPropertyFloat(SystemProperty prop) { bool System_GetPropertyBool(SystemProperty prop) { switch (prop) { + case SYSPROP_HAS_OPEN_DIRECTORY: + return false; case SYSPROP_HAS_BACK_BUTTON: return false; case SYSPROP_APP_GOLD: