summaryrefslogtreecommitdiffstats
path: root/src/extension/prefdialog/parameter.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-10-19Extensions: catch parameters and translatable values with empty namePatrick Storz1-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.
2019-09-07Extensions: Handle optiongroup options without valuePatrick Storz1-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
2019-08-31Add new parameter of type "path"Patrick Storz1-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.
2019-08-31Make 'gui-text' required for visible parametersPatrick Storz1-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.
2019-08-31Simplify pref_name() functionPatrick Storz1-4/+2
2019-08-31Remove completely unused "doc" and "node" parametersPatrick Storz1-28/+28
2019-08-31Re-implement get_param() locally using get_widgets()Patrick Storz1-5/+0
2019-08-31Make parameter string generation a job of Inkscape::ExtensionPatrick Storz1-15/+0
For this take a first step towards properly tracking children of each parameter and provide functions to look up all widgets.
2019-08-31Accept parameter type "bool"Patrick Storz1-1/+1
Seems more consistent with "int" and "float" types and should likely be preferred over the old "boolean"
2019-08-31Optimize parameter string generationPatrick Storz1-14/+14
Also rename overloaded string() functions, so it's clear what they actually do, as it's not the same thing at all...
2019-08-31More cleanupPatrick Storz1-7/+12
2019-08-31Add WidgetLabel replacing the former ParamDescriptionPatrick Storz1-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.
2019-08-31Rename Parameter -> InxParameter for consistencyPatrick Storz1-21/+21
2019-08-31Create new InxWidget base class for extension widgets.Patrick Storz1-62/+2
2019-08-31Implement "translationdomain" attribute for extensionsPatrick Storz1-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
2019-08-31Add function to get proper translation within context of ParameterPatrick Storz1-10/+13
2019-08-31Parameter: remove unused constructorsPatrick Storz1-45/+0
2019-08-31Refactor a lot of the parameter handling codePatrick Storz1-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
2019-08-31Move error classes to Parameter where they belongPatrick Storz1-15/+15
2019-08-31Remove unused define ESCAPE_DOLLAR_COMMANDLINEPatrick Storz1-4/+0
2019-08-31Rename parameter source files to avoid name conflictsPatrick Storz1-9/+9
2019-08-31Remove unused functionsPatrick Storz1-46/+0
2019-08-31Move prefdialog to own directoryPatrick Storz1-0/+0
2019-01-02modernize loopsMarc Jeanmougin1-3/+2
2018-11-08Clarify licensesMax Gaukler1-1/+2
- add license headers to everything - convert a few files from public domain or LGPL2.1+ to GPL2+ - some archaeology to clarify which files are from which library
2018-10-22Remove 'document-private.h' where not needed plus some other header cleanup.Tavmjong Bah1-9/+13
2018-10-01Remove #include "config.h" wherever possibleEduard Braun1-4/+0
2018-06-19Run clang-tidy’s modernize-redundant-void-arg pass.Emmanuel Gil Peyrot1-2/+2
2018-06-18Run clang-tidy’s modernize-use-nullptr pass.Emmanuel Gil Peyrot1-38/+38
This replaces all NULL or 0 with nullptr when assigned to or returned as a pointer.
2018-05-14Misc. typosluz.paz1-1/+1
Found via `codespell` and `grep`
2018-05-04Revert "Fix include order with clang-tidy check llvm-include-order"Marc Jeanmougin1-2/+2
This reverts commit bba4ff6672494fab59286b50f6c645ad62a47e60.
2018-04-29Fix include order with clang-tidy check llvm-include-orderMarc Jeanmougin1-2/+2
2018-01-30Move classes derived from SPObject to own directory.Tavmjong Bah1-1/+1
A lot of header clean-up.
2017-04-24Restore r14978 which was reverted in r15047 due to messed up mergeEduard Braun1-1/+0
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/14978 http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/15047 (bzr r15638)
2017-04-24Extensions: Fixes and improvements for "gui-description" parameter attribute ↵Eduard Braun1-0/+8
along the lines of r14955 - "gui-description" was always translated (as opposed to only "_gui-description") - Added possibility to specify "msgctxt" for "_gui-description" (bzr r15635)
2017-04-24Restore r14955 which was reverted in r15047 due to messed up mergeEduard Braun1-0/+11
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/14955 http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/15047 Fixed bugs: - https://launchpad.net/bugs/1669951 (bzr r15633)
2017-04-09Some code refactoring for consistencyEduard Braun1-44/+44
(notably "gui_hidden" -> hidden", "guitext" -> "text", "desc" -> "description") (bzr r15633.1.3)
2017-04-09Remove unused field "scope"Eduard Braun1-29/+13
(bzr r15633.1.2)
2017-04-09Remove unused field "gui_tip"Eduard Braun1-26/+14
("gui_description" does now what "gui_tip" was supposed to do) (bzr r15633.1.1)
2017-02-13Extensions: Add 'appearance="url"' to desccription parameters.Eduard Braun1-4/+8
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)
2017-02-13Extensions: Do not require name for pure UI elements (i.e. parameters that ↵Eduard Braun1-2/+9
do not store a value and therefore do not need to have a name) (bzr r15515)
2017-02-12Extensions: Make "indent" attribute a common attribute for all parameters ↵Eduard Braun1-15/+28
that behaves more consistent and predictable than before. - Every "Parameter" now has an "_indent" member variable (specifying the indentation level; set in "Parameter::make()", see parameter.cpp) - Indentation is achieved by using "set_margin_left()" on the parameter's widget. This fixes bug #1662035 (comment #4 contains some more details about this patch). - Specifying "indent" on a parameter will now work consistently for all parameters. Previously the "indent" attribute often had no effect at all, e.g. for notebooks but also for parameters with 'appearance="full"' which was reasonable in most cases but made the outcome of using this attribute often unpredictable and is unnecessarily restrictive. - Most visible change: "description"s always used an indentation level of at least one (even if no indentation was specified). For the sake of consistency this discrepancy was dropped. Previous appearance can easily be restored by setting 'indent="1"'. Fixed bugs: - https://launchpad.net/bugs/1662035 (bzr r15508)
2016-06-11Clean up includes after r14955Eduard Braun1-1/+2
Fixed bugs: - https://launchpad.net/bugs/1589300 (bzr r14978)
2016-06-05Extensions: Fixes and improvements for "gui-text" parameter attributeEduard Braun1-0/+11
- "gui-text" was always translated (as opposed to only "_gui-text") - This made it impossible to have parameters without label (since the empty string returns the whole .po file header when translated), which caused an issue in restack extension - Added possibility to specify "msgctxt" for "gui-text" (bzr r14955)
2015-12-27Fix more GThreads issuesAlex Valavanis1-5/+2
(bzr r14546)
2014-06-01moved ColorNotebook to ui/widgetTomasz Boczkowski1-2/+1
(bzr r13341.6.51)
2014-05-30SPColorNotebok c++-sification - available pages listTomasz Boczkowski1-0/+4
(bzr r13341.6.28)
2013-06-05Add command line option to specify PDF export version. Patch from schwieni.Vinícius dos Santos Oliveira1-0/+18
From the patch's author: Additional command line option added to export to different PDF-versions supported by cairo (currently only "PDF 1.4" and "PDF 1.5"). The user must provide the exact string found in the PDF-export dialog of Inkscape. This feature was previously only accessible via the GUI of Inkscape. This option is useful for people opting for PDF-a conformance in their PDFs. Moreover, the Extension and Parameter classes are extended by setters for enum parameters (used in combo boxes). (bzr r12348)
2012-02-29Header tidying, suppress all gdk deprecation errors in gtkmmAlex Valavanis1-0/+1
(bzr r11030)
2011-12-19Const correctness fixes that also correct bug #893146.Jon A. Cruz1-147/+122
Fixed bugs: - https://launchpad.net/bugs/893146 (bzr r10783)