Skip to content
Permalink
Browse files

Added new project and project read signals to the qgis interface (#3160

…).

Contributed by Alexander Bruy - thanks!


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14452 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Oct 30, 2010
1 parent 6b14503 commit 7c827f624ed8d618f6169f8de0fe9624d5b379c0
Showing with 46 additions and 0 deletions.
  1. +21 −0 python/gui/qgisinterface.sip
  2. +4 −0 src/app/qgisappinterface.cpp
  3. +21 −0 src/gui/qgisinterface.h
@@ -277,5 +277,26 @@ class QgisInterface : QObject
/**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();
};

@@ -52,6 +52,10 @@ QgisAppInterface::QgisAppInterface( QgisApp * _qgis )
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()
@@ -322,6 +322,27 @@ class GUI_EXPORT QgisInterface : public QObject
/**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

0 comments on commit 7c827f6

Please sign in to comment.
You can’t perform that action at this time.