From d00e79c7fb8a64a40199190f638d655d7c595956 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sun, 22 Aug 2021 18:50:06 -0400 Subject: [PATCH] Rename APP_EDITION to APP_EDITION_NAME. Add APP_EDITION with abbreviated edition. --- .gitignore | 1 + include/common.hpp | 3 ++- src/Window.cpp | 2 +- src/app/MenuBar.cpp | 2 +- src/app/TipWindow.cpp | 2 +- src/common.cpp | 6 +++--- src/library.cpp | 6 +++++- 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index bd9a4f9e..72ded444 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ /Rack /dep /plugins +/disabledplugins /build /dist /patches diff --git a/include/common.hpp b/include/common.hpp index 6cfdaacd..d2216b94 100644 --- a/include/common.hpp +++ b/include/common.hpp @@ -261,8 +261,9 @@ typename C::mapped_type get(const C& m, const typename C::key_type& key, const t extern const std::string APP_NAME; extern const std::string APP_EDITION; -extern const std::string APP_VERSION; +extern const std::string APP_EDITION_NAME; extern const std::string APP_VERSION_MAJOR; +extern const std::string APP_VERSION; extern const std::string APP_ARCH; extern const std::string API_URL; diff --git a/src/Window.cpp b/src/Window.cpp index b775ae21..05448673 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -423,7 +423,7 @@ void Window::step() { gamepad::step(); // Set window title - std::string windowTitle = APP_NAME + " " + APP_EDITION + " " + APP_VERSION; + std::string windowTitle = APP_NAME + " " + APP_EDITION_NAME + " " + APP_VERSION; if (APP->patch->path != "") { windowTitle += " - "; if (!APP->history->isSaved()) diff --git a/src/app/MenuBar.cpp b/src/app/MenuBar.cpp index b6da0412..371aed99 100644 --- a/src/app/MenuBar.cpp +++ b/src/app/MenuBar.cpp @@ -780,7 +780,7 @@ struct HelpButton : MenuButton { menu->addChild(new ui::MenuSeparator); - menu->addChild(createMenuLabel(APP_EDITION)); + menu->addChild(createMenuLabel(APP_EDITION_NAME)); menu->addChild(createMenuLabel(APP_VERSION)); } diff --git a/src/app/TipWindow.cpp b/src/app/TipWindow.cpp index 9ae70c3d..67039bdd 100644 --- a/src/app/TipWindow.cpp +++ b/src/app/TipWindow.cpp @@ -73,7 +73,7 @@ struct TipWindow : widget::OpaqueWidget { // header->box.size.x = box.size.x - 2*margin; header->box.size.y = 20; header->fontSize = 20; - header->text = "Welcome to " + APP_NAME + " " + APP_EDITION + " " + APP_VERSION; + header->text = "Welcome to " + APP_NAME + " " + APP_EDITION_NAME + " " + APP_VERSION; layout->addChild(header); label = new ui::Label; diff --git a/src/common.cpp b/src/common.cpp index ac4acc81..9193803f 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -16,9 +16,10 @@ namespace rack { const std::string APP_NAME = "VCV Rack"; -const std::string APP_EDITION = "Community Edition"; -const std::string APP_VERSION = TOSTRING(VERSION); +const std::string APP_EDITION = "CE"; +const std::string APP_EDITION_NAME = "Community Edition"; const std::string APP_VERSION_MAJOR = "2"; +const std::string APP_VERSION = TOSTRING(VERSION); #if defined ARCH_WIN const std::string APP_ARCH = "win"; #elif ARCH_MAC @@ -26,7 +27,6 @@ const std::string APP_VERSION_MAJOR = "2"; #elif defined ARCH_LIN const std::string APP_ARCH = "lin"; #endif - const std::string API_URL = "https://api.vcvrack.com"; diff --git a/src/library.cpp b/src/library.cpp index 967ed8db..ec6cb617 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -65,7 +65,11 @@ void destroy() { void checkAppUpdate() { std::string versionUrl = API_URL + "/version"; - json_t* resJ = network::requestJson(network::METHOD_GET, versionUrl, NULL); + json_t* reqJ = json_object(); + json_object_set(reqJ, "edition", json_string(APP_EDITION.c_str())); + DEFER({json_decref(reqJ);}); + + json_t* resJ = network::requestJson(network::METHOD_GET, versionUrl, reqJ); if (!resJ) { WARN("Request for version failed"); return;