[Scummvm-git-logs] scummvm master -> 278fb3ba19477e822aa9e9f60317820eca6c2be5

sev- noreply at scummvm.org
Sun Feb 12 15:50:09 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
278fb3ba19 BASE: Add message for Android on startup explaining SAF


Commit: 278fb3ba19477e822aa9e9f60317820eca6c2be5
    https://github.com/scummvm/scummvm/commit/278fb3ba19477e822aa9e9f60317820eca6c2be5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-02-12T16:49:59+01:00

Commit Message:
BASE: Add message for Android on startup explaining SAF

There are two messages, for upgrade and for the new users

Changed paths:
    base/main.cpp


diff --git a/base/main.cpp b/base/main.cpp
index ae704e8defa..3ee9c3ee3fe 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -56,6 +56,7 @@
 
 #include "gui/gui-manager.h"
 #include "gui/error.h"
+#include "gui/message.h"
 
 #include "audio/mididrv.h"
 #include "audio/musicplugin.h"  /* for music manager */
@@ -92,6 +93,10 @@
 #include "gui/updates-dialog.h"
 #endif
 
+#ifdef __ANDROID__
+#include "backends/fs/android/android-fs-factory.h"
+#endif
+
 static bool launcherDialog() {
 
 	// Discard any command line options. Those that affect the graphics
@@ -665,6 +670,66 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
 	}
 #endif
 
+#ifdef __ANDROID__
+	if (AndroidFilesystemFactory::instance().hasSAF()
+		&& !ConfMan.hasKey("android_saf_dialog_shown")) {
+
+		bool cancelled = false;
+
+		if (!ConfMan.getGameDomains().empty()) {
+			GUI::MessageDialog alert(_(
+				"In this new version of ScummVM Android, significant changes were made to "
+				"the file access system to allow support for modern versions of the Android "
+				"Operating System.\n"
+				"If you find that your existing added games or custom paths no longer work, "
+				"please edit those paths and this time use the SAF system to browse to the "
+				"desired locations.\n"
+				"To do that:\n"
+				"\n"
+				"  1. For each game whose data is not found, go to the \"Paths\" tab in "
+				"the \"Game Options\" and change the \"Game path\"\n"
+				"  2. Inside the ScummVM file browser, use \"Go Up\" until you reach "
+				"the \"root\" folder where you will see the \"<Add SAF node>\" option.\n"
+				"  3. Choose that, then browse and select the \"parent\" folder for your "
+				"games subfolders, e.g. \"SD Card > myGames\". Click on \"Use this folder\".\n"
+				"  4. Then, a new folder \"myGames\" will appear on the \"root\" folder "
+				"of the ScummVM browser.\n"
+				"  5. Browse through this folder to your game data.\n"
+				"\n"
+				"Steps 2 and 3 need to be done only once for all of your games."
+				), _("Ok"),
+				// I18N: A button caption to dismiss amessage and read it later
+				_("Read Later"), Graphics::kTextAlignLeft);
+
+			if (alert.runModal() != GUI::kMessageOK)
+				cancelled = true;
+		} else {
+			GUI::MessageDialog alert(_(
+				"In this new version of ScummVM Android, significant changes were made to "
+				"the file access system to allow support for modern versions of the Android "
+				"Operating System.\n"
+				"Thus, you need to set up SAF in order to be able to add the games.\n"
+				"\n"
+				"  1. Inside the ScummVM file browser, use \"Go Up\" until you reach "
+				"the \"root\" folder where you will see the \"<Add SAF node>\" option.\n"
+				"  2. Choose that, then browse and select the \"parent\" folder for your "
+				"games subfolders, e.g. \"SD Card > myGames\". Click on \"Use this folder\".\n"
+				"  3. Then, a new folder \"myGames\" will appear on the \"root\" folder "
+				"of the ScummVM browser.\n"
+				"  4. Browse through this folder to your game data."
+				), _("Ok"),
+				// I18N: A button caption to dismiss a message and read it later
+				_("Read Later"), Graphics::kTextAlignLeft);
+
+			if (alert.runModal() != GUI::kMessageOK)
+				cancelled = true;
+		}
+
+		if (!cancelled)
+			ConfMan.setBool("android_saf_dialog_shown", true);
+	}
+#endif
+
 #if defined(USE_CLOUD) && defined(USE_LIBCURL)
 	CloudMan.init();
 	CloudMan.syncSaves();




More information about the Scummvm-git-logs mailing list