Skip to content
Permalink
Browse files
disable Build Pyramids button if no pyramids levels selected. Also re…
…set progressbar state after building pyramids

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15745 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
alexbruy committed Apr 17, 2011
1 parent 338ecf8 commit 9c8ff019782e0ba30a21438a5426e6491968bd7c
@@ -91,6 +91,8 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
connect( leBlueMin, SIGNAL( textEdited( QString ) ), this, SLOT( userDefinedMinMax_textEdited( QString ) ) );
connect( leBlueMax, SIGNAL( textEdited( QString ) ), this, SLOT( userDefinedMinMax_textEdited( QString ) ) );
connect( mColormapTreeWidget, SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ), this, SLOT( handleColormapTreeWidgetDoubleClick( QTreeWidgetItem*, int ) ) );
// enable or disable Build Pyramids button depending on selection in pyramid list
connect( lbxPyramidResolutions, SIGNAL( itemSelectionChanged() ), this, SLOT( toggleBuildPyramidsButton() ) );

connect( mRasterLayer, SIGNAL( dataChanged( int ) ), this, SLOT( dataChanged( int ) ) );

@@ -1544,6 +1546,8 @@ void QgsRasterLayerProperties::on_buttonBuildPyramids_clicked()
cboResamplingMethod->currentText(),
myBuildInternalFlag );
QApplication::restoreOverrideCursor();
mPyramidProgress->setValue( 0 );
buttonBuildPyramids->setEnabled( false );
disconnect( mRasterLayer, SIGNAL( progressUpdate( int ) ), mPyramidProgress, SLOT( setValue( int ) ) );
if ( !res.isNull() )
{
@@ -3039,4 +3043,17 @@ void QgsRasterLayerProperties::on_btnResetNull_clicked( )
void QgsRasterLayerProperties::dataChanged( int change )
{
QgsDebugMsg( "entered." );
}
}

void QgsRasterLayerProperties::toggleBuildPyramidsButton()
{
if ( lbxPyramidResolutions->selectedItems().empty() )
{
buttonBuildPyramids->setEnabled( false );
}
else
{
buttonBuildPyramids->setEnabled( true );
}
}

@@ -149,6 +149,8 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
/** This slot lets you save the histogram as an image to disk */
void on_mSaveAsImageButton_clicked();
/**Enable or disable Build pyramids button depending on selection in pyramids list*/
void toggleBuildPyramidsButton();

signals:

@@ -1846,6 +1846,9 @@ p, li { white-space: pre-wrap; }
</item>
<item row="3" column="4">
<widget class="QPushButton" name="buttonBuildPyramids">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Build pyramids</string>
</property>

0 comments on commit 9c8ff01

Please sign in to comment.