[QGIS Commit] r15745 - in trunk/qgis/src: app ui
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sun Apr 17 09:23:23 EDT 2011
Author: alexbruy
Date: 2011-04-17 06:23:23 -0700 (Sun, 17 Apr 2011)
New Revision: 15745
Modified:
trunk/qgis/src/app/qgsrasterlayerproperties.cpp
trunk/qgis/src/app/qgsrasterlayerproperties.h
trunk/qgis/src/ui/qgsrasterlayerpropertiesbase.ui
Log:
disable Build Pyramids button if no pyramids levels selected. Also reset progressbar state after building pyramids
Modified: trunk/qgis/src/app/qgsrasterlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsrasterlayerproperties.cpp 2011-04-17 11:21:45 UTC (rev 15744)
+++ trunk/qgis/src/app/qgsrasterlayerproperties.cpp 2011-04-17 13:23:23 UTC (rev 15745)
@@ -91,6 +91,8 @@
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 @@
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::dataChanged( int change )
{
QgsDebugMsg( "entered." );
-}
\ No newline at end of file
+}
+
+void QgsRasterLayerProperties::toggleBuildPyramidsButton()
+{
+ if ( lbxPyramidResolutions->selectedItems().empty() )
+ {
+ buttonBuildPyramids->setEnabled( false );
+ }
+ else
+ {
+ buttonBuildPyramids->setEnabled( true );
+ }
+}
+
Modified: trunk/qgis/src/app/qgsrasterlayerproperties.h
===================================================================
--- trunk/qgis/src/app/qgsrasterlayerproperties.h 2011-04-17 11:21:45 UTC (rev 15744)
+++ trunk/qgis/src/app/qgsrasterlayerproperties.h 2011-04-17 13:23:23 UTC (rev 15745)
@@ -149,6 +149,8 @@
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:
Modified: trunk/qgis/src/ui/qgsrasterlayerpropertiesbase.ui
===================================================================
--- trunk/qgis/src/ui/qgsrasterlayerpropertiesbase.ui 2011-04-17 11:21:45 UTC (rev 15744)
+++ trunk/qgis/src/ui/qgsrasterlayerpropertiesbase.ui 2011-04-17 13:23:23 UTC (rev 15745)
@@ -1846,6 +1846,9 @@
</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>
More information about the QGIS-commit
mailing list