From 90e70060c3114c0a602f7134dc1806629ba7479f Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Tue, 29 Oct 2019 09:51:03 -0400 Subject: [PATCH] Add manualUrl to plugin::Model. --- include/app/CableWidget.hpp | 3 ++- include/plugin/Model.hpp | 3 +++ src/plugin/Model.cpp | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/app/CableWidget.hpp b/include/app/CableWidget.hpp index f8116dcc..19c5b179 100644 --- a/include/app/CableWidget.hpp +++ b/include/app/CableWidget.hpp @@ -23,10 +23,11 @@ struct CableWidget : widget::OpaqueWidget { CableWidget(); ~CableWidget(); bool isComplete(); - /** From input/output ports, re-creates a cable and adds it to the Engine. */ + /** Based on the input/output ports, re-creates the cable and removes/adds it to the Engine. */ void updateCable(); /** From a cable, sets the input/output ports. Cable must already be added to the Engine. + Adopts ownership. */ void setCable(engine::Cable* cable); math::Vec getInputPos(); diff --git a/include/plugin/Model.hpp b/include/plugin/Model.hpp index 4742fde7..113de61e 100644 --- a/include/plugin/Model.hpp +++ b/include/plugin/Model.hpp @@ -37,6 +37,9 @@ struct Model { std::vector tags; /** A one-line summary of the module's purpose */ std::string description; + /** The manual of the module. HTML, PDF, or GitHub readme/wiki are fine. + */ + std::string manualUrl; virtual ~Model() {} /** Creates a Module. */ diff --git a/src/plugin/Model.cpp b/src/plugin/Model.cpp index 299fce7f..b03295ff 100644 --- a/src/plugin/Model.cpp +++ b/src/plugin/Model.cpp @@ -37,6 +37,11 @@ void Model::fromJson(json_t* rootJ) { } } + // manualUrl + json_t* manualUrlJ = json_object_get(rootJ, "manualUrl"); + if (manualUrlJ) + manualUrl = json_string_value(manualUrlJ); + // Preset paths presetPaths.clear(); std::string presetDir = asset::plugin(plugin, "presets/" + slug);