From 4aa30017bf6706eb2dd8b3ea0c897d1be4051a2a Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 15 May 2020 18:46:06 +0200 Subject: [PATCH] Changed the version format and added proper handling of invalid command line arguments --- es-app/src/EmulationStation.h | 6 +++--- es-app/src/guis/GuiMenu.cpp | 6 +++--- es-app/src/main.cpp | 19 +++++++++++++------ es-app/src/scrapers/ScreenScraper.h | 2 +- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/es-app/src/EmulationStation.h b/es-app/src/EmulationStation.h index 4b8462b19..ba400e1ae 100644 --- a/es-app/src/EmulationStation.h +++ b/es-app/src/EmulationStation.h @@ -4,10 +4,10 @@ // These numbers and strings need to be manually updated for a new version. // Do this version number update as the very last commit for the new release version. -#define PROGRAM_VERSION_MAJOR 2 -#define PROGRAM_VERSION_MINOR 10 +#define PROGRAM_VERSION_MAJOR 1 +#define PROGRAM_VERSION_MINOR 0 #define PROGRAM_VERSION_MAINTENANCE 0 -#define PROGRAM_VERSION_STRING "1.0.0DE-dev" +#define PROGRAM_VERSION_STRING "1.0.0-alpha" #define PROGRAM_BUILT_STRING __DATE__ " - " __TIME__ diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index c9d86dd64..ffa80742f 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -566,7 +566,7 @@ void GuiMenu::openQuitMenu() Scripting::fireEvent("quit", "poweroff"); Scripting::fireEvent("poweroff"); if (quitES(QuitMode::POWEROFF) != 0) - LOG(LogWarning) << "Poweroff terminated with non-zero result!"; + LOG(LogWarning) << "Power off terminated with non-zero result!"; }, "NO", nullptr)); }); row.addElement(std::make_shared(window, "POWER OFF SYSTEM", Font::get(FONT_SIZE_MEDIUM), 0x777777FF), true); @@ -578,11 +578,11 @@ void GuiMenu::openQuitMenu() void GuiMenu::addVersionInfo() { - std::string buildDate = (Settings::getInstance()->getBool("Debug") ? std::string( " (" + Utils::String::toUpper(PROGRAM_BUILT_STRING) + ")") : ("")); +// std::string buildDate = (Settings::getInstance()->getBool("Debug") ? std::string( " (" + Utils::String::toUpper(PROGRAM_BUILT_STRING) + ")") : ("")); mVersion.setFont(Font::get(FONT_SIZE_SMALL)); mVersion.setColor(0x5E5E5EFF); - mVersion.setText("EMULATIONSTATION V" + Utils::String::toUpper(PROGRAM_VERSION_STRING) + buildDate); + mVersion.setText("EMULATIONSTATION-DE V" + Utils::String::toUpper(PROGRAM_VERSION_STRING)); mVersion.setHorizontalAlignment(ALIGN_CENTER); addChild(&mVersion); } diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index ef92da03d..9ebda3dd7 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -138,9 +138,9 @@ bool parseArgs(int argc, char* argv[]) bool vsync = (strcmp(argv[i + 1], "on") == 0 || strcmp(argv[i + 1], "1") == 0) ? true : false; Settings::getInstance()->setBool("VSync", vsync); i++; // skip vsync value - }else if(strcmp(argv[i], "--scrape") == 0) - { - scrape_cmdline = true; +// }else if(strcmp(argv[i], "--scrape") == 0) +// { +// scrape_cmdline = true; }else if(strcmp(argv[i], "--max-vram") == 0) { int maxVRAM = atoi(argv[i + 1]); @@ -169,8 +169,7 @@ bool parseArgs(int argc, char* argv[]) freopen("CONOUT$", "wb", stdout); #endif std::cout << - "EmulationStation, a graphical front-end for ROM browsing.\n" - "Written by Alec \"Aloshi\" Lofquist.\n" + "EmulationStation Desktop Edition, a graphical front-end for ROM browsing.\n" "Version " << PROGRAM_VERSION_STRING << ", built " << PROGRAM_BUILT_STRING << "\n\n" "Command line arguments:\n" "--resolution [width] [height] Try and force a particular resolution\n" @@ -180,7 +179,7 @@ bool parseArgs(int argc, char* argv[]) "--no-exit Don't show the exit option in the menu\n" "--no-splash Don't show the splash screen\n" "--debug More logging, show console on Windows\n" - "--scrape Scrape using command line interface\n" +// "--scrape Scrape using command line interface\n" "--windowed Not fullscreen, should be used with --resolution\n" "--fullscreen-normal Run in normal fullscreen mode\n" "--fullscreen-borderless Run in borderless fullscreen mode (always on top)\n" @@ -194,6 +193,14 @@ bool parseArgs(int argc, char* argv[]) "More information available in README.md.\n"; return false; //exit after printing help } + else + { + std::string argv_unknown = argv[i]; + std::cout << "Invalid command line argument '" << argv_unknown << "'\n"; + std::cout << "Try 'emulationstation --help' for more information.\n"; + return false; // exit after printing message + } + } return true; diff --git a/es-app/src/scrapers/ScreenScraper.h b/es-app/src/scrapers/ScreenScraper.h index 2999a4649..c27f0c61a 100644 --- a/es-app/src/scrapers/ScreenScraper.h +++ b/es-app/src/scrapers/ScreenScraper.h @@ -28,7 +28,7 @@ public: const std::string API_DEV_P = { 108, 28, 54, 55, 83, 43, 91, 44, 30, 22, 41, 12, 0, 108, 38, 29 }; const std::string API_DEV_KEY = { 54, 73, 115, 100, 101, 67, 111, 107, 79, 66, 68, 66, 67, 56, 118, 77, 54, 88, 101, 54 }; const std::string API_URL_BASE = "https://www.screenscraper.fr/api2"; - const std::string API_SOFT_NAME = "Emulationstation " + static_cast(PROGRAM_VERSION_STRING); + const std::string API_SOFT_NAME = "Emulationstation-DE " + static_cast(PROGRAM_VERSION_STRING); /** Which type of image artwork we need. Possible values (not a comprehensive list): - ss: in-game screenshot