[QGIS Commit] r14452 - in trunk/qgis: python/gui src/app src/gui

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Oct 30 05:33:01 EDT 2010


Author: wonder
Date: 2010-10-30 02:33:01 -0700 (Sat, 30 Oct 2010)
New Revision: 14452

Modified:
   trunk/qgis/python/gui/qgisinterface.sip
   trunk/qgis/src/app/qgisappinterface.cpp
   trunk/qgis/src/gui/qgisinterface.h
Log:
Added new project and project read signals to the qgis interface (#3160).
Contributed by Alexander Bruy - thanks!


Modified: trunk/qgis/python/gui/qgisinterface.sip
===================================================================
--- trunk/qgis/python/gui/qgisinterface.sip	2010-10-29 22:12:42 UTC (rev 14451)
+++ trunk/qgis/python/gui/qgisinterface.sip	2010-10-30 09:33:01 UTC (rev 14452)
@@ -277,5 +277,26 @@
     /**This signal is emitted when QGIS' initialization is complete 
        @note added in version 1.6*/ 
     void initializationCompleted(); 
+
+    /** emitted when a project file is successfully read
+        @note
+        This is useful for plug-ins that store properties with project files.  A
+        plug-in can connect to this signal.  When it is emitted, the plug-in
+        knows to then check the project properties for any relevant state.
+
+        Added in v1.6
+     */
+    void projectRead();
+    /** emitted when starting an entirely new project
+        @note
+        This is similar to projectRead(); plug-ins might want to be notified
+        that they're in a new project.  Yes, projectRead() could have been
+        overloaded to be used in the case of new projects instead.  However,
+        it's probably more semantically correct to have an entirely separate
+        signal for when this happens.
+
+        Added in v1.6
+      */
+     void newProjectCreated();
 };
 

Modified: trunk/qgis/src/app/qgisappinterface.cpp
===================================================================
--- trunk/qgis/src/app/qgisappinterface.cpp	2010-10-29 22:12:42 UTC (rev 14451)
+++ trunk/qgis/src/app/qgisappinterface.cpp	2010-10-30 09:33:01 UTC (rev 14452)
@@ -52,6 +52,10 @@
            this, SIGNAL( composerWillBeRemoved( QgsComposerView* ) ) );
   connect( qgis, SIGNAL( initializationCompleted() ),
            this, SIGNAL( initializationCompleted() ) );
+  connect( qgis, SIGNAL( newProject() ),
+           this, SIGNAL( newProjectCreated() ) );
+  connect( qgis, SIGNAL( projectRead() ),
+           this, SIGNAL( projectRead() ) );
 }
 
 QgisAppInterface::~QgisAppInterface()

Modified: trunk/qgis/src/gui/qgisinterface.h
===================================================================
--- trunk/qgis/src/gui/qgisinterface.h	2010-10-29 22:12:42 UTC (rev 14451)
+++ trunk/qgis/src/gui/qgisinterface.h	2010-10-30 09:33:01 UTC (rev 14452)
@@ -322,6 +322,27 @@
     /**This signal is emitted when the initialization is complete
        @note added in version 1.6*/
     void initializationCompleted();
+    /** emitted when a project file is successfully read
+        @note
+        This is useful for plug-ins that store properties with project files.  A
+        plug-in can connect to this signal.  When it is emitted, the plug-in
+        knows to then check the project properties for any relevant state.
+
+        Added in v1.6
+     */
+    void projectRead();
+    /** emitted when starting an entirely new project
+        @note
+        This is similar to projectRead(); plug-ins might want to be notified
+        that they're in a new project.  Yes, projectRead() could have been
+        overloaded to be used in the case of new projects instead.  However,
+        it's probably more semantically correct to have an entirely separate
+        signal for when this happens.
+
+        Added in v1.6
+      */
+     void newProjectCreated();
+
 };
 
 // FIXME: also in core/qgis.h



More information about the QGIS-commit mailing list