Skip to content
Permalink
Browse files

add progress indication when layers are loaded from projects

git-svn-id: http://svn.osgeo.org/qgis/trunk@10673 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Apr 28, 2009
1 parent 5329e67 commit 2ac7ace44f07562ddc4967201d1eeeac22a3bc37
Showing with 18 additions and 2 deletions.
  1. +6 −1 src/app/qgisapp.cpp
  2. +5 −1 src/core/qgsproject.cpp
  3. +7 −0 src/core/qgsproject.h
@@ -1555,6 +1555,8 @@ void QgisApp::setupConnections()
connect( QgsProject::instance(), SIGNAL( oldProjectVersionWarning( QString ) ),
this, SLOT( oldProjectVersionWarning( QString ) ) );

connect( QgsProject::instance(), SIGNAL( layerLoaded( int, int ) ), this, SLOT( showProgress( int, int ) ) );

}
void QgisApp::createCanvas()
{
@@ -3182,7 +3184,6 @@ void QgisApp::fileOpen()
} // QgisApp::fileOpen



/**
adds a saved project to qgis, usually called on startup by specifying a
project file on the command line
@@ -3191,6 +3192,8 @@ bool QgisApp::addProject( QString projectFile )
{
mMapCanvas->freeze( true );

QApplication::setOverrideCursor( Qt::WaitCursor );

// clear the map canvas
removeAllLayers();

@@ -3254,6 +3257,8 @@ bool QgisApp::addProject( QString projectFile )
return false;
}

QApplication::restoreOverrideCursor();

mMapCanvas->freeze( false );
mMapCanvas->refresh();
return true;
@@ -642,7 +642,7 @@ static QgsProjectVersion _getVersion( QDomDocument const &doc )
</maplayer>
*/
static std::pair< bool, std::list<QDomNode> > _getMapLayers( QDomDocument const &doc )
std::pair< bool, std::list<QDomNode> > QgsProject::_getMapLayers( QDomDocument const &doc )
{
// Layer order is implicit in the order they are stored in the project file

@@ -671,6 +671,8 @@ static std::pair< bool, std::list<QDomNode> > _getMapLayers( QDomDocument const

bool returnStatus = true;

emit layerLoaded( 0, nl.count() );

for ( int i = 0; i < nl.count(); i++ )
{
QDomNode node = nl.item( i );
@@ -715,6 +717,8 @@ static std::pair< bool, std::list<QDomNode> > _getMapLayers( QDomDocument const

brokenNodes.push_back( node );
}

emit layerLoaded( i + 1, nl.count() );
}

return make_pair( returnStatus, brokenNodes );
@@ -266,6 +266,11 @@ class CORE_EXPORT QgsProject : public QObject
//! emitted when an old project file is read.
void oldProjectVersionWarning( QString );

//! emitted when a layer from a projects was read
// @param i current layer
// @param n number of layers
void layerLoaded( int i, int n );

private:

QgsProject(); // private 'cause it's a singleton
@@ -279,6 +284,8 @@ class CORE_EXPORT QgsProject : public QObject

static QgsProject * theProject_;

std::pair< bool, std::list<QDomNode> > _getMapLayers( QDomDocument const &doc );

}; // QgsProject

#endif

0 comments on commit 2ac7ace

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