Thanks for the feedback Barry.<div><br></div><div>I did have a look at your code when I started working on the auto save layer thing. I didn't take that approach as I didn't think relying on <meta http-equiv="content-type" content="text/html; charset=utf-8">renderComplete would work with saving layers. In my mind I would like QGIS to check for a auto save every N minutes even if I'm not pan or rendering a map, say I'm setting up a tool or messing with the composer. Or I leave my workstation and forget to save (of course auto saving is not an excuse for being lazy and not hitting the save button).</div>
<div><br></div><div>I am able to add a check in the timeout method that will check to see if the layer is modified and if it's not then don't bother saving. Could even reset the timer for that layer if the person saves the layer manually. That way we don't get a save check right after a manual save.</div>
<div><br></div><div>Thoughts?</div><div><br></div><div>- Nathan</div><div><br><div class="gmail_quote">On Sat, Sep 17, 2011 at 7:58 PM, Barry Rowlingson <span dir="ltr"><<a href="mailto:b.rowlingson@lancaster.ac.uk">b.rowlingson@lancaster.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">On Sat, Sep 17, 2011 at 6:10 AM, Nathan Woodrow <<a href="mailto:madmanwoo@gmail.com">madmanwoo@gmail.com</a>> wrote:<br>
> Hi All,<br>
<div class="im"><br>
> After that a timer fires at the interval and saves the layer for you. I<br>
> thought a per-layer auto save feature is better then a blanket auto save for<br>
> all as it gives the user more control.<br>
<br>
</div> I wrote a plugin that autosaves projects (not layers) - instead of<br>
firing a timer off I added a signal handler to the renderComplete<br>
signal that checks to see if the project had been saved in the past N<br>
minutes. If not, then the autosave happens.<br>
<br>
This means that the system isn't saving pointless changes every N<br>
minutes if nothing has happened, and there's no possibility of<br>
multiple timer events queueing up. It also means if the user has just<br>
saved the project manually then the autosave doesn't bother doing it<br>
again within N minutes.<br>
<br>
Obviously it relies on renderComplete signals being emitted but these<br>
happen every time you do almost anything that changes the project.<br>
<br>
Code is on google code for your perusal:<br>
<a href="http://code.google.com/p/bsrplugins/source/browse/#svn%2Ftrunk%2Fautosave" target="_blank">http://code.google.com/p/bsrplugins/source/browse/#svn%2Ftrunk%2Fautosave</a><br>
<br>
+1 for layer autosaves from me!<br>
<font color="#888888"><br>
Barry<br>
</font></blockquote></div><br></div>