<p dir="ltr">It could be useful (for the future) to have also a writtenProject signal, to be able to do post-saving processing. I will add a wish ticket... </p>
<p dir="ltr">giovanni </p>
<p dir="ltr">Sent from Nexus</p>
<div class="gmail_quote">Il giorno 19/nov/2012 21:09, "Tim Sutton" <<a href="mailto:lists@linfiniti.com">lists@linfiniti.com</a>> ha scritto:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi<br>
<br>
<br>
On Mon, Nov 19, 2012 at 6:31 PM, Etienne Tourigny<br>
<<a href="mailto:etourigny.dev@gmail.com">etourigny.dev@gmail.com</a>> wrote:<br>
><br>
> To load a project file call QgisInterface::actionOpenProject()<br>
<br>
<br>
Or programmatically open the project file like this:<br>
<br>
        QgsProject.instance().setFileName(myProjectPath)<br>
        QgsProject.instance().read()<br>
<br>
Regards<br>
<br>
Tim<br>
<br>
<br>
><br>
><br>
> most app-related stuff that a plugin can do are in the QgisInterface class<br>
><br>
> On a related note:<br>
> If you want the plugin to do something when a project file is loaded,<br>
> you need to connect to the QGisInterface projectRead() signal<br>
><br>
> <a href="http://www.qgis.org/api/classQgisInterface.html#af740dfa32487613224a249c8f5c2111b" target="_blank">http://www.qgis.org/api/classQgisInterface.html#af740dfa32487613224a249c8f5c2111b</a><br>
><br>
> This will ensure that when a project is loaded your code will get called.<br>
><br>
><br>
><br>
> On Mon, Nov 19, 2012 at 2:12 PM, Justin Hubbard<br>
> <<a href="mailto:justin@pyrotechsoftware.com">justin@pyrotechsoftware.com</a>> wrote:<br>
> > Hi<br>
> ><br>
> > I must be missing something... I have searched the API and the web, but<br>
> > cannot find out how to do this seemingly simple task<br>
> ><br>
> > I want to make my plugin automatically load a specified .qgs Project file<br>
> > into QGIS when the plugin is activated.<br>
> ><br>
> > I'm sure that I must be missing something.<br>
> > Any help appreciated<br>
> ><br>
> > Thanks<br>
> > Justin<br>
> ><br>
> > _______________________________________________<br>
> > Qgis-developer mailing list<br>
> > <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
> > <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
> ><br>
> _______________________________________________<br>
> Qgis-developer mailing list<br>
> <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
<br>
<br>
<br>
<br>
--<br>
Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)<br>
==============================================<br>
Please do not email me off-list with technical<br>
support questions. Using the lists will gain<br>
more exposure for your issues and the knowledge<br>
surrounding your issue will be shared with all.<br>
<br>
Visit <a href="http://linfiniti.com" target="_blank">http://linfiniti.com</a> to find out about:<br>
 * QGIS programming and support services<br>
 * Mapserver and PostGIS based hosting plans<br>
 * FOSS Consulting Services<br>
Skype: timlinux<br>
Irc: timlinux on #qgis at <a href="http://freenode.net" target="_blank">freenode.net</a><br>
==============================================<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div>