summaryrefslogtreecommitdiffstats
path: root/src/extension/prefdialog/parameter.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Extensions: catch parameters and translatable values with empty namePatrick Storz2019-10-191-2/+4
| | | | | | | | | | A parameter with empty name (or name consisting of whitespace only) can cause undefined behavior and should be avoided at all cost. Empty translatable values like "gui-text"/"gui-description", while not encouraged, might be acceptable. However they must not be translated as gettext would return the full metadata of the .po file in this case.
* Extensions: Handle optiongroup options without valuePatrick Storz2019-09-071-1/+1
| | | | | | | | | | We use the user visible GUI text as value in this case, which may or may not be translated. For backwards-compatibility with enum items use the untranslated value instead, if one of the deprecated tag-names is found. Fixes https://gitlab.com/inkscape/inkscape/issues/399
* Add new parameter of type "path"Patrick Storz2019-08-311-0/+3
| | | | | | | | | | | | | | | | | | * Similar to parameter's of type "string": Has a text entry and stores a string preference * Additionally offers a button to show a file chooser dialog * The node's content is the initial (default) file path. * Relative paths will be considered relative to the extension's .inx file. This allows to reference files/folders shipped with the extension in a portable way. The stored value as well as the parameter value passed to the script interpreter will always be absolute, though. * The attribute "mode" controls what type(s) of paths the file chooser allows to select. Valid values: - 'file', 'files', 'folder', 'folder' (pick existing items) - 'file_new', 'folder_new' (create a new file/folder) * Note that manually entered values will be passed as-is without checking for existence.
* Make 'gui-text' required for visible parametersPatrick Storz2019-08-311-27/+39
| | | | | | | | | We were actually crashing for visible parameters without 'gui-text' otherwise. Also make sure we actually *do* bail out if we have parameters missing required fields and throw/catch an exception instead of producing broken instances.
* Simplify pref_name() functionPatrick Storz2019-08-311-4/+2
|
* Remove completely unused "doc" and "node" parametersPatrick Storz2019-08-311-28/+28
|
* Re-implement get_param() locally using get_widgets()Patrick Storz2019-08-311-5/+0
|
* Make parameter string generation a job of Inkscape::ExtensionPatrick Storz2019-08-311-15/+0
| | | | | For this take a first step towards properly tracking children of each parameter and provide functions to look up all widgets.
* Accept parameter type "bool"Patrick Storz2019-08-311-1/+1
| | | | | Seems more consistent with "int" and "float" types and should likely be preferred over the old "boolean"
* Optimize parameter string generationPatrick Storz2019-08-311-14/+14
| | | | | Also rename overloaded string() functions, so it's clear what they actually do, as it's not the same thing at all...
* More cleanupPatrick Storz2019-08-311-7/+12
|
* Add WidgetLabel replacing the former ParamDescriptionPatrick Storz2019-08-311-2/+21
| | | | | | | 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.
* Rename Parameter -> InxParameter for consistencyPatrick Storz2019-08-311-21/+21
|
* Create new InxWidget base class for extension widgets.Patrick Storz2019-08-311-62/+2
|
* Implement "translationdomain" attribute for extensionsPatrick Storz2019-08-311-7/+1
| | | | | | | | | | | | Will allow extensions to ship their own message catalog used for translation of the extension#s strings. Needs to be set on the root <inkscape-extension> element of the .inx Currently supported values: - unset: use default textdomain (which happens to be 'inkscape') - 'inkscape': use Inkscape's message catalog - 'none': disable translation for the extension's strings
* Add function to get proper translation within context of ParameterPatrick Storz2019-08-311-10/+13
|
* Parameter: remove unused constructorsPatrick Storz2019-08-311-45/+0
|
* Refactor a lot of the parameter handling codePatrick Storz2019-08-311-153/+135
| | | | | | | Many fixes, improvements and simplifications to existing code. Implements the first part of the changes discussed in https://gitlab.com/inkscape/inkscape/issues/333
* Move error classes to Parameter where they belongPatrick Storz2019-08-311-15/+15
|
* Remove unused define ESCAPE_DOLLAR_COMMANDLINEPatrick Storz2019-08-311-4/+0
|
* Rename parameter source files to avoid name conflictsPatrick Storz2019-08-311-0/+415