Skip to content
Permalink
Browse files

Fix broken behaviour in raster props dialog for reset original null v…

…alue

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14681 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Nov 15, 2010
1 parent cc1a652 commit 4ea309962424b660a66bdfc408b6c57fd7a6e204
Showing with 65 additions and 52 deletions.
  1. +17 −14 src/app/qgsrasterlayerproperties.cpp
  2. +2 −0 src/app/qgsrasterlayerproperties.h
  3. +46 −38 src/ui/qgsrasterlayerpropertiesbase.ui
@@ -1177,20 +1177,6 @@ void QgsRasterLayerProperties::apply()
/*
* Transparent Pixel Tab
*/
//If reset NoDataValue is checked do this first, will ignore what ever is in the LineEdit
if ( mRasterLayerIsGdal && chkboxResetNoDataValue->isChecked() )
{
mRasterLayer->resetNoDataValue();
if ( mRasterLayer->isNoDataValueValid() )
{
leNoDataValue->insert( QString::number( mRasterLayer->noDataValue(), 'f' ) );
}
else
{
leNoDataValue->clear();
}
chkboxResetNoDataValue->setChecked( false );
}

//set NoDataValue
bool myDoubleOk = false;
@@ -3030,3 +3016,20 @@ void QgsPixelSelectorTool::canvasReleaseEvent( QMouseEvent* theMouseEvent )
{
emit pixelSelected( theMouseEvent->x( ), theMouseEvent->y( ) );
}

void QgsRasterLayerProperties::on_btnResetNull_clicked( )
{
//If reset NoDataValue is checked do this first, will ignore what ever is in the LineEdit
if ( mRasterLayerIsGdal )
{
mRasterLayer->resetNoDataValue();
if ( mRasterLayer->isNoDataValueValid() )
{
leNoDataValue->setText( QString::number( mRasterLayer->noDataValue(), 'f' ) );
}
else
{
leNoDataValue->clear();
}
}
}
@@ -86,6 +86,8 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
void on_rbtnThreeBandMinMax_toggled( bool );
/** \brief slot executed when the three band standard deviation radio button is pressed. */
void on_rbtnThreeBandStdDev_toggled( bool );
/** \brief slot executed when the reset null value to file default icon is selected */
void on_btnResetNull_clicked( );

void pixelSelected( int x, int y );
/** \brief this slot clears min max values from gui */
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>755</width>
<height>654</height>
<height>667</height>
</rect>
</property>
<property name="windowTitle">
@@ -28,15 +28,15 @@
<item row="0" column="0" colspan="4">
<widget class="QTabWidget" name="tabBar">
<property name="currentIndex">
<number>4</number>
<number>1</number>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<widget class="QWidget" name="tabPageSymbology" native="true">
<widget class="QWidget" name="tabPageSymbology">
<attribute name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/propertyicons/symbology.png</normaloff>:/images/themes/default/propertyicons/symbology.png</iconset>
@@ -921,7 +921,7 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tabBarPage2" native="true">
<widget class="QWidget" name="tabBarPage2">
<attribute name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/propertyicons/transparency.png</normaloff>:/images/themes/default/propertyicons/transparency.png</iconset>
@@ -1014,25 +1014,6 @@
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QGroupBox" name="gboxNoDataValue">
<property name="title">
<string>No data value</string>
</property>
<layout class="QVBoxLayout">
<item>
<widget class="QLineEdit" name="leNoDataValue"/>
</item>
<item>
<widget class="QCheckBox" name="chkboxResetNoDataValue">
<property name="text">
<string>Reset no data value</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="gboxCustomTransparency">
<property name="title">
@@ -1207,9 +1188,35 @@
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QGroupBox" name="gboxNoDataValue">
<property name="title">
<string>No data value</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QLineEdit" name="leNoDataValue"/>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="btnResetNull">
<property name="toolTip">
<string>Reset to file defined null</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionDraw.png</normaloff>:/images/themes/default/mActionDraw.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabPageColormap" native="true">
<widget class="QWidget" name="tabPageColormap">
<attribute name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/propertyicons/colormap.png</normaloff>:/images/themes/default/propertyicons/colormap.png</iconset>
@@ -1418,7 +1425,7 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tabBarPage4" native="true">
<widget class="QWidget" name="tabBarPage4">
<attribute name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/propertyicons/general.png</normaloff>:/images/themes/default/propertyicons/general.png</iconset>
@@ -1709,7 +1716,7 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tabPageMetadata" native="true">
<widget class="QWidget" name="tabPageMetadata">
<attribute name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/propertyicons/metadata.png</normaloff>:/images/themes/default/propertyicons/metadata.png</iconset>
@@ -1726,7 +1733,7 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tabPagePyramids" native="true">
<widget class="QWidget" name="tabPagePyramids">
<attribute name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/propertyicons/pyramids.png</normaloff>:/images/themes/default/propertyicons/pyramids.png</iconset>
@@ -1764,19 +1771,20 @@
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;table border=&quot;0&quot; style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
&lt;tr&gt;
&lt;td style=&quot;border: none;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;&quot;&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
@@ -1844,7 +1852,7 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
<widget class="QWidget" name="tabPageHistogram" native="true">
<widget class="QWidget" name="tabPageHistogram">
<attribute name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/propertyicons/histogram.png</normaloff>:/images/themes/default/propertyicons/histogram.png</iconset>

0 comments on commit 4ea3099

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