Skip to content
Permalink
Browse files

-Added some qsetting checks/defaults for loading colormaps and transp…

…arency files

-Fix some sorting problems with the color map editor, which may address #1497

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10173 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
ersts
ersts committed Feb 15, 2009
1 parent 993b3c6 commit 83b47ca711ecff693782d74be13c0bf4767adf96
Showing with 22 additions and 4 deletions.
  1. +22 −4 src/app/qgsrasterlayerproperties.cpp
@@ -1397,6 +1397,11 @@ void QgsRasterLayerProperties::apply()
myColorRampItems.push_back( myNewColorRampItem );
inserted = true;
}
else if ( myColorRampItems[myCurrentIndex].value > myNewColorRampItem.value )
{
myColorRampItems.insert( myCurrentIndex, myNewColorRampItem );
inserted = true;
}
else if ( myColorRampItems[myCurrentIndex].value <= myNewColorRampItem.value && myCurrentIndex == myColorRampItems.size() - 1 )
{
myColorRampItems.push_back( myNewColorRampItem );
@@ -1809,7 +1814,9 @@ void QgsRasterLayerProperties::on_pbnDefaultValues_clicked()

void QgsRasterLayerProperties::on_pbnExportTransparentPixelValues_clicked()
{
QString myFileName = QFileDialog::getSaveFileName( this, tr( "Save file" ), "/", tr( "Textfile (*.txt)" ) );
QSettings myQSettings;
QString myLastDir = myQSettings.value( "lastRasterFileFilterDir", "" ).toString();
QString myFileName = QFileDialog::getSaveFileName( this, tr( "Save file" ), myLastDir, tr( "Textfile (*.txt)" ) );
if ( !myFileName.isEmpty() )
{
if ( !myFileName.endsWith( ".txt", Qt::CaseInsensitive ) )
@@ -2267,7 +2274,9 @@ void QgsRasterLayerProperties::on_pbnImportTransparentPixelValues_clicked()
int myLineCounter = 0;
bool myImportError = false;
QString myBadLines;
QString myFileName = QFileDialog::getOpenFileName( this, tr( "Open file" ), "/", tr( "Textfile (*.txt)" ) );
QSettings myQSettings;
QString myLastDir = myQSettings.value( "lastRasterFileFilterDir", "" ).toString();
QString myFileName = QFileDialog::getOpenFileName( this, tr( "Open file" ), myLastDir, tr( "Textfile (*.txt)" ) );
QFile myInputFile( myFileName );
if ( myInputFile.open( QFile::ReadOnly ) )
{
@@ -2678,7 +2687,9 @@ void QgsRasterLayerProperties::on_pbtnAddColorMapEntry_clicked()

void QgsRasterLayerProperties::on_pbtnExportColorMapToFile_clicked()
{
QString myFileName = QFileDialog::getSaveFileName( this, tr( "Save file" ), "/", tr( "Textfile (*.txt)" ) );
QSettings myQSettings;
QString myLastDir = myQSettings.value( "lastRasterFileFilterDir", "" ).toString();
QString myFileName = QFileDialog::getSaveFileName( this, tr( "Save file" ), myLastDir, tr( "Textfile (*.txt)" ) );
if ( !myFileName.isEmpty() )
{
if ( !myFileName.endsWith( ".txt", Qt::CaseInsensitive ) )
@@ -2758,7 +2769,9 @@ void QgsRasterLayerProperties::on_pbtnLoadColorMapFromFile_clicked()
int myLineCounter = 0;
bool myImportError = false;
QString myBadLines;
QString myFileName = QFileDialog::getOpenFileName( this, tr( "Open file" ), "/", tr( "Textfile (*.txt)" ) );
QSettings myQSettings;
QString myLastDir = myQSettings.value( "lastRasterFileFilterDir", "" ).toString();
QString myFileName = QFileDialog::getOpenFileName( this, tr( "Open file" ), myLastDir, tr( "Textfile (*.txt)" ) );
QFile myInputFile( myFileName );
if ( myInputFile.open( QFile::ReadOnly ) )
{
@@ -2969,6 +2982,11 @@ void QgsRasterLayerProperties::on_pbtnSortColorMap_clicked()
myColorRampItems.push_back( myNewColorRampItem );
inserted = true;
}
else if ( myColorRampItems[myCurrentIndex].value > myNewColorRampItem.value )
{
myColorRampItems.insert( myCurrentIndex, myNewColorRampItem );
inserted = true;
}
else if ( myColorRampItems[myCurrentIndex].value <= myNewColorRampItem.value && myCurrentIndex == myColorRampItems.size() - 1 )
{
myColorRampItems.push_back( myNewColorRampItem );

0 comments on commit 83b47ca

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