diff options
| author | Patrick Storz <eduard.braun2@gmx.de> | 2019-08-04 20:40:14 +0000 |
|---|---|---|
| committer | Patrick Storz <eduard.braun2@gmx.de> | 2019-08-31 14:50:38 +0000 |
| commit | 9185b26e396867391d92e4ab6edf933eec77db3a (patch) | |
| tree | ae557ad7fd6bc9a0ec1293a7d85fb0765b9707ba /src/extension/prefdialog/widget.cpp | |
| parent | Rename Parameter -> InxParameter for consistency (diff) | |
| download | inkscape-9185b26e396867391d92e4ab6edf933eec77db3a.tar.gz inkscape-9185b26e396867391d92e4ab6edf933eec77db3a.zip | |
Add WidgetLabel replacing the former ParamDescription
This improves consistency, as "description" parameter were not
actually parameters with a value that could be modified or saved.
The old syntax is deprecated but still supported for now.
Diffstat (limited to 'src/extension/prefdialog/widget.cpp')
| -rw-r--r-- | src/extension/prefdialog/widget.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/extension/prefdialog/widget.cpp b/src/extension/prefdialog/widget.cpp index ea02970ca..1297edb1c 100644 --- a/src/extension/prefdialog/widget.cpp +++ b/src/extension/prefdialog/widget.cpp @@ -11,6 +11,7 @@ */ #include "widget.h" +#include "widget-label.h" #include <sigc++/sigc++.h> @@ -26,7 +27,17 @@ InxWidget *InxWidget::make(Inkscape::XML::Node *in_repr, Inkscape::Extension::Ex { InxWidget *widget = nullptr; - // Note: param could equal nullptr + const char *name = in_repr->name(); + if (!name) { + // we can't create a widget without name + g_warning("InxWidget without name in extension '%s'.", in_ext->get_id()); + } else if (!strcmp(name, "description")) { + widget = new WidgetLabel(in_repr, in_ext); + } else { + g_warning("Unknown widget name ('%s') in extension '%s'", name, in_ext->get_id()); + } + + // Note: widget could equal nullptr return widget; } |
