[SOLVED] How To: Suspend AutoSave by script

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
CVH
Premier Member
Posts: 3416
Joined: Wed Sep 27, 2017 4:17 pm

[SOLVED] How To: Suspend AutoSave by script

Post by CVH » Mon Nov 30, 2020 5:23 am

Andrew,

Is there a way to suspend AutoSave by script?

Tried to follow the AutoSave.js script ... had to include it

Code: Select all

include("scripts/File/AutoSave/AutoSave.js")
Still the methods report 'undefined'

Regards,
CVH
Last edited by CVH on Thu Dec 17, 2020 8:57 am, edited 1 time in total.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: How To: Suspend AutoSave by script

Post by andrew » Wed Dec 16, 2020 2:31 pm

You can control this through a global application wide property:

Code: Select all

var appWin = EAction.getMainWindow();
appWin.setProperty("DisableAutoSave", true);

appWin.setProperty("DisableAutoSave", false);

CVH
Premier Member
Posts: 3416
Joined: Wed Sep 27, 2017 4:17 pm

Re: How To: Suspend AutoSave by script

Post by CVH » Thu Dec 17, 2020 8:57 am

Thanks, Andrew.

Now implemented in the 'Create New subLayers from Hatches' proposition ...
And working! :D

Stumble on it while testing ... and it was reported by someone else too.
When a drawing is hard to render ...
or when a script runs slow on such a drawing ...
and AutoSave is set and to frequent short intervals ...
QCAD is spending even more time in auto saving the drawing over and over again.

Regards,
CVH

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”