Add "file" type to INX UI parameters

Bug #1070193 reported by Rena Kunisaki
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Wishlist
Unassigned

Bug Description

In a .inx file, it's possible to define various UI widget types like text, boolean, color... I suggest to add "file" to this list. This would function the same as "string", except it would also add a button to select a file to fill in the text field. It might have an option to verify that the selected file exists before calling the script (you'd want this for selecting existing files, but not if your script creates a new file).

su_v (suv-lp)
tags: added: extensions-plugins
Changed in inkscape:
importance: Undecided → Wishlist
tags: added: ui
su_v (suv-lp)
Changed in inkscape:
status: New → Confirmed
Revision history for this message
Neon22 (neon22) wrote :

Ideally add a new type to the inx parameters which allows selection of a file by using the systems file chooser.
Existing inx params are here:
http://wiki.inkscape.org/wiki/index.php/INX_Parameters
and param defines are here:
http://wiki.inkscape.org/wiki/index.php/INX_extension_descriptor_format

Ideally a new parameter of type filename which is a string. and invokes the system file browser with options for:
- filetypes(list of extension strings) - to filter on
- allow multiple - True/False
- initial directory - including ., .., a path (unvalidated)
Which would return a list of strings of full paths. or just force it to be single only if this is easier.

However - it is worth noting that if tk was included in the distro then we could use their filechooser instead of this extra work.

Revision history for this message
Patrick Storz (ede123) wrote :

I'm reviewing some old bugs as I'm in the process of updating the .inx format a bit for 1.0 [1].

This is something I'd like to add if time allows.

Can people who would like to use this feature in their own extensions comment on what exactly they'd need? The goal is to keep it as simple as possible, but obviously we need to be flexible enough to cover the intended use cases.

Some questions of the top of my head:
- do we need dedicated file/folder pickers or is a general picker that
  selects files and folders fine?
- do we need multi-selection or is a single selection sufficient?
- do we need file type filtering?

I tend not to implement existence checks, as this already defines behavior (picking an existing file) whereas I'd like to implement this in a more general way that can be used both for picking an existing file as well as for choosing a new file. If the extension requires an existing file this can be checked in the extension itself and should be most flexible and error-proof. Let me know if this is an issue.

[1] https://gitlab.com/inkscape/inkscape/issues/333

Revision history for this message
Patrick Storz (ede123) wrote :

Let's continue discussion regarding file-picker implementation at https://gitlab.com/inkscape/inkscape/issues/344

Changed in inkscape:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.