Added signal/slot/connector for setting the status bar message from raster layer. Will move the signal stuff up to maplayer later.

git-svn-id: http://svn.osgeo.org/qgis/trunk@1294 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
timlinux 2004-05-03 11:43:44 +00:00
parent 2b8867aac9
commit b4ce29e855
4 changed files with 23 additions and 4 deletions

View File

@ -1205,11 +1205,16 @@ bool QgisApp::addRasterLayer(QFileInfo const & rasterFile)
mapCanvas,
SLOT(refresh()));
// connect up any request the raster may make to update the app statusbar
// connect up any request the raster may make to update the app progress
QObject::connect(layer,
SIGNAL(setProgress(int,int)),
this,
SLOT(showProgress(int,int)));
SLOT(showProgress(int,int)));
// connect up any request the raster may make to update the statusbar message
QObject::connect(layer,
SIGNAL(setStatus(QString)),
this,
SLOT(showStatusMessage(QString)));
// add it to the mapcanvas collection
mapCanvas->addLayer(layer);
projectIsDirty = true;
@ -1309,7 +1314,12 @@ bool QgisApp::addRasterLayer(QStringList const &theFileNameQStringList)
SIGNAL(setProgress(int,int)),
this,
SLOT(showProgress(int,int)));
// add it to the mapcanvas collection
// connect up any request the raster may make to update the statusbar message
QObject::connect(layer,
SIGNAL(setStatus(QString)),
this,
SLOT(showStatusMessage(QString)));
// add it to the mapcanvas collection
mapCanvas->addLayer(layer);
//get the thumbnail for the layer
@ -2677,4 +2687,9 @@ void QgisApp::showExtents(QString theExtents)
{
statusBar()->message(theExtents);
}
void QgisApp::showStatusMessage(QString theMessage)
{
statusBar()->message(theMessage);
}

View File

@ -252,6 +252,7 @@ private:
public slots:
void showProgress(int theProgress, int theTotalSteps);
void showExtents(QString theExtents);
void showStatusMessage(QString theMessage);
private:
//! Widget that will live on the statusbar to display scale
QLabel * mScaleLabel;

View File

@ -1483,6 +1483,7 @@ const bool QgsRasterLayer::hasStats(int theBandNoInt)
Note that this is a cpu intensive /slow task!*/
const RasterBandStats QgsRasterLayer::getRasterBandStats(int theBandNoInt)
{
emit setStatus(QString("Calculating stats for ")+layerName);
//reset the main app progress bar
emit setProgress(0,0);
#ifdef QGISDEBUG
@ -1681,7 +1682,7 @@ emit setProgress(0,0);
myRasterBandStats.statsGatheredFlag = true;
//add this band to the class stats map
rasterStatsVector[theBandNoInt - 1] = myRasterBandStats;
emit setProgress(0,0); //reset progress
emit setProgress(rasterYDimInt, rasterYDimInt); //reset progress
return myRasterBandStats;
} //end of getRasterBandStats

View File

@ -694,6 +694,8 @@ signals:
/** \brief emit a signal to notify of a progress event */
void setProgress(int theProgress, int theTotalSteps);
/** \brief emit a signal to be caught by gisapp and display a msg on status bar */
void setStatus(QString theStatusQString);
public slots:
/** \brief Create 3 gdal pyramid overviews (2,4,8) for this layer.