Skip to content

Commit

Permalink
disable Build Pyramids button if no pyramids levels selected. Also re…
Browse files Browse the repository at this point in the history
…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 9c8ff01
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/app/qgsrasterlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ) );

Expand Down Expand Up @@ -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() )
{
Expand Down Expand Up @@ -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 );
}
}

2 changes: 2 additions & 0 deletions src/app/qgsrasterlayerproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
3 changes: 3 additions & 0 deletions src/ui/qgsrasterlayerpropertiesbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 9c8ff01

Please sign in to comment.