Extension interface request
Hi,
I'd like to make a couple of requests for features (or perhaps explanations/pointers to why they can't be included).
1) It would be really cool to have a proper directory selection (or popup directory chooser) as an option on the inkex dialog. This way the user doesn't have to memorise their favourite directories etc., they can browse to them, or use favourites, etc.
2) Someone on #inkscape mentioned that the filename/directory information was excluded from the SVG for security reasons, but this class of information is still freely included in the form of export hints. It's inconsistent for one, and inconvenient for another. I've just been developing an extension where it would have been much nicer to export the necessary files to the same directory by default. A possible workaround if 1) is ever implemented, would be to optionally default the directory chooser to the drawing's working directory, thereby bypassing the security problem.
3) Possibly related to 2. Whenever I export a document from inkscape, then move the file (I have a bunch of folders/hierarchies and the files move depending on various states), if I then need to export again, I have to tell it where to export to, and it's a bit of a pain, it would be nice for an option to always export to the working directory.
Thanks, Craig
I believe relative paths are the solution to #1 & #2.
I've been quite pleased with the recent changes to Inkscape that allow useful relative paths in the export dialog -- previously, relative paths were taken to be relative to the CWD, which could be different any time you run Inkscape, different on different machines or for different users, etc, etc. Now, relative paths are taken to be relative to the document's path. Works like a charm! Makes it very convenient to move the file, or zip up a project folder to send to other people, or use an SVG file in a repository.
I believe both export hints & image references use the same logic now, IIRC.
One feature which might help with all this is for any file chooser dialog (including for extensions) to return the pathname as a relative path when it makes sense.
- Bryan
On Mon, Aug 16, 2010 at 22:56, Craig Marshall <craig9@...400...> wrote:
Hi,
I'd like to make a couple of requests for features (or perhaps explanations/pointers to why they can't be included).
- It would be really cool to have a proper directory selection (or
popup directory chooser) as an option on the inkex dialog. This way the user doesn't have to memorise their favourite directories etc., they can browse to them, or use favourites, etc.
- Someone on #inkscape mentioned that the filename/directory
information was excluded from the SVG for security reasons, but this class of information is still freely included in the form of export hints. It's inconsistent for one, and inconvenient for another. I've just been developing an extension where it would have been much nicer to export the necessary files to the same directory by default. A possible workaround if 1) is ever implemented, would be to optionally default the directory chooser to the drawing's working directory, thereby bypassing the security problem.
- Possibly related to 2. Whenever I export a document from inkscape,
then move the file (I have a bunch of folders/hierarchies and the files move depending on various states), if I then need to export again, I have to tell it where to export to, and it's a bit of a pain, it would be nice for an option to always export to the working directory.
Thanks, Craig
This SF.net email is sponsored by
Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Thanks for your message, I didn't know about the recent improvements to relative pathnames for exporting and embedding. That makes things much better.
I do disagree with you about relative paths fixing issues 1 & 2 though, It solves issue 3 perfectly (having to respecify pathnames when exporting after the svg has moved), but it doesn't help at all with 1 & 2.
Just to restate more concisely:
Problem 1: For selecting a directory in an inkscape extension, the best available widget I have found is a textbox, meaning the user has to type it in. I think the extension interface is important to inkscape, and it's not just developers and command-line whizzes that use it, people would find it more consistent and user-friendly to be able to select a directory visually.
Problem 2: Even with the cool relative paths for exporting, etc., there is still no improvement for extension developers. They still don't know where the file lives, and still can't use relative paths for partial exporting, etc. I just tried passing through a relative pathname to my extension, and it then exports the file to the location of the script, not the SVG file. Maybe I'm doing something wrong?
Thanks, Craig
On 16 August 2010 22:18, Bryan Hoyt | Brush Technology <bryan@...2310...> wrote:
I believe relative paths are the solution to #1 & #2. I've been quite pleased with the recent changes to Inkscape that allow useful relative paths in the export dialog -- previously, relative paths were taken to be relative to the CWD, which could be different any time you run Inkscape, different on different machines or for different users, etc, etc. Now, relative paths are taken to be relative to the document's path. Works like a charm! Makes it very convenient to move the file, or zip up a project folder to send to other people, or use an SVG file in a repository. I believe both export hints & image references use the same logic now, IIRC. One feature which might help with all this is for any file chooser dialog (including for extensions) to return the pathname as a relative path when it makes sense. - Bryan
On Mon, Aug 16, 2010 at 22:56, Craig Marshall <craig9@...400...> wrote:
Hi,
I'd like to make a couple of requests for features (or perhaps explanations/pointers to why they can't be included).
- It would be really cool to have a proper directory selection (or
popup directory chooser) as an option on the inkex dialog. This way the user doesn't have to memorise their favourite directories etc., they can browse to them, or use favourites, etc.
- Someone on #inkscape mentioned that the filename/directory
information was excluded from the SVG for security reasons, but this class of information is still freely included in the form of export hints. It's inconsistent for one, and inconvenient for another. I've just been developing an extension where it would have been much nicer to export the necessary files to the same directory by default. A possible workaround if 1) is ever implemented, would be to optionally default the directory chooser to the drawing's working directory, thereby bypassing the security problem.
- Possibly related to 2. Whenever I export a document from inkscape,
then move the file (I have a bunch of folders/hierarchies and the files move depending on various states), if I then need to export again, I have to tell it where to export to, and it's a bit of a pain, it would be nice for an option to always export to the working directory.
Thanks, Craig
This SF.net email is sponsored by
Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
-- PS. Check out the Brush newsletter: Subscribe or read our previous newsletters
Bryan Hoyt, Web Development Manager -- Brush Technology Ph: +64 3 942 7833 Mobile: +64 21 238 7955 Web: brush.co.nz
Oops, I'm creating confusion. I meant to say that relative paths are the solution to #2 & #3. You're right, #1 isn't fixed at all.
Regarding #2, I see what you're saying now. You're suggestion of defaulting the file-chooser to the drawing's working directory is good one. I think an even better solution would be to default the extension's CWD to the drawing's working directory. Then the extension script could choose to open the file-chooser in that directory by default.
That solution would also help matters before somebody implements a file-chooser -- you just specify a relative path (or filename with no path) in the text input box. The extension script would almost always do the "Right Thing" without any special code.
It strikes me this would be a relatively simple & worthwhile change to Inkscape (though I don't know how complicated the relevant code is). Who is familiar with that part the codebase?
- Bryan
On Wed, Aug 18, 2010 at 08:34, Craig Marshall <craig9@...400...> wrote:
Thanks for your message, I didn't know about the recent improvements to relative pathnames for exporting and embedding. That makes things much better.
I do disagree with you about relative paths fixing issues 1 & 2 though, It solves issue 3 perfectly (having to respecify pathnames when exporting after the svg has moved), but it doesn't help at all with 1 & 2.
Just to restate more concisely:
Problem 1: For selecting a directory in an inkscape extension, the best available widget I have found is a textbox, meaning the user has to type it in. I think the extension interface is important to inkscape, and it's not just developers and command-line whizzes that use it, people would find it more consistent and user-friendly to be able to select a directory visually.
Problem 2: Even with the cool relative paths for exporting, etc., there is still no improvement for extension developers. They still don't know where the file lives, and still can't use relative paths for partial exporting, etc. I just tried passing through a relative pathname to my extension, and it then exports the file to the location of the script, not the SVG file. Maybe I'm doing something wrong?
Thanks, Craig
On 16 August 2010 22:18, Bryan Hoyt | Brush Technology <bryan@...2310...> wrote:
I believe relative paths are the solution to #1 & #2. I've been quite pleased with the recent changes to Inkscape that allow useful relative paths in the export dialog -- previously, relative paths were taken to be relative to the CWD, which could be different any time
you
run Inkscape, different on different machines or for different users,
etc,
etc. Now, relative paths are taken to be relative to the document's path. Works like a charm! Makes it very convenient to move the file, or zip up
a
project folder to send to other people, or use an SVG file in a
repository.
I believe both export hints & image references use the same logic now,
IIRC.
One feature which might help with all this is for any file chooser dialog (including for extensions) to return the pathname as a relative path when
it
makes sense.
- Bryan
On Mon, Aug 16, 2010 at 22:56, Craig Marshall <craig9@...400...> wrote:
Hi,
I'd like to make a couple of requests for features (or perhaps explanations/pointers to why they can't be included).
- It would be really cool to have a proper directory selection (or
popup directory chooser) as an option on the inkex dialog. This way the user doesn't have to memorise their favourite directories etc., they can browse to them, or use favourites, etc.
- Someone on #inkscape mentioned that the filename/directory
information was excluded from the SVG for security reasons, but this class of information is still freely included in the form of export hints. It's inconsistent for one, and inconvenient for another. I've just been developing an extension where it would have been much nicer to export the necessary files to the same directory by default. A possible workaround if 1) is ever implemented, would be to optionally default the directory chooser to the drawing's working directory, thereby bypassing the security problem.
- Possibly related to 2. Whenever I export a document from inkscape,
then move the file (I have a bunch of folders/hierarchies and the files move depending on various states), if I then need to export again, I have to tell it where to export to, and it's a bit of a pain, it would be nice for an option to always export to the working directory.
Thanks, Craig
This SF.net email is sponsored by
Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
-- PS. Check out the Brush newsletter: Subscribe or read our previous newsletters
Bryan Hoyt, Web Development Manager -- Brush Technology Ph: +64 3 942 7833 Mobile: +64 21 238 7955 Web: brush.co.nz
In addition - I think it would be a good default behaviour (for ease of moving files, and as a side effect, to make the relatives path feature blatantly obvious), for the export bitmap screen to show only the filename and no absolute path. (e.g. myfile.png, rather than /users/foo/Desktop/myfile.png, for example).
Cheers, Craig
On 17 August 2010 22:16, Bryan Hoyt | Brush Technology <bryan@...2310...> wrote:
Oops, I'm creating confusion. I meant to say that relative paths are the solution to #2 & #3. You're right, #1 isn't fixed at all. Regarding #2, I see what you're saying now. You're suggestion of defaulting the file-chooser to the drawing's working directory is good one. I think an even better solution would be to default the extension's CWD to the drawing's working directory. Then the extension script could choose to open the file-chooser in that directory by default. That solution would also help matters before somebody implements a file-chooser -- you just specify a relative path (or filename with no path) in the text input box. The extension script would almost always do the "Right Thing" without any special code. It strikes me this would be a relatively simple & worthwhile change to Inkscape (though I don't know how complicated the relevant code is). Who is familiar with that part the codebase? - Bryan On Wed, Aug 18, 2010 at 08:34, Craig Marshall <craig9@...400...> wrote:
Thanks for your message, I didn't know about the recent improvements to relative pathnames for exporting and embedding. That makes things much better.
I do disagree with you about relative paths fixing issues 1 & 2 though, It solves issue 3 perfectly (having to respecify pathnames when exporting after the svg has moved), but it doesn't help at all with 1 & 2.
Just to restate more concisely:
Problem 1: For selecting a directory in an inkscape extension, the best available widget I have found is a textbox, meaning the user has to type it in. I think the extension interface is important to inkscape, and it's not just developers and command-line whizzes that use it, people would find it more consistent and user-friendly to be able to select a directory visually.
Problem 2: Even with the cool relative paths for exporting, etc., there is still no improvement for extension developers. They still don't know where the file lives, and still can't use relative paths for partial exporting, etc. I just tried passing through a relative pathname to my extension, and it then exports the file to the location of the script, not the SVG file. Maybe I'm doing something wrong?
Thanks, Craig
On 16 August 2010 22:18, Bryan Hoyt | Brush Technology <bryan@...2310...> wrote:
I believe relative paths are the solution to #1 & #2. I've been quite pleased with the recent changes to Inkscape that allow useful relative paths in the export dialog -- previously, relative paths were taken to be relative to the CWD, which could be different any time you run Inkscape, different on different machines or for different users, etc, etc. Now, relative paths are taken to be relative to the document's path. Works like a charm! Makes it very convenient to move the file, or zip up a project folder to send to other people, or use an SVG file in a repository. I believe both export hints & image references use the same logic now, IIRC. One feature which might help with all this is for any file chooser dialog (including for extensions) to return the pathname as a relative path when it makes sense. - Bryan
On Mon, Aug 16, 2010 at 22:56, Craig Marshall <craig9@...400...> wrote:
Hi,
I'd like to make a couple of requests for features (or perhaps explanations/pointers to why they can't be included).
- It would be really cool to have a proper directory selection (or
popup directory chooser) as an option on the inkex dialog. This way the user doesn't have to memorise their favourite directories etc., they can browse to them, or use favourites, etc.
- Someone on #inkscape mentioned that the filename/directory
information was excluded from the SVG for security reasons, but this class of information is still freely included in the form of export hints. It's inconsistent for one, and inconvenient for another. I've just been developing an extension where it would have been much nicer to export the necessary files to the same directory by default. A possible workaround if 1) is ever implemented, would be to optionally default the directory chooser to the drawing's working directory, thereby bypassing the security problem.
- Possibly related to 2. Whenever I export a document from inkscape,
then move the file (I have a bunch of folders/hierarchies and the files move depending on various states), if I then need to export again, I have to tell it where to export to, and it's a bit of a pain, it would be nice for an option to always export to the working directory.
Thanks, Craig
This SF.net email is sponsored by
Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
-- PS. Check out the Brush newsletter: Subscribe or read our previous newsletters
Bryan Hoyt, Web Development Manager -- Brush Technology Ph: +64 3 942 7833 Mobile: +64 21 238 7955 Web: brush.co.nz
-- PS. Check out the Brush newsletter: Subscribe or read our previous newsletters
Bryan Hoyt, Web Development Manager -- Brush Technology Ph: +64 3 942 7833 Mobile: +64 21 238 7955 Web: brush.co.nz
Agreed.
On Wed, Aug 18, 2010 at 10:05, Craig Marshall <craig9@...400...> wrote:
In addition - I think it would be a good default behaviour (for ease of moving files, and as a side effect, to make the relatives path feature blatantly obvious), for the export bitmap screen to show only the filename and no absolute path. (e.g. myfile.png, rather than /users/foo/Desktop/myfile.png, for example).
Cheers, Craig
On 17 August 2010 22:16, Bryan Hoyt | Brush Technology <bryan@...2310...> wrote:
Oops, I'm creating confusion. I meant to say that relative paths are the solution to #2 & #3. You're right, #1 isn't fixed at all. Regarding #2, I see what you're saying now. You're suggestion of
defaulting
the file-chooser to the drawing's working directory is good one. I think
an
even better solution would be to default the extension's CWD to the drawing's working directory. Then the extension script could choose to
open
the file-chooser in that directory by default. That solution would also help matters before somebody implements a file-chooser -- you just specify a relative path (or filename with no
path)
in the text input box. The extension script would almost always do the "Right Thing" without any special code. It strikes me this would be a relatively simple & worthwhile change to Inkscape (though I don't know how complicated the relevant code is). Who
is
familiar with that part the codebase?
- Bryan
On Wed, Aug 18, 2010 at 08:34, Craig Marshall <craig9@...400...> wrote:
Thanks for your message, I didn't know about the recent improvements to relative pathnames for exporting and embedding. That makes things much better.
I do disagree with you about relative paths fixing issues 1 & 2 though, It solves issue 3 perfectly (having to respecify pathnames when exporting after the svg has moved), but it doesn't help at all with 1 & 2.
Just to restate more concisely:
Problem 1: For selecting a directory in an inkscape extension, the best available widget I have found is a textbox, meaning the user has to type it in. I think the extension interface is important to inkscape, and it's not just developers and command-line whizzes that use it, people would find it more consistent and user-friendly to be able to select a directory visually.
Problem 2: Even with the cool relative paths for exporting, etc., there is still no improvement for extension developers. They still don't know where the file lives, and still can't use relative paths for partial exporting, etc. I just tried passing through a relative pathname to my extension, and it then exports the file to the location of the script, not the SVG file. Maybe I'm doing something wrong?
Thanks, Craig
On 16 August 2010 22:18, Bryan Hoyt | Brush Technology <bryan@...2310...> wrote:
I believe relative paths are the solution to #1 & #2. I've been quite pleased with the recent changes to Inkscape that allow useful relative paths in the export dialog -- previously, relative
paths
were taken to be relative to the CWD, which could be different any
time
you run Inkscape, different on different machines or for different users, etc, etc. Now, relative paths are taken to be relative to the document's path. Works like a charm! Makes it very convenient to move the file, or zip
up
a project folder to send to other people, or use an SVG file in a repository. I believe both export hints & image references use the same logic now, IIRC. One feature which might help with all this is for any file chooser dialog (including for extensions) to return the pathname as a relative path when it makes sense.
- Bryan
On Mon, Aug 16, 2010 at 22:56, Craig Marshall <craig9@...400...>
wrote:
Hi,
I'd like to make a couple of requests for features (or perhaps explanations/pointers to why they can't be included).
- It would be really cool to have a proper directory selection (or
popup directory chooser) as an option on the inkex dialog. This way the user doesn't have to memorise their favourite directories etc., they can browse to them, or use favourites, etc.
- Someone on #inkscape mentioned that the filename/directory
information was excluded from the SVG for security reasons, but this class of information is still freely included in the form of export hints. It's inconsistent for one, and inconvenient for another. I've just been developing an extension where it would have been much nicer to export the necessary files to the same directory by default. A possible workaround if 1) is ever implemented, would be to optionally default the directory chooser to the drawing's working directory, thereby bypassing the security problem.
- Possibly related to 2. Whenever I export a document from inkscape,
then move the file (I have a bunch of folders/hierarchies and the files move depending on various states), if I then need to export again, I have to tell it where to export to, and it's a bit of a
pain,
it would be nice for an option to always export to the working directory.
Thanks, Craig
This SF.net email is sponsored by
Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
-- PS. Check out the Brush newsletter: Subscribe or read our previous newsletters
Bryan Hoyt, Web Development Manager -- Brush Technology Ph: +64 3 942 7833 Mobile: +64 21 238 7955 Web: brush.co.nz
-- PS. Check out the Brush newsletter: Subscribe or read our previous newsletters
Bryan Hoyt, Web Development Manager -- Brush Technology Ph: +64 3 942 7833 Mobile: +64 21 238 7955 Web: brush.co.nz
Hi,
I requested the following a week or so ago:
- It would be really cool to have a proper directory selection (or
popup directory chooser) as an option on the inkex dialog. This way the user doesn't have to memorise their favourite directories etc., they can browse to them, or use favourites, etc.
The idea would be to make it easy for extension developers to export files and so on to a useful directory. As there's still no directory widget on the extension GUI (and making one is probably beyond my abilities at the moment), and there's also no document path available in the SVG anymore..., I think I have come up with a simpler, but still reasonable solution:
I've made a small patch (attached) that sends a "--docbase" argument (the directory of the current SVG file) through to the extension (similarly to the way the --id arguments are sent for selected objects), this allows exporting and stuff to happen without the user having to type a directory into a textbox (a tedious job).
Note: If the current inkscape document hasn't been saved, then of course there is no directory to send through. The inkex.py file will usefully default --docbase to ~, which should work on all platforms when used with python's os.path.expanduser() function. (I'm sure there are similar functions within perl, but I refuse to look them up, perl code is bad for your eyes)
Can perhaps someone with more experience here tell me whether my patch here is a reasonable way to do this, and whether this could safely be commited?
Thanks, Craig
PS: Is this kind of thing best sent to the devel mailing list like this, or should I open/reply to a bug in launchpad and attach a patch there?
On Aug 28, 2010, at 1:23 PM, Craig Marshall wrote:
I've made a small patch (attached) that sends a "--docbase" argument (the directory of the current SVG file) through to the extension (similarly to the way the --id arguments are sent for selected objects), this allows exporting and stuff to happen without the user having to type a directory into a textbox (a tedious job).
Interesting. I'll have to consider some of the consequences, but it does seem to be helpful.
On Aug 28, 2010, at 1:23 PM, Craig Marshall wrote:
The idea would be to make it easy for extension developers to export files and so on to a useful directory. As there's still no directory widget on the extension GUI (and making one is probably beyond my abilities at the moment), and there's also no document path available in the SVG anymore..., I think I have come up with a simpler, but still reasonable solution:
A folder/file path data type does seem to be reasonable, so I'll take a look at the GUI side of things.
That's great - thanks very much.
Craig
On 29 August 2010 01:02, Jon Cruz <jon@...18...> wrote:
On Aug 28, 2010, at 1:23 PM, Craig Marshall wrote:
The idea would be to make it easy for extension developers to export files and so on to a useful directory. As there's still no directory widget on the extension GUI (and making one is probably beyond my abilities at the moment), and there's also no document path available in the SVG anymore..., I think I have come up with a simpler, but still reasonable solution:
A folder/file path data type does seem to be reasonable, so I'll take a look at the GUI side of things.
participants (3)
-
Bryan Hoyt | Brush Technology
-
Craig Marshall
-
Jon Cruz