@@ -162,14 +162,14 @@ rasterLayer( dynamic_cast<QgsRasterLayer*>(lyr) )
162
162
cboGreen->insertItem (" Blue" );
163
163
cboBlue->insertItem (" Blue" );
164
164
165
- cboRed->insertItem (tr (" Not Set " ));
166
- cboGreen->insertItem (tr (" Not Set " ));
167
- cboBlue->insertItem (tr (" Not Set " ));
165
+ cboRed->insertItem (tr (QgsRasterLayer::QSTRING_NOT_SET ));
166
+ cboGreen->insertItem (tr (QgsRasterLayer::QSTRING_NOT_SET ));
167
+ cboBlue->insertItem (tr (QgsRasterLayer::QSTRING_NOT_SET ));
168
168
169
169
cboGray->insertItem (" Red" );
170
170
cboGray->insertItem (" Green" );
171
171
cboGray->insertItem (" Blue" );
172
- cboGray->insertItem (tr (" Not Set " ));
172
+ cboGray->insertItem (tr (QgsRasterLayer::QSTRING_NOT_SET ));
173
173
174
174
lstHistogramLabels->insertItem (tr (" Palette" ));
175
175
}
@@ -269,15 +269,15 @@ rasterLayer( dynamic_cast<QgsRasterLayer*>(lyr) )
269
269
cboBlue->insertItem (myQString);
270
270
}
271
271
// TODO: Need to handle situations where a band is set to Not Set, currently if you set a band to this it will segfault.
272
- cboRed->insertItem (tr (" Not Set " ));
273
- cboGreen->insertItem (tr (" Not Set " ));
274
- cboBlue->insertItem (tr (" Not Set " ));
272
+ cboRed->insertItem (tr (QgsRasterLayer::QSTRING_NOT_SET ));
273
+ cboGreen->insertItem (tr (QgsRasterLayer::QSTRING_NOT_SET ));
274
+ cboBlue->insertItem (tr (QgsRasterLayer::QSTRING_NOT_SET ));
275
275
if (cboGray->count () != 1 )
276
- cboGray->insertItem (tr (" Not Set " ));
276
+ cboGray->insertItem (tr (QgsRasterLayer::QSTRING_NOT_SET ));
277
277
}
278
278
279
- cboxTransparencyBand->insertItem (tr (" Not Set " ));
280
- cboxTransparencyLayer->insertItem (tr (" Not Set " ));
279
+ cboxTransparencyBand->insertItem (tr (QgsRasterLayer::QSTRING_NOT_SET ));
280
+ cboxTransparencyLayer->insertItem (tr (QgsRasterLayer::QSTRING_NOT_SET ));
281
281
std::map<QString, QgsMapLayer *> myLayers = QgsMapLayerRegistry::instance ()->mapLayers ();
282
282
std::map<QString, QgsMapLayer *>::iterator it;
283
283
for (it = myLayers.begin (); it != myLayers.end (); it++)
@@ -599,22 +599,22 @@ void QgsRasterLayerProperties::sync()
599
599
rbtnThreeBandMinMax->setChecked (false );
600
600
}
601
601
602
- if (QgsRasterLayer::PALETTED_COLOR != rasterLayer->getDrawingStyle () &&
602
+ if (QgsRasterLayer::PALETTED_COLOR != rasterLayer->getDrawingStyle () &&
603
603
QgsRasterLayer::PALETTED_SINGLE_BAND_GRAY != rasterLayer->getDrawingStyle () &&
604
604
QgsRasterLayer::PALETTED_SINGLE_BAND_PSEUDO_COLOR != rasterLayer->getDrawingStyle () &&
605
605
QgsRasterLayer::PALETTED_MULTI_BAND_COLOR != rasterLayer->getDrawingStyle ())
606
606
{
607
- if (rasterLayer->getRedBandName () != tr (" Not Set " ))
607
+ if (rasterLayer->getRedBandName () != tr (QgsRasterLayer::QSTRING_NOT_SET ))
608
608
{
609
609
leRedMin->setText (QString::number (rasterLayer->getMinimumValue (rasterLayer->getRedBandName ())));
610
610
leRedMax->setText (QString::number (rasterLayer->getMaximumValue (rasterLayer->getRedBandName ())));
611
611
}
612
- if (rasterLayer->getGreenBandName () != tr (" Not Set " ))
612
+ if (rasterLayer->getGreenBandName () != tr (QgsRasterLayer::QSTRING_NOT_SET ))
613
613
{
614
614
leGreenMin->setText (QString::number (rasterLayer->getMinimumValue (rasterLayer->getGreenBandName ())));
615
615
leGreenMax->setText (QString::number (rasterLayer->getMaximumValue (rasterLayer->getGreenBandName ())));
616
616
}
617
- if (rasterLayer->getBlueBandName () != tr (" Not Set " ))
617
+ if (rasterLayer->getBlueBandName () != tr (QgsRasterLayer::QSTRING_NOT_SET ))
618
618
{
619
619
leBlueMin->setText (QString::number (rasterLayer->getMinimumValue (rasterLayer->getBlueBandName ())));
620
620
leBlueMax->setText (QString::number (rasterLayer->getMaximumValue (rasterLayer->getBlueBandName ())));
@@ -641,7 +641,7 @@ if(QgsRasterLayer::PALETTED_COLOR != rasterLayer->getDrawingStyle() &&
641
641
QgsRasterLayer::PALETTED_SINGLE_BAND_PSEUDO_COLOR != rasterLayer->getDrawingStyle () &&
642
642
QgsRasterLayer::PALETTED_MULTI_BAND_COLOR != rasterLayer->getDrawingStyle ())
643
643
{
644
- if (rasterLayer->getGrayBandName () != tr (" Not Set " ))
644
+ if (rasterLayer->getGrayBandName () != tr (QgsRasterLayer::QSTRING_NOT_SET ))
645
645
{
646
646
leGrayMin->setText (QString::number (rasterLayer->getMinimumValue (rasterLayer->getGrayBandName ())));
647
647
leGrayMax->setText (QString::number (rasterLayer->getMaximumValue (rasterLayer->getGrayBandName ())));
@@ -685,7 +685,7 @@ if(QgsRasterLayer::PALETTED_COLOR != rasterLayer->getDrawingStyle() &&
685
685
}
686
686
else
687
687
{
688
- cboxTransparencyLayer->setCurrentIndex (cboxTransparencyLayer->findText (tr (" Not Set " )));
688
+ cboxTransparencyLayer->setCurrentIndex (cboxTransparencyLayer->findText (tr (QgsRasterLayer::QSTRING_NOT_SET )));
689
689
}
690
690
691
691
myIndex = cboxTransparencyBand->findText (rasterLayer->getTransparentBandName ());
@@ -695,7 +695,7 @@ if(QgsRasterLayer::PALETTED_COLOR != rasterLayer->getDrawingStyle() &&
695
695
}
696
696
else
697
697
{
698
- cboxTransparencyBand->setCurrentIndex (cboxTransparencyBand->findText (tr (" Not Set " )));
698
+ cboxTransparencyBand->setCurrentIndex (cboxTransparencyBand->findText (tr (QgsRasterLayer::QSTRING_NOT_SET )));
699
699
}
700
700
// add current NoDataValue to NoDataValue line edit
701
701
if (rasterLayer->isNoDataValueValid ())
@@ -1059,17 +1059,17 @@ void QgsRasterLayerProperties::apply()
1059
1059
// Set min max based on user defined values if all are set and stdDev is 0.0
1060
1060
if (rbtnThreeBandMinMax->isEnabled () && rbtnThreeBandMinMax->isChecked () && validUserDefinedMinMax ())
1061
1061
{
1062
- if (rasterLayer->getRedBandName () != tr (" Not Set " ))
1062
+ if (rasterLayer->getRedBandName () != tr (QgsRasterLayer::QSTRING_NOT_SET ))
1063
1063
{
1064
1064
rasterLayer->setMinimumValue (cboRed->currentText (), leRedMin->text ().toDouble (), false );
1065
1065
rasterLayer->setMaximumValue (cboRed->currentText (), leRedMax->text ().toDouble ());
1066
1066
}
1067
- if (rasterLayer->getGreenBandName () != tr (" Not Set " ))
1067
+ if (rasterLayer->getGreenBandName () != tr (QgsRasterLayer::QSTRING_NOT_SET ))
1068
1068
{
1069
1069
rasterLayer->setMinimumValue (cboGreen->currentText (), leGreenMin->text ().toDouble (), false );
1070
1070
rasterLayer->setMaximumValue (cboGreen->currentText (), leGreenMax->text ().toDouble ());
1071
1071
}
1072
- if (rasterLayer->getBlueBandName () != tr (" Not Set " ))
1072
+ if (rasterLayer->getBlueBandName () != tr (QgsRasterLayer::QSTRING_NOT_SET ))
1073
1073
{
1074
1074
rasterLayer->setMinimumValue (cboBlue->currentText (), leBlueMin->text ().toDouble (), false );
1075
1075
rasterLayer->setMaximumValue (cboBlue->currentText (), leBlueMax->text ().toDouble ());
@@ -1093,7 +1093,7 @@ void QgsRasterLayerProperties::apply()
1093
1093
// Set min max based on user defined values if all are set and stdDev is 0.0
1094
1094
if (rbtnSingleBandMinMax->isEnabled () && rbtnSingleBandMinMax->isChecked () && validUserDefinedMinMax ())
1095
1095
{
1096
- if (rasterLayer->getGrayBandName () != tr (" Not Set " ))
1096
+ if (rasterLayer->getGrayBandName () != tr (QgsRasterLayer::QSTRING_NOT_SET ))
1097
1097
{
1098
1098
rasterLayer->setMinimumValue (cboGray->currentText (), leGrayMin->text ().toDouble (), false );
1099
1099
rasterLayer->setMaximumValue (cboGray->currentText (), leGrayMax->text ().toDouble ());
@@ -1411,17 +1411,17 @@ void QgsRasterLayerProperties::apply()
1411
1411
1412
1412
if (rbtnThreeBandMinMax->isEnabled ())
1413
1413
{
1414
- if (rasterLayer->getRedBandName () != tr (" Not Set " ))
1414
+ if (rasterLayer->getRedBandName () != tr (QgsRasterLayer::QSTRING_NOT_SET ))
1415
1415
{
1416
1416
leRedMin->setText (QString::number (rasterLayer->getMinimumValue (rasterLayer->getRedBandName ())));
1417
1417
leRedMax->setText (QString::number (rasterLayer->getMaximumValue (rasterLayer->getRedBandName ())));
1418
1418
}
1419
- if (rasterLayer->getGreenBandName () != tr (" Not Set " ))
1419
+ if (rasterLayer->getGreenBandName () != tr (QgsRasterLayer::QSTRING_NOT_SET ))
1420
1420
{
1421
1421
leGreenMin->setText (QString::number (rasterLayer->getMinimumValue (rasterLayer->getGreenBandName ())));
1422
1422
leGreenMax->setText (QString::number (rasterLayer->getMaximumValue (rasterLayer->getGreenBandName ())));
1423
1423
}
1424
- if (rasterLayer->getBlueBandName () != tr (" Not Set " ))
1424
+ if (rasterLayer->getBlueBandName () != tr (QgsRasterLayer::QSTRING_NOT_SET ))
1425
1425
{
1426
1426
leBlueMin->setText (QString::number (rasterLayer->getMinimumValue (rasterLayer->getBlueBandName ())));
1427
1427
leBlueMax->setText (QString::number (rasterLayer->getMaximumValue (rasterLayer->getBlueBandName ())));
@@ -1437,7 +1437,7 @@ void QgsRasterLayerProperties::apply()
1437
1437
1438
1438
if (rbtnSingleBandMinMax->isEnabled ())
1439
1439
{
1440
- if (rasterLayer->getGrayBandName () != tr (" Not Set " ))
1440
+ if (rasterLayer->getGrayBandName () != tr (QgsRasterLayer::QSTRING_NOT_SET ))
1441
1441
{
1442
1442
leGrayMin->setText (QString::number (rasterLayer->getMinimumValue (rasterLayer->getGrayBandName ())));
1443
1443
leGrayMax->setText (QString::number (rasterLayer->getMaximumValue (rasterLayer->getGrayBandName ())));
@@ -1549,7 +1549,7 @@ void QgsRasterLayerProperties::on_buttonBuildPyramids_clicked()
1549
1549
1550
1550
void QgsRasterLayerProperties::on_cboBlue_currentIndexChanged (const QString& theText)
1551
1551
{
1552
- if (tr (" Not Set " ) != theText)
1552
+ if (tr (QgsRasterLayer::QSTRING_NOT_SET ) != theText)
1553
1553
{
1554
1554
leBlueMin->setText (QString::number (rasterLayer->getMinimumValue (theText)));
1555
1555
leBlueMax->setText (QString::number (rasterLayer->getMaximumValue (theText)));
@@ -1558,7 +1558,7 @@ void QgsRasterLayerProperties::on_cboBlue_currentIndexChanged(const QString& the
1558
1558
1559
1559
void QgsRasterLayerProperties::on_cboGray_currentIndexChanged (const QString& theText)
1560
1560
{
1561
- if (tr (" Not Set " ) != theText)
1561
+ if (tr (QgsRasterLayer::QSTRING_NOT_SET ) != theText)
1562
1562
{
1563
1563
leGrayMin->setText (QString::number (rasterLayer->getMinimumValue (theText)));
1564
1564
leGrayMax->setText (QString::number (rasterLayer->getMaximumValue (theText)));
@@ -1567,7 +1567,7 @@ void QgsRasterLayerProperties::on_cboGray_currentIndexChanged(const QString& the
1567
1567
1568
1568
void QgsRasterLayerProperties::on_cboGreen_currentIndexChanged (const QString& theText)
1569
1569
{
1570
- if (tr (" Not Set " ) != theText)
1570
+ if (tr (QgsRasterLayer::QSTRING_NOT_SET ) != theText)
1571
1571
{
1572
1572
leGreenMin->setText (QString::number (rasterLayer->getMinimumValue (theText)));
1573
1573
leGreenMax->setText (QString::number (rasterLayer->getMaximumValue (theText)));
@@ -1576,7 +1576,7 @@ void QgsRasterLayerProperties::on_cboGreen_currentIndexChanged(const QString& th
1576
1576
1577
1577
void QgsRasterLayerProperties::on_cboRed_currentIndexChanged (const QString& theText)
1578
1578
{
1579
- if (tr (" Not Set " ) != theText)
1579
+ if (tr (QgsRasterLayer::QSTRING_NOT_SET ) != theText)
1580
1580
{
1581
1581
leRedMin->setText (QString::number (rasterLayer->getMinimumValue (theText)));
1582
1582
leRedMax->setText (QString::number (rasterLayer->getMaximumValue (theText)));
@@ -1659,10 +1659,10 @@ void QgsRasterLayerProperties::on_cboxColorMap_currentIndexChanged(const QString
1659
1659
1660
1660
void QgsRasterLayerProperties::on_cboxTransparencyLayer_currentIndexChanged (const QString& theText)
1661
1661
{
1662
- if (theText == tr (" Not Set " ))
1662
+ if (theText == tr (QgsRasterLayer::QSTRING_NOT_SET ))
1663
1663
{
1664
1664
cboxTransparencyBand->clear ();
1665
- cboxTransparencyBand->insertItem (tr (" Not Set " ));
1665
+ cboxTransparencyBand->insertItem (tr (QgsRasterLayer::QSTRING_NOT_SET ));
1666
1666
}
1667
1667
else
1668
1668
{
@@ -1675,7 +1675,7 @@ void QgsRasterLayerProperties::on_cboxTransparencyLayer_currentIndexChanged(cons
1675
1675
QgsRasterLayer* myRasterLayer = (QgsRasterLayer*)it->second ;
1676
1676
int myBandCount = myRasterLayer->getBandCount ();
1677
1677
cboxTransparencyBand->clear ();
1678
- cboxTransparencyBand->insertItem (tr (" Not Set " ));
1678
+ cboxTransparencyBand->insertItem (tr (QgsRasterLayer::QSTRING_NOT_SET ));
1679
1679
for (int bandRunner = 1 ; bandRunner <= myBandCount; bandRunner++)
1680
1680
{
1681
1681
cboxTransparencyBand->insertItem (myRasterLayer->getRasterBandName (bandRunner));
@@ -2376,7 +2376,7 @@ void QgsRasterLayerProperties::on_rbtnSingleBand_toggled(bool b)
2376
2376
// Populate transparency table with single value transparency pixels
2377
2377
populateTransparencyTable ();
2378
2378
// If no band is selected but there are multiple bands, selcet the first as the default
2379
- if (cboGray->currentText () == tr (" Not Set " ) && 1 < cboGray->count ())
2379
+ if (cboGray->currentText () == tr (QgsRasterLayer::QSTRING_NOT_SET ) && 1 < cboGray->count ())
2380
2380
{
2381
2381
cboGray->setCurrentIndex (0 );
2382
2382
}
0 commit comments