From 88778e47a53d09db393e00330d65de7ad7ec76ff Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 25 Dec 2023 23:23:39 +0100 Subject: [PATCH] (Android) Some customizations for the Lite release --- es-app/src/guis/GuiMenu.cpp | 25 +++++++++++++++++++++---- es-app/src/main.cpp | 23 +++++++++++++++-------- es-core/src/Window.cpp | 4 ++++ 3 files changed, 40 insertions(+), 12 deletions(-) diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 5bddf78dd..30e7b4a22 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -1718,12 +1718,23 @@ void GuiMenu::openUtilities() ComponentListRow row; +#if defined(ANDROID_LITE_RELEASE) + auto orphanedDataCleanup = + std::make_shared("ORPHANED DATA CLEANUP (FULL VERSION ONLY)", + Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary); + orphanedDataCleanup->setOpacity(DISABLED_OPACITY); + row.addElement(orphanedDataCleanup, true); + auto orphanedDataCleanupArrow = mMenu.makeArrow(); + orphanedDataCleanupArrow->setOpacity(DISABLED_OPACITY); + row.addElement(orphanedDataCleanupArrow, false); +#else row.addElement(std::make_shared("ORPHANED DATA CLEANUP", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary), true); row.addElement(mMenu.makeArrow(), false); row.makeAcceptInputHandler(std::bind( [this] { mWindow->pushGui(new GuiOrphanedDataCleanup([&]() { close(true); })); })); +#endif s->addRow(row); row.elements.clear(); @@ -1897,11 +1908,17 @@ void GuiMenu::addVersionInfo() mVersion.setFont(Font::get(FONT_SIZE_SMALL)); mVersion.setColor(mMenuColorTertiary); -#if defined(IS_PRERELEASE) - mVersion.setText("ES-DE V" + Utils::String::toUpper(PROGRAM_VERSION_STRING) + " (Built " + - __DATE__ + ")"); +#if defined(ANDROID_LITE_RELEASE) + const std::string applicationName {"ES-DE LITE"}; #else - mVersion.setText("ES-DE V" + Utils::String::toUpper(PROGRAM_VERSION_STRING)); + const std::string applicationName {"ES-DE"}; +#endif + +#if defined(IS_PRERELEASE) + mVersion.setText(applicationName + " V" + Utils::String::toUpper(PROGRAM_VERSION_STRING) + + " (Built " + __DATE__ + ")"); +#else + mVersion.setText(applicationName + " V" + Utils::String::toUpper(PROGRAM_VERSION_STRING)); #endif mVersion.setHorizontalAlignment(ALIGN_CENTER); diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index 5af07c970..a284ebe34 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -630,14 +630,21 @@ int main(int argc, char* argv[]) // Start the logger. Log::init(); Log::open(); - LOG(LogInfo) << "ES-DE v" << PROGRAM_VERSION_STRING << " (r" << PROGRAM_RELEASE_NUMBER - << "), built " << PROGRAM_BUILT_STRING; - if (portableMode) { - LOG(LogInfo) << "Running in portable mode"; - Settings::getInstance()->setBool("PortableMode", true); - } - else { - Settings::getInstance()->setBool("PortableMode", false); + { +#if defined(ANDROID_LITE_RELEASE) + const std::string applicationName {"ES-DE Lite"}; +#else + const std::string applicationName {"ES-DE"}; +#endif + LOG(LogInfo) << applicationName << " v" << PROGRAM_VERSION_STRING << " (r" + << PROGRAM_RELEASE_NUMBER << "), built " << PROGRAM_BUILT_STRING; + if (portableMode) { + LOG(LogInfo) << "Running in portable mode"; + Settings::getInstance()->setBool("PortableMode", true); + } + else { + Settings::getInstance()->setBool("PortableMode", false); + } } // Always close the log on exit. diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index 904661d63..890c72a4a 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -866,6 +866,10 @@ void Window::stopMediaViewer() void Window::startPDFViewer(FileData* game) { if (mPDFViewer) { +#if defined(ANDROID_LITE_RELEASE) + queueInfoPopup("PDF VIEWER ONLY AVAILABLE IN FULL VERSION", 6000); + return; +#endif if (mPDFViewer->startPDFViewer(game)) { setAllowTextScrolling(false); setAllowFileAnimation(false);