Binary file added python/plugins/fTools/icons/gis/merge_shapes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions python/plugins/fTools/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
<file>icons/gis/delaunay.png</file>
<file>icons/gis/layer_extent.png</file>
<file>icons/gis/voronoi.png</file>
<file>icons/gis/merge_shapes.png</file>
<file>icons/default/voronoi.png</file>
</qresource>
</RCC>
4 changes: 1 addition & 3 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ SET(QGIS_APP_SRCS
)

IF (ANDROID)
SET(QGIS_APP_SRCS
SET(QGIS_APP_SRCS
${QGIS_APP_SRCS}
qtmain_android.cpp
)
Expand Down Expand Up @@ -331,11 +331,9 @@ ENDIF (POSTGRES_FOUND)
IF (HAVE_SPATIALITE)
SET (QGIS_APP_SRCS ${QGIS_APP_SRCS}
spatialite/qgsnewspatialitelayerdialog.cpp
spatialite/qgsspatialitesridsdialog.cpp
)
SET (QGIS_APP_MOC_HDRS ${QGIS_APP_MOC_HDRS}
spatialite/qgsnewspatialitelayerdialog.h
spatialite/qgsspatialitesridsdialog.h
)
ENDIF (HAVE_SPATIALITE)

Expand Down
10 changes: 6 additions & 4 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ static void customSrsValidation_( QgsCoordinateReferenceSystem* srs )
mySelector->setSelectedCrsId( defaultCrs.srsid() );
}

QApplication::setOverrideCursor( Qt::ArrowCursor );
// why is this: it overrides the default cursor in the splitter in the dialog
// commenting it now till somebody tells us why it is neccesary :-)
//QApplication::setOverrideCursor( Qt::ArrowCursor );

if ( mySelector->exec() )
{
Expand All @@ -354,7 +356,7 @@ static void customSrsValidation_( QgsCoordinateReferenceSystem* srs )
srs->createFromOgcWmsCrs( mySelector->selectedAuthId() );
}

QApplication::restoreOverrideCursor();
//QApplication::restoreOverrideCursor();

delete mySelector;
}
Expand Down Expand Up @@ -2869,8 +2871,8 @@ void QgisApp::fileSaveAs()
QString lastUsedDir = settings.value( "/UI/lastProjectDir", "." ).toString();

std::auto_ptr<QFileDialog> saveFileDialog( new QFileDialog( this,
tr( "Choose a file name to save the QGIS project file as" ),
lastUsedDir, tr( "QGis files (*.qgs)" ) ) );
tr( "Choose a file name to save the QGIS project file as" ),
lastUsedDir, tr( "QGis files (*.qgs)" ) ) );
saveFileDialog->setFileMode( QFileDialog::AnyFile );
saveFileDialog->setAcceptMode( QFileDialog::AcceptSave );
saveFileDialog->setConfirmOverwrite( true );
Expand Down
65 changes: 38 additions & 27 deletions src/app/qgsrasterlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
leMinimumScale->setValidator( new QDoubleValidator( 0, std::numeric_limits<float>::max(), 1000, this ) );
leMaximumScale->setText( QString::number( lyr->maximumScale(), 'f' ) );
leMaximumScale->setValidator( new QDoubleValidator( 0, std::numeric_limits<float>::max(), 1000, this ) );
leNoDataValue->setValidator( new QDoubleValidator( -std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), 1000, this ) );
leNoDataValue->setValidator( new QDoubleValidator( -std::numeric_limits<double>::max(), std::numeric_limits<double>::max(), 1000, this ) );

leRedMin->setValidator( new QDoubleValidator( this ) );
leRedMax->setValidator( new QDoubleValidator( this ) );
Expand Down Expand Up @@ -325,7 +325,8 @@ void QgsRasterLayerProperties::populateTransparencyTable()
//Clear existing color transparency list
//NOTE: May want to just tableTransparency->clearContents() and fill back in after checking to be sure list and table are the same size
QString myNumberFormatter;
if ( rbtnThreeBand->isChecked() &&
if ( tabPageSymbology &&
rbtnThreeBand->isChecked() &&
QgsRasterLayer::PalettedColor != mRasterLayer->drawingStyle() &&
QgsRasterLayer::PalettedMultiBandColor != mRasterLayer->drawingStyle() )
{
Expand Down Expand Up @@ -385,7 +386,7 @@ void QgsRasterLayerProperties::populateTransparencyTable()
for ( int myListRunner = 0; myListRunner < myTransparentSingleValuePixelList.count(); myListRunner++ )
{
tableTransparency->insertRow( myListRunner );
QTableWidgetItem* myGrayItem = new QTableWidgetItem( myNumberFormatter.sprintf( "%.2f", myTransparentSingleValuePixelList[myListRunner].pixelValue ) );
QTableWidgetItem* myGrayItem = new QTableWidgetItem( myNumberFormatter.sprintf( "%g", myTransparentSingleValuePixelList[myListRunner].pixelValue ) );
QTableWidgetItem* myPercentTransparentItem = new QTableWidgetItem( myNumberFormatter.sprintf( "%.2f", myTransparentSingleValuePixelList[myListRunner].percentTransparent ) );

tableTransparency->setItem( myListRunner, 0, myGrayItem );
Expand Down Expand Up @@ -786,7 +787,7 @@ void QgsRasterLayerProperties::sync()
//add current NoDataValue to NoDataValue line edit
if ( mRasterLayer->isNoDataValueValid() )
{
leNoDataValue->insert( QString::number( mRasterLayer->noDataValue(), 'f' ) );
leNoDataValue->insert( QString::number( mRasterLayer->noDataValue(), 'g' ) );
}
else
{
Expand Down Expand Up @@ -882,35 +883,45 @@ void QgsRasterLayerProperties::syncColormapTab()
return;
}

if ( QgsRasterLayer::ColorRampShader != mRasterLayer->colorShadingAlgorithm() )
QgsDebugMsg( QString( "colorShadingAlgorithm = %1" ).arg( mRasterLayer->colorShadingAlgorithmAsString() ) );
if ( QgsRasterLayer::ColorRampShader == mRasterLayer->colorShadingAlgorithm() )
{
return;
}

QgsColorRampShader* myRasterShaderFunction = ( QgsColorRampShader* )mRasterLayer->rasterShader()->rasterShaderFunction();
if ( !myRasterShaderFunction )
{
return;
}
//restore the colormap tab if layer has custom symbology
populateColorMapTable( myRasterShaderFunction->colorRampItemList() );
QgsColorRampShader* myRasterShaderFunction = ( QgsColorRampShader* )mRasterLayer->rasterShader()->rasterShaderFunction();
if ( myRasterShaderFunction )
{
//restore the colormap tab if layer has custom symbology
populateColorMapTable( myRasterShaderFunction->colorRampItemList() );

sboxNumberOfEntries->setValue( mColormapTreeWidget->topLevelItemCount() );
sboxNumberOfEntries->setValue( mColormapTreeWidget->topLevelItemCount() );

//restor state of 'color interpolation' combo box
if ( QgsColorRampShader::INTERPOLATED == myRasterShaderFunction->colorRampType() )
{
cboxColorInterpolation->setCurrentIndex( cboxColorInterpolation->findText( tr( "Linear" ) ) );
}
else if ( QgsColorRampShader::DISCRETE == myRasterShaderFunction->colorRampType() )
{
cboxColorInterpolation->setCurrentIndex( cboxColorInterpolation->findText( tr( "Discrete" ) ) );
//restor state of 'color interpolation' combo box
if ( QgsColorRampShader::INTERPOLATED == myRasterShaderFunction->colorRampType() )
{
cboxColorInterpolation->setCurrentIndex( cboxColorInterpolation->findText( tr( "Linear" ) ) );
}
else if ( QgsColorRampShader::DISCRETE == myRasterShaderFunction->colorRampType() )
{
cboxColorInterpolation->setCurrentIndex( cboxColorInterpolation->findText( tr( "Discrete" ) ) );
}
else
{
cboxColorInterpolation->setCurrentIndex( cboxColorInterpolation->findText( tr( "Exact" ) ) );
}
}
}
else
{
cboxColorInterpolation->setCurrentIndex( cboxColorInterpolation->findText( tr( "Exact" ) ) );
//load default color table if any so that user can return to it if previously switched to different shader, PseudoColorShader or FreakOutShader for example
// It would be better however to restore possibly previously modified color table
QgsDebugMsg( "use default color table" );
QList<QgsColorRampShader::ColorRampItem> myColorRampList;
if ( mRasterLayer->readColorTable( 1, &myColorRampList ) )
{
populateColorMapTable( myColorRampList );
// INTERPOLATED is used as default for Palette raster type
cboxColorInterpolation->setCurrentIndex( cboxColorInterpolation->findText( tr( "Linear" ) ) );
}
}

}

bool QgsRasterLayerProperties::validUserDefinedMinMax()
Expand Down Expand Up @@ -3071,7 +3082,7 @@ void QgsRasterLayerProperties::on_btnResetNull_clicked( )
mRasterLayer->resetNoDataValue();
if ( mRasterLayer->isNoDataValueValid() )
{
leNoDataValue->setText( QString::number( mRasterLayer->noDataValue(), 'f' ) );
leNoDataValue->setText( QString::number( mRasterLayer->noDataValue(), 'g' ) );
}
else
{
Expand Down
10 changes: 10 additions & 0 deletions src/app/qgstipfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,16 @@ QgsTipFactory::QgsTipFactory() : QObject()
" Page</a> for more details."
) );
addGenericTip( myTip );
// by gsherman
myTip.setTitle( tr( "Quantum GIS has Plugins!" ) );
myTip.setContent( tr( "Quantum GIS has plugins that extend its functionality."
" QGIS ships with some core plugins you can explore from the"
" Plugins->Manage Plugins menu. In addition there are over 150"
" Python plugins contributed by the user community that can be"
" installed from the Plugins->Fetch Python Plugins menu."
" Don't miss out on all QGIS has to offer---check out the"
" plugins and see what they can do for you." ) );
addGenericTip( myTip );

/* Template for adding more tips
myTip.setTitle(tr(""));
Expand Down
77 changes: 67 additions & 10 deletions src/app/spatialite/qgsnewspatialitelayerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@

#include "qgsnewspatialitelayerdialog.h"

#include "qgsspatialitesridsdialog.h"
#include "qgis.h"
#include "qgsapplication.h"
#include "qgsproviderregistry.h"
#include "qgisapp.h" // <- for theme icons
#include <qgsvectorlayer.h>
#include <qgsmaplayerregistry.h>
#include "qgscoordinatereferencesystem.h"
#include "qgsgenericprojectionselector.h"

#include "qgslogger.h"

Expand Down Expand Up @@ -72,7 +74,12 @@ QgsNewSpatialiteLayerDialog::QgsNewSpatialiteLayerDialog( QWidget *parent, Qt::W
buttonBox->button( QDialogButtonBox::Ok )->setDefault( true );

// Set the SRID box to a default of WGS84
leSRID->setText( "4326" );
QgsCoordinateReferenceSystem srs;
srs.createFromOgcWmsCrs( GEO_EPSG_CRS_AUTHID );
srs.validate();
mCrsId = srs.srsid();
leSRID->setText( srs.authid() + " - " + srs.description() );

pbnFindSRID->setEnabled( mDatabaseComboBox->count() );
}

Expand Down Expand Up @@ -176,17 +183,67 @@ void QgsNewSpatialiteLayerDialog::on_mRemoveAttributeButton_clicked()

void QgsNewSpatialiteLayerDialog::on_pbnFindSRID_clicked()
{
// set the SRID from a list returned from the selected Spatialite database
QgsSpatialiteSridsDialog *sridDlg = new QgsSpatialiteSridsDialog( this );
if ( sridDlg->load( mDatabaseComboBox->currentText() ) )
// first get list of supported SRID from the selected Spatialite database
// to build filter for projection selector
sqlite3 *db = 0;
bool status = true;
if ( !db )
{
int rc = sqlite3_open_v2( mDatabaseComboBox->currentText().toUtf8(), &db, SQLITE_OPEN_READONLY, NULL );
if ( rc != SQLITE_OK )
{
QMessageBox::warning( this, tr( "SpatiaLite Database" ), tr( "Unable to open the database" ) );
return;
}
}

// load up the srid table
const char *pzTail;
sqlite3_stmt *ppStmt;
QString sql = "select auth_srid, auth_name, ref_sys_name from spatial_ref_sys order by srid asc";

QSet<QString> myCRSs;

int rc = sqlite3_prepare( db, sql.toUtf8(), sql.toUtf8().length(), &ppStmt, &pzTail );
// XXX Need to free memory from the error msg if one is set
if ( rc == SQLITE_OK )
{
if ( sridDlg->exec() )
// get the first row of the result set
while ( sqlite3_step( ppStmt ) == SQLITE_ROW )
{
// set the srid field to the selection
leSRID->setText( sridDlg->selectedSrid() );
sridDlg->accept();
myCRSs.insert( QString::fromUtf8(( const char * )sqlite3_column_text( ppStmt, 1 ) ) +
":" + QString::fromUtf8(( const char * )sqlite3_column_text( ppStmt, 0 ) ) );
}
}
else
{
// XXX query failed -- warn the user some how
QMessageBox::warning( 0, tr( "Error" ), tr( "Failed to load SRIDS: %1" ).arg( sqlite3_errmsg( db ) ) );
status = false;
}
// close the statement
sqlite3_finalize( ppStmt );
sqlite3_close( db );

if ( !status )
{
return;
}

// prepare projection selector
QgsGenericProjectionSelector *mySelector = new QgsGenericProjectionSelector( this );
mySelector->setMessage();
mySelector->setOgcWmsCrsFilter( myCRSs );

if ( mySelector->exec() )
{
QgsCoordinateReferenceSystem srs;
srs.createFromOgcWmsCrs( mySelector->selectedAuthId() );
bool ok;
mCrsId = srs.authid().split( ':' ).at( 1 ).toInt( &ok );
leSRID->setText( srs.authid() + " - " + srs.description() );
}
delete mySelector;
}

bool QgsNewSpatialiteLayerDialog::createDb()
Expand Down Expand Up @@ -293,7 +350,7 @@ bool QgsNewSpatialiteLayerDialog::apply()
QString sqlAddGeom = QString( "select AddGeometryColumn(%1,%2,%3,%4,2)" )
.arg( quotedValue( leLayerName->text() ) )
.arg( quotedValue( leGeometryColumn->text() ) )
.arg( leSRID->text().toInt() )
.arg( mCrsId )
.arg( quotedValue( selectedType() ) );
QgsDebugMsg( sqlAddGeom ); // OK

Expand Down
2 changes: 2 additions & 0 deletions src/app/spatialite/qgsnewspatialitelayerdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class QgsNewSpatialiteLayerDialog: public QDialog, private Ui::QgsNewSpatialiteL

static QString quotedIdentifier( QString id );
static QString quotedValue( QString value );

int mCrsId;
};

#endif // QGSNEWVECTORLAYERDIALOG_H
Loading