Skip to content

Commit 4ea3099

Browse files
author
timlinux
committedNov 15, 2010
Fix broken behaviour in raster props dialog for reset original null value
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14681 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

3 files changed

+65
-52
lines changed

3 files changed

+65
-52
lines changed
 

‎src/app/qgsrasterlayerproperties.cpp

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,20 +1177,6 @@ void QgsRasterLayerProperties::apply()
11771177
/*
11781178
* Transparent Pixel Tab
11791179
*/
1180-
//If reset NoDataValue is checked do this first, will ignore what ever is in the LineEdit
1181-
if ( mRasterLayerIsGdal && chkboxResetNoDataValue->isChecked() )
1182-
{
1183-
mRasterLayer->resetNoDataValue();
1184-
if ( mRasterLayer->isNoDataValueValid() )
1185-
{
1186-
leNoDataValue->insert( QString::number( mRasterLayer->noDataValue(), 'f' ) );
1187-
}
1188-
else
1189-
{
1190-
leNoDataValue->clear();
1191-
}
1192-
chkboxResetNoDataValue->setChecked( false );
1193-
}
11941180

11951181
//set NoDataValue
11961182
bool myDoubleOk = false;
@@ -3030,3 +3016,20 @@ void QgsPixelSelectorTool::canvasReleaseEvent( QMouseEvent* theMouseEvent )
30303016
{
30313017
emit pixelSelected( theMouseEvent->x( ), theMouseEvent->y( ) );
30323018
}
3019+
3020+
void QgsRasterLayerProperties::on_btnResetNull_clicked( )
3021+
{
3022+
//If reset NoDataValue is checked do this first, will ignore what ever is in the LineEdit
3023+
if ( mRasterLayerIsGdal )
3024+
{
3025+
mRasterLayer->resetNoDataValue();
3026+
if ( mRasterLayer->isNoDataValueValid() )
3027+
{
3028+
leNoDataValue->setText( QString::number( mRasterLayer->noDataValue(), 'f' ) );
3029+
}
3030+
else
3031+
{
3032+
leNoDataValue->clear();
3033+
}
3034+
}
3035+
}

‎src/app/qgsrasterlayerproperties.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
8686
void on_rbtnThreeBandMinMax_toggled( bool );
8787
/** \brief slot executed when the three band standard deviation radio button is pressed. */
8888
void on_rbtnThreeBandStdDev_toggled( bool );
89+
/** \brief slot executed when the reset null value to file default icon is selected */
90+
void on_btnResetNull_clicked( );
8991

9092
void pixelSelected( int x, int y );
9193
/** \brief this slot clears min max values from gui */

‎src/ui/qgsrasterlayerpropertiesbase.ui

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>755</width>
10-
<height>654</height>
10+
<height>667</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -28,15 +28,15 @@
2828
<item row="0" column="0" colspan="4">
2929
<widget class="QTabWidget" name="tabBar">
3030
<property name="currentIndex">
31-
<number>4</number>
31+
<number>1</number>
3232
</property>
3333
<property name="iconSize">
3434
<size>
3535
<width>32</width>
3636
<height>32</height>
3737
</size>
3838
</property>
39-
<widget class="QWidget" name="tabPageSymbology" native="true">
39+
<widget class="QWidget" name="tabPageSymbology">
4040
<attribute name="icon">
4141
<iconset resource="../../images/images.qrc">
4242
<normaloff>:/images/themes/default/propertyicons/symbology.png</normaloff>:/images/themes/default/propertyicons/symbology.png</iconset>
@@ -921,7 +921,7 @@
921921
</item>
922922
</layout>
923923
</widget>
924-
<widget class="QWidget" name="tabBarPage2" native="true">
924+
<widget class="QWidget" name="tabBarPage2">
925925
<attribute name="icon">
926926
<iconset resource="../../images/images.qrc">
927927
<normaloff>:/images/themes/default/propertyicons/transparency.png</normaloff>:/images/themes/default/propertyicons/transparency.png</iconset>
@@ -1014,25 +1014,6 @@
10141014
</layout>
10151015
</widget>
10161016
</item>
1017-
<item row="0" column="1">
1018-
<widget class="QGroupBox" name="gboxNoDataValue">
1019-
<property name="title">
1020-
<string>No data value</string>
1021-
</property>
1022-
<layout class="QVBoxLayout">
1023-
<item>
1024-
<widget class="QLineEdit" name="leNoDataValue"/>
1025-
</item>
1026-
<item>
1027-
<widget class="QCheckBox" name="chkboxResetNoDataValue">
1028-
<property name="text">
1029-
<string>Reset no data value</string>
1030-
</property>
1031-
</widget>
1032-
</item>
1033-
</layout>
1034-
</widget>
1035-
</item>
10361017
<item row="1" column="0" colspan="2">
10371018
<widget class="QGroupBox" name="gboxCustomTransparency">
10381019
<property name="title">
@@ -1207,9 +1188,35 @@
12071188
</layout>
12081189
</widget>
12091190
</item>
1191+
<item row="0" column="1">
1192+
<widget class="QGroupBox" name="gboxNoDataValue">
1193+
<property name="title">
1194+
<string>No data value</string>
1195+
</property>
1196+
<layout class="QGridLayout" name="gridLayout_5">
1197+
<item row="0" column="0">
1198+
<widget class="QLineEdit" name="leNoDataValue"/>
1199+
</item>
1200+
<item row="0" column="1">
1201+
<widget class="QToolButton" name="btnResetNull">
1202+
<property name="toolTip">
1203+
<string>Reset to file defined null</string>
1204+
</property>
1205+
<property name="text">
1206+
<string>...</string>
1207+
</property>
1208+
<property name="icon">
1209+
<iconset resource="../../images/images.qrc">
1210+
<normaloff>:/images/themes/default/mActionDraw.png</normaloff>:/images/themes/default/mActionDraw.png</iconset>
1211+
</property>
1212+
</widget>
1213+
</item>
1214+
</layout>
1215+
</widget>
1216+
</item>
12101217
</layout>
12111218
</widget>
1212-
<widget class="QWidget" name="tabPageColormap" native="true">
1219+
<widget class="QWidget" name="tabPageColormap">
12131220
<attribute name="icon">
12141221
<iconset resource="../../images/images.qrc">
12151222
<normaloff>:/images/themes/default/propertyicons/colormap.png</normaloff>:/images/themes/default/propertyicons/colormap.png</iconset>
@@ -1418,7 +1425,7 @@
14181425
</item>
14191426
</layout>
14201427
</widget>
1421-
<widget class="QWidget" name="tabBarPage4" native="true">
1428+
<widget class="QWidget" name="tabBarPage4">
14221429
<attribute name="icon">
14231430
<iconset resource="../../images/images.qrc">
14241431
<normaloff>:/images/themes/default/propertyicons/general.png</normaloff>:/images/themes/default/propertyicons/general.png</iconset>
@@ -1709,7 +1716,7 @@
17091716
</item>
17101717
</layout>
17111718
</widget>
1712-
<widget class="QWidget" name="tabPageMetadata" native="true">
1719+
<widget class="QWidget" name="tabPageMetadata">
17131720
<attribute name="icon">
17141721
<iconset resource="../../images/images.qrc">
17151722
<normaloff>:/images/themes/default/propertyicons/metadata.png</normaloff>:/images/themes/default/propertyicons/metadata.png</iconset>
@@ -1726,7 +1733,7 @@
17261733
</item>
17271734
</layout>
17281735
</widget>
1729-
<widget class="QWidget" name="tabPagePyramids" native="true">
1736+
<widget class="QWidget" name="tabPagePyramids">
17301737
<attribute name="icon">
17311738
<iconset resource="../../images/images.qrc">
17321739
<normaloff>:/images/themes/default/propertyicons/pyramids.png</normaloff>:/images/themes/default/propertyicons/pyramids.png</iconset>
@@ -1764,19 +1771,20 @@
17641771
<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;
17651772
&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;
17661773
p, li { white-space: pre-wrap; }
1767-
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
1774+
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
17681775
&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;
17691776
&lt;tr&gt;
17701777
&lt;td style=&quot;border: none;&quot;&gt;
1771-
&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;
1772-
&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;
1773-
&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;
1774-
&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;
1775-
&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;
1776-
&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;
1777-
&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;
1778-
&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;
1779-
&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;
1778+
&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;
1779+
&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;
1780+
&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;
1781+
&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;
1782+
&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;
1783+
&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;
1784+
&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;
1785+
&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;
1786+
&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;
1787+
&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;
17801788
&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>
17811789
</property>
17821790
</widget>
@@ -1844,7 +1852,7 @@ p, li { white-space: pre-wrap; }
18441852
</item>
18451853
</layout>
18461854
</widget>
1847-
<widget class="QWidget" name="tabPageHistogram" native="true">
1855+
<widget class="QWidget" name="tabPageHistogram">
18481856
<attribute name="icon">
18491857
<iconset resource="../../images/images.qrc">
18501858
<normaloff>:/images/themes/default/propertyicons/histogram.png</normaloff>:/images/themes/default/propertyicons/histogram.png</iconset>

0 commit comments

Comments
 (0)
Please sign in to comment.