From 24d66b5173963dcb69545614449de91da5397db6 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Tue, 14 Feb 2017 00:42:11 +0100 Subject: Extensions: Add 'appearance="url"' to desccription parameters. It allows to create and add a clickable plain text link to extensions The description parameter's text is escaped and converted to a URL as-is preventing potential security issues The Scour extension shows a first example implementation (bzr r15519) --- src/extension/param/parameter.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/extension/param/parameter.cpp') diff --git a/src/extension/param/parameter.cpp b/src/extension/param/parameter.cpp index 9fbe662f7..0eb491078 100644 --- a/src/extension/param/parameter.cpp +++ b/src/extension/param/parameter.cpp @@ -135,11 +135,15 @@ Parameter *Parameter::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex ps->setMaxLength(atoi(max_length)); } } else if (!strcmp(type, "description")) { - if (appearance && !strcmp(appearance, "header")) { - param = new ParamDescription(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr, ParamDescription::HEADER); - } else { - param = new ParamDescription(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr, ParamDescription::DESC); + ParamDescription::AppearanceMode appearance_mode = ParamDescription::DESC; + if (appearance) { + if (!strcmp(appearance, "header")) { + appearance_mode = ParamDescription::HEADER; + } else if (!strcmp(appearance, "url")) { + appearance_mode = ParamDescription::URL; + } } + param = new ParamDescription(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr, appearance_mode); } else if (!strcmp(type, "enum")) { param = new ParamComboBox(name, guitext, desc, scope, gui_hidden, gui_tip, indent, in_ext, in_repr); } else if (!strcmp(type, "notebook")) { -- cgit v1.2.3