search path

Post your question about installing or upgrading QCAD version 3

Moderator: andrew

search path

Postby khad » Wed Dec 04, 2013 1:04 pm

The pace of progress qcad makes is simply amazing - just downloaded 3.4.4 and checked selection filtering, great! (just a small glitch: grips are drawn also for entities on hidden layers).
However, I started to customize the interface a little to my needs, and with each new version, I have to edit / overwrite files in quite a couple of places.
I did not find a setting for a search path, so is there a way to put customized scripts etc. anywhere to give them precedence over the shipped versions?
khad
Newbie Member
 
Posts: 9
Joined: Wed Nov 06, 2013 12:28 pm

Re: search path

Postby andrew » Wed Dec 04, 2013 2:29 pm

khad wrote:just a small glitch: grips are drawn also for entities on hidden layers


Thanks. Bug report at:
http://www.qcad.org/bugtracker/index.ph ... ask_id=982

khad wrote:However, I started to customize the interface a little to my needs, and with each new version, I have to edit / overwrite files in quite a couple of places.


Would it be possible to integrate those customizations into QCAD (possibly as user preferences)?

khad wrote:I did not find a setting for a search path, so is there a way to put customized scripts etc. anywhere to give them precedence over the shipped versions?


It's not possible to 'override' scripts that are shipped with QCAD. What you can do instead is to disable the original script in a postInit function of your script:

function postInit() {
// hide original tool:
var a = RGuiAction.getByScriptFile("scripts/Path/To/Original/Tool/Tool.js");
a.setVisible(false);
}


In init, your script would add an implementation of your own tool to the GUI as usual.
User avatar
andrew
Site Admin
 
Posts: 2756
Joined: Fri Mar 30, 2007 6:07 am

Re: search path

Postby khad » Wed Dec 04, 2013 4:10 pm

Thanks for the swift answer - I would never have figured this out myself...
My dumb solution was to create a "qcad-current" link to point to the latest version, and a "qcad-custom" directory to hold customized files. Then I edited the include statements in the scripts to point to qcad-current, and edited QCAD3.conf to load the customized scripts instead of the original ones... not sure this would survive an update, though.

But what about other support files, e.g. hatches and linetypes? (btw, where are linetypes defined?) If you added .pat files (many found on internet could not be distributed with qcad) to the patterns folder, it would be nice to not have to repeat this for each release.

PS: I will of course share when I think I got something worthwhile, at the moment I'm just fiddling with .ui files to maximize viewport area a bit (I use a netbook quite often).
khad
Newbie Member
 
Posts: 9
Joined: Wed Nov 06, 2013 12:28 pm


Return to QCAD 3 Installation and Upgrades

Who is online

Users browsing this forum: No registered users and 1 guest