← Back to team overview

kicad-developers team mailing list archive

Patch: Open Datasheet in Project Dir

 

Hi KiCad Developers,

I'd like to put datasheets of components under my project dir at
${KIPRJMOD}/Datasheets/, and in the component editor dialog, simply add
"Datasheets/my-component.pdf". Like this:
[image: Inline images 1]

The "Show Datasheet" button is handy but doesn't support relative path. It
will open my browser with url literally "Datasheets/my-component.pdf", thus
is invalid.

So I made a patch to resolve the path before it is passed to
"wxLaunchDefaultBrowser()". If it looks like a URL or is an absolute path,
doesn't do anything; but if it is a relative path, append "${KIPRJMOD}" to
it.

Tested and the button now works with the relative path.
"wxLaunchDefaultBrowser()" is smart enough to open it with my default PDF
viewer. Also tested "http://www.google.com"; and "https://www.google.com";
just for sanity check.

Let me know what you think or if my patch is not doing the resolution in
the proper position. Thanks.

Regards,
Cheng

PNG image

Attachment: datasheet.patch
Description: Binary data


Follow ups