1 change: 0 additions & 1 deletion src/app/composer/qgscomposermapwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class QgsComposerMapWidget: public QWidget, private Ui::QgsComposerMapWidgetBase
void on_mIntervalYSpinBox_editingFinished();
void on_mOffsetXSpinBox_editingFinished();
void on_mOffsetYSpinBox_editingFinished();
void on_mLineWidthSpinBox_valueChanged( double d );
void on_mGridLineStyleButton_clicked();
void on_mGridTypeComboBox_currentIndexChanged( const QString& text );
void on_mCrossWidthSpinBox_valueChanged( double d );
Expand Down
50 changes: 29 additions & 21 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2863,16 +2863,20 @@ void QgisApp::addDatabaseLayer()
QgsDebugMsg( "about to addRasterLayer" );

// TODO: QDialog for now, switch to QWidget in future
QDialog *pgs = dynamic_cast<QDialog*>( QgsProviderRegistry::instance()->selectWidget( QString( "postgres" ), this ) );
if ( !pgs )
QDialog *dbs = dynamic_cast<QDialog*>( QgsProviderRegistry::instance()->selectWidget( "postgres", this ) );
if ( !dbs )
{
QMessageBox::warning( this, tr( "PostgreSQL" ), tr( "Cannot get PostgreSQL select dialog from provider." ) );
return;
}
connect( pgs , SIGNAL( addDatabaseLayers( QStringList const &, QString const & ) ),
this , SLOT( addDatabaseLayers( QStringList const &, QString const & ) ) );
pgs->exec();
delete pgs;
connect( dbs, SIGNAL( addDatabaseLayers( QStringList const &, QString const & ) ),
this, SLOT( addDatabaseLayers( QStringList const &, QString const & ) ) );
connect( dbs, SIGNAL( progress( int, int ) ),
this, SLOT( showProgress( int, int ) ) );
connect( dbs, SIGNAL( progressMessage( QString ) ),
this, SLOT( showStatusMessage( QString ) ) );
dbs->exec();
delete dbs;
#endif
} // QgisApp::addDatabaseLayer()

Expand Down Expand Up @@ -2951,14 +2955,14 @@ void QgisApp::addSpatiaLiteLayer()
}

// show the SpatiaLite dialog
QDialog *dbs = dynamic_cast<QDialog*>( QgsProviderRegistry::instance()->selectWidget( QString( "spatialite" ), this ) );
QDialog *dbs = dynamic_cast<QDialog*>( QgsProviderRegistry::instance()->selectWidget( "spatialite", this ) );
if ( !dbs )
{
QMessageBox::warning( this, tr( "SpatiaLite" ), tr( "Cannot get SpatiaLite select dialog from provider." ) );
return;
}
connect( dbs , SIGNAL( addDatabaseLayers( QStringList const &, QString const & ) ),
this , SLOT( addDatabaseLayers( QStringList const &, QString const & ) ) );
connect( dbs, SIGNAL( addDatabaseLayers( QStringList const &, QString const & ) ),
this, SLOT( addDatabaseLayers( QStringList const &, QString const & ) ) );
dbs->exec();
delete dbs;
} // QgisApp::addSpatiaLiteLayer()
Expand All @@ -2972,14 +2976,14 @@ void QgisApp::addMssqlLayer()
}

// show the MSSQL dialog
QDialog *dbs = dynamic_cast<QDialog*>( QgsProviderRegistry::instance()->selectWidget( QString( "mssql" ), this ) );
QDialog *dbs = dynamic_cast<QDialog*>( QgsProviderRegistry::instance()->selectWidget( "mssql", this ) );
if ( !dbs )
{
QMessageBox::warning( this, tr( "MSSQL" ), tr( "Cannot get MSSQL select dialog from provider." ) );
return;
}
connect( dbs , SIGNAL( addDatabaseLayers( QStringList const &, QString const & ) ),
this , SLOT( addDatabaseLayers( QStringList const &, QString const & ) ) );
connect( dbs, SIGNAL( addDatabaseLayers( QStringList const &, QString const & ) ),
this, SLOT( addDatabaseLayers( QStringList const &, QString const & ) ) );
dbs->exec();
delete dbs;
#endif
Expand All @@ -2994,14 +2998,18 @@ void QgisApp::addOracleLayer()
}

// show the Oracle dialog
QDialog *dbs = dynamic_cast<QDialog*>( QgsProviderRegistry::instance()->selectWidget( QString( "oracle" ), this ) );
QDialog *dbs = dynamic_cast<QDialog*>( QgsProviderRegistry::instance()->selectWidget( "oracle", this ) );
if ( !dbs )
{
QMessageBox::warning( this, tr( "Oracle" ), tr( "Cannot get Oracle select dialog from provider." ) );
return;
}
connect( dbs , SIGNAL( addDatabaseLayers( QStringList const &, QString const & ) ),
this , SLOT( addDatabaseLayers( QStringList const &, QString const & ) ) );
connect( dbs, SIGNAL( addDatabaseLayers( QStringList const &, QString const & ) ),
this, SLOT( addDatabaseLayers( QStringList const &, QString const & ) ) );
connect( dbs, SIGNAL( progress( int, int ) ),
this, SLOT( showProgress( int, int ) ) );
connect( dbs, SIGNAL( progressMessage( QString ) ),
this, SLOT( showStatusMessage( QString ) ) );
dbs->exec();
delete dbs;
#endif
Expand All @@ -3023,8 +3031,8 @@ void QgisApp::addWmsLayer()
QMessageBox::warning( this, tr( "WMS" ), tr( "Cannot get WMS select dialog from provider." ) );
return;
}
connect( wmss , SIGNAL( addRasterLayer( QString const &, QString const &, QString const & ) ),
this , SLOT( addRasterLayer( QString const &, QString const &, QString const & ) ) );
connect( wmss, SIGNAL( addRasterLayer( QString const &, QString const &, QString const & ) ),
this, SLOT( addRasterLayer( QString const &, QString const &, QString const & ) ) );
wmss->exec();
delete wmss;
}
Expand All @@ -3044,8 +3052,8 @@ void QgisApp::addWcsLayer()
QMessageBox::warning( this, tr( "WCS" ), tr( "Cannot get WCS select dialog from provider." ) );
return;
}
connect( wcss , SIGNAL( addRasterLayer( QString const &, QString const &, QString const & ) ),
this , SLOT( addRasterLayer( QString const &, QString const &, QString const & ) ) );
connect( wcss, SIGNAL( addRasterLayer( QString const &, QString const &, QString const & ) ),
this, SLOT( addRasterLayer( QString const &, QString const &, QString const & ) ) );
wcss->exec();
delete wcss;
}
Expand All @@ -3071,8 +3079,8 @@ void QgisApp::addWfsLayer()
QMessageBox::warning( this, tr( "WFS" ), tr( "Cannot get WFS select dialog from provider." ) );
return;
}
connect( wfss , SIGNAL( addWfsLayer( QString, QString ) ),
this , SLOT( addWfsLayer( QString, QString ) ) );
connect( wfss, SIGNAL( addWfsLayer( QString, QString ) ),
this, SLOT( addWfsLayer( QString, QString ) ) );

//re-enable wfs with extent setting: pass canvas info to source select
wfss->setProperty( "MapExtent", mMapCanvas->extent().toString() );
Expand Down
953 changes: 256 additions & 697 deletions src/app/qgscustomprojectiondialog.cpp

Large diffs are not rendered by default.

63 changes: 30 additions & 33 deletions src/app/qgscustomprojectiondialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "ui_qgscustomprojectiondialogbase.h"
#include "qgscontexthelp.h"
#include "qgscoordinatereferencesystem.h"

class QDir;

Expand All @@ -34,45 +35,41 @@ class QgsCustomProjectionDialog : public QDialog, private Ui::QgsCustomProjectio
public:
QgsCustomProjectionDialog( QWidget *parent = 0, Qt::WFlags fl = 0 );
~QgsCustomProjectionDialog();
//a recursive function to make a directory and its ancestors

public slots:
void on_pbnCalculate_clicked();
void on_pbnDelete_clicked();
//
// Database navigation controles
//
long getRecordCount();
void on_pbnFirst_clicked();
void on_pbnPrevious_clicked();
void on_pbnNext_clicked();
void on_pbnLast_clicked();
void on_pbnNew_clicked();
void on_pbnSave_clicked();
void on_pbnAdd_clicked();
void on_pbnRemove_clicked();
void on_pbnCopyCRS_clicked();
void on_leNameList_currentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem *prev );

void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }

//
// Control population
//
/* These two methods will be deprecated
void getProjList();
void getEllipsoidList();
*/
QString getProjectionFamilyName( QString theProjectionFamilyAcronym );
QString getEllipsoidName( QString theEllipsoidAcronym );
QString getProjectionFamilyAcronym( QString theProjectionFamilyName );
QString getEllipsoidAcronym( QString theEllipsoidName );
void on_buttonBox_accepted();

private:
QString getProjFromParameters();
QString getEllipseFromParameters();

QString mCurrentRecordId;
long mCurrentRecordLong;
//the record previous to starting an insert operation
//so that we can return to it if the record insert is aborted
long mLastRecordLong;
long mRecordCountLong;

//helper functions
void populateList();
QString quotedValue( QString value );
bool deleteCRS( QString id );
bool saveCRS( QgsCoordinateReferenceSystem myParameters, QString myName, QString myId, bool newEntry );
void insertProjection( QString myProjectionAcronym );

//These two QMap store the values as they are on the database when loading
QMap <QString, QString> existingCRSparameters;
QMap <QString, QString> existingCRSnames;

//These three vectors store the value updated with the current modifications
std::vector<QString> customCRSnames;
std::vector<QString> customCRSids;
std::vector<QString> customCRSparameters;

//vector saving the CRS to be deleted
std::vector<QString> deletedCRSs;

//Columns in the tree widget
enum columns { QGIS_CRS_NAME_COLUMN, QGIS_CRS_ID_COLUMN, QGIS_CRS_PARAMETERS_COLUMN };
};


#endif
19 changes: 18 additions & 1 deletion src/app/qgshandlebadlayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "qgslogger.h"
#include "qgsrasterlayer.h"
#include "qgsproviderregistry.h"
#include "qgsmessagebar.h"

#include <QDomDocument>
#include <QDomElement>
Expand All @@ -37,7 +38,18 @@ void QgsHandleBadLayersHandler::handleBadLayers( QList<QDomNode> layers, QDomDoc
{
QApplication::setOverrideCursor( Qt::ArrowCursor );
QgsHandleBadLayers *dialog = new QgsHandleBadLayers( layers, projectDom );
dialog->exec();

if ( dialog->layerCount() < layers.size() )
QgisApp::instance()->messageBar()->pushMessage(
tr( "Handle Bad layers" ),
tr( "%1 of %2 bad layers were not not fixable." )
.arg( layers.size() - dialog->layerCount() )
.arg( layers.size() ),
QgsMessageBar::WARNING, QgisApp::instance()->messageTimeout() );

if ( dialog->layerCount() > 0 )
dialog->exec();

delete dialog;
QApplication::restoreOverrideCursor();
}
Expand Down Expand Up @@ -357,3 +369,8 @@ void QgsHandleBadLayers::rejected()

QDialog::reject();
}

int QgsHandleBadLayers::layerCount()
{
return mLayerList->rowCount();
}
2 changes: 2 additions & 0 deletions src/app/qgshandlebadlayers.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class QgsHandleBadLayers
QgsHandleBadLayers( const QList<QDomNode> &layers, const QDomDocument &dom );
~QgsHandleBadLayers();

int layerCount();

private slots:
void selectionChanged();
void browseClicked();
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
cbxIdentifyResultsDocked->setChecked( settings.value( "/qgis/dockIdentifyResults", false ).toBool() );
cbxSnappingOptionsDocked->setChecked( settings.value( "/qgis/dockSnapping", false ).toBool() );
cbxAddPostgisDC->setChecked( settings.value( "/qgis/addPostgisDC", false ).toBool() );
cbxAddOracleDC->setChecked( settings.value( "/qgis/addOracleDC", false ).toBool() );
cbxAddNewLayersToCurrentGroup->setChecked( settings.value( "/qgis/addNewLayersToCurrentGroup", false ).toBool() );
cbxCreateRasterLegendIcons->setChecked( settings.value( "/qgis/createRasterLegendIcons", true ).toBool() );
cbxCopyWKTGeomFromTable->setChecked( settings.value( "/qgis/copyGeometryAsWKT", true ).toBool() );
Expand Down Expand Up @@ -1014,6 +1015,7 @@ void QgsOptions::saveOptions()
settings.setValue( "/qgis/dockIdentifyResults", cbxIdentifyResultsDocked->isChecked() );
settings.setValue( "/qgis/dockSnapping", cbxSnappingOptionsDocked->isChecked() );
settings.setValue( "/qgis/addPostgisDC", cbxAddPostgisDC->isChecked() );
settings.setValue( "/qgis/addOracleDC", cbxAddOracleDC->isChecked() );
settings.setValue( "/qgis/addNewLayersToCurrentGroup", cbxAddNewLayersToCurrentGroup->isChecked() );
bool createRasterLegendIcons = settings.value( "/qgis/createRasterLegendIcons", true ).toBool();
settings.setValue( "/qgis/createRasterLegendIcons", cbxCreateRasterLegendIcons->isChecked() );
Expand Down
26 changes: 24 additions & 2 deletions src/core/qgscoordinatereferencesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <QRegExp>
#include <QTextStream>
#include <QFile>
#include <QSettings>

#include "qgsapplication.h"
#include "qgscrscache.h"
Expand Down Expand Up @@ -662,6 +663,7 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString theProj4String
if ( !mIsValidFlag )
{
QgsDebugMsg( "Projection is not found in databases." );
//setProj4String will set mIsValidFlag to true if there is no issue
setProj4String( myProj4String );
}

Expand Down Expand Up @@ -1472,8 +1474,28 @@ bool QgsCoordinateReferenceSystem::saveAsUserCRS( QString name )

QgsMessageLog::logMessage( QObject::tr( "Saved user CRS [%1]" ).arg( toProj4() ), QObject::tr( "CRS" ) );

// XXX Need to free memory from the error msg if one is set
return myResult == SQLITE_OK;
int return_id;
if(myResult == SQLITE_OK)
{
return_id = sqlite3_last_insert_rowid( myDatabase );
setInternalId(return_id);

//We add the just created user CRS to the list of recently used CRS
QSettings settings;
//QStringList recentProjections = settings.value( "/UI/recentProjections" ).toStringList();
QStringList projectionsProj4 = settings.value( "/UI/recentProjectionsProj4" ).toStringList();
QStringList projectionsAuthId = settings.value( "/UI/recentProjectionsAuthId" ).toStringList();
//recentProjections.append();
//settings.setValue( "/UI/recentProjections", recentProjections );
projectionsProj4.append(toProj4());
projectionsAuthId.append(authid());
settings.setValue( "/UI/recentProjectionsProj4", projectionsProj4 );
settings.setValue( "/UI/recentProjectionsAuthId", projectionsAuthId );

}
else
return_id = -1;
return return_id;
}

long QgsCoordinateReferenceSystem::getRecordCount()
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgscoordinatereferencesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
* in the parameters member. The reason for this is so that we
* can easily present the user with 'natural language' representation
* of the projection and ellipsoid by looking them up in the srs.bs sqlite
* database. Also having the ellpse and proj elements stripped out
* database. Also having the ellipse and proj elements stripped out
* is helpful to speed up globbing queries (see below).
*
* We try to match the proj string to and srsid using the following logic:
Expand Down Expand Up @@ -444,7 +444,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
long mSRID;
//!If available the authority identifier for this srs
QString mAuthId;
//! Wehter this srs is properly defined and valid
//! Wheter this srs is properly defined and valid
bool mIsValidFlag;

//! Work out the projection units and set the appropriate local variable
Expand Down
11 changes: 11 additions & 0 deletions src/core/raster/qgsrasterfilewriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ class CORE_EXPORT QgsRasterFileWriter
const QgsCoordinateReferenceSystem& crs, QProgressDialog* progressDialog = 0 );

/** \brief Initialize vrt member variables
* @param xSize width of vrt
* @param ySize height of vrt
* @param crs coordinate system of vrt
* @param geoTransform optional array of transformation matrix values
* @param type datatype of vrt
* @param destHasNoDataValueList true if destination has no data value, indexed from 0
* @param destNoDataValueList no data value, indexed from 0
*/
Expand All @@ -132,6 +137,12 @@ class CORE_EXPORT QgsRasterFileWriter
const QgsCoordinateReferenceSystem& crs );

/** \brief Init VRT (for tiled mode) or create global output provider (single-file mode)
* @param nCols number of tile columns
* @param nRows number of tile rows
* @param crs coordinate system of vrt
* @param geoTransform optional array of transformation matrix values
* @param nBands number of bands
* @param type datatype of vrt
* @param destHasNoDataValueList true if destination has no data value, indexed from 0
* @param destNoDataValueList no data value, indexed from 0
*/
Expand Down
17 changes: 4 additions & 13 deletions src/gui/qgsprojectionselector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,10 @@ QgsProjectionSelector::QgsProjectionSelector( QWidget* parent, const char *name,
// No? Skip this entry
continue;
}
else
//If the CRS can be created but do not correspond to a CRS in the database, skip it (for example a deleted custom CRS)
if ( crs.srsid() == 0 )
{
//TODO: createFromProj4 used to save to the user database any new CRS
// this behavior was changed in order to separate creation and saving.
// Not sure if it necessary to save it here, should be checked by someone
// familiar with the code (should also give a more descriptive name to the generated CRS)
if ( crs.srsid() == 0 )
{
QString myName = QString( " * %1 (%2)" )
.arg( QObject::tr( "Generated CRS", "A CRS automatically generated from layer info get this prefix for description" ) )
.arg( crs.toProj4() );
crs.saveAsUserCRS( myName );
}
continue;
}
}
mRecentProjections << QString::number( crs.srsid() );
Expand Down Expand Up @@ -277,7 +268,7 @@ void QgsProjectionSelector::applySelection( int column, QString value )
}
else
{
QgsDebugMsg( "nothing found" );
QgsDebugMsg( QString("nothing found for %1,%2" ).arg( column ).arg( value ) );
// unselect the selected item to avoid confusing the user
lstCoordinateSystems->clearSelection();
lstRecent->clearSelection();
Expand Down
11 changes: 10 additions & 1 deletion src/providers/oracle/qgsoraclecolumntypethread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void QgsOracleColumnTypeThread::run()

mStopped = false;

QgsDebugMsg( "retrieving supported layers - connection " + mName );
emit progressMessage( tr( "Retrieving tables of %1..." ).arg( mName ) );
QVector<QgsOracleLayerProperty> layerProperties;
if ( !conn->supportedLayers( layerProperties,
QgsOracleConn::geometryColumnsOnly( mName ),
Expand All @@ -56,10 +56,16 @@ void QgsOracleColumnTypeThread::run()
return;
}

int i = 0;
foreach ( QgsOracleLayerProperty layerProperty, layerProperties )
{
if ( !mStopped )
{
emit progress( i++, layerProperties.size() );
emit progressMessage( tr( "Scanning column %1.%2.%3..." )
.arg( layerProperty.ownerName )
.arg( layerProperty.tableName )
.arg( layerProperty.geometryColName ) );
conn->retrieveLayerTypes( layerProperty, mUseEstimatedMetadata );
}

Expand All @@ -73,5 +79,8 @@ void QgsOracleColumnTypeThread::run()
emit setLayerType( layerProperty );
}

emit progress( 0, 0 );
emit progressMessage( tr( "Table retrieval finished." ) );

conn->disconnect();
}
2 changes: 2 additions & 0 deletions src/providers/oracle/qgsoraclecolumntypethread.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class QgsOracleColumnTypeThread : public QThread

signals:
void setLayerType( QgsOracleLayerProperty layerProperty );
void progress( int, int );
void progressMessage( QString );

public slots:
void stop();
Expand Down
5 changes: 3 additions & 2 deletions src/providers/oracle/qgsoracleconn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,14 @@ bool QgsOracleConn::tableInfo( bool geometryColumnsOnly, bool userTablesOnly, bo

sql = QString( "SELECT %1,c.table_name,c.column_name,%2,t.table_name AS isview"
" FROM %3_%4 c"
" LEFT OUTER JOIN %3_tables t ON c.table_name=t.table_name%5%6" )
" LEFT OUTER JOIN %3_tables t ON c.table_name=t.table_name%5"
" WHERE %6" )
.arg( owner )
.arg( geometryColumnsOnly ? "c.srid" : "NULL AS srid" )
.arg( prefix )
.arg( geometryColumnsOnly ? "sdo_geom_metadata" : "tab_columns" )
.arg( userTablesOnly ? "" : " AND c.owner=t.owner" )
.arg( geometryColumnsOnly ? "" : " WHERE c.data_type='SDO_GEOMETRY'" );
.arg( geometryColumnsOnly ? "NOT t.dropped" : "c.data_type='SDO_GEOMETRY'" );

if ( allowGeometrylessTables )
{
Expand Down
8 changes: 6 additions & 2 deletions src/providers/oracle/qgsoraclesourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ QgsOracleSourceSelect::QgsOracleSourceSelect( QWidget *parent, Qt::WFlags fl, bo
//in search does not seem to work
mSearchColumnComboBox->setCurrentIndex( 2 );

restoreGeometry( settings.value( "/Windows/PgSourceSelect/geometry" ).toByteArray() );
restoreGeometry( settings.value( "/Windows/OracleSourceSelect/geometry" ).toByteArray() );

for ( int i = 0; i < mTableModel.columnCount(); i++ )
{
mTablesTreeView->setColumnWidth( i, settings.value( QString( "/Windows/PgSourceSelect/columnWidths/%1" ).arg( i ), mTablesTreeView->columnWidth( i ) ).toInt() );
mTablesTreeView->setColumnWidth( i, settings.value( QString( "/Windows/OracleSourceSelect/columnWidths/%1" ).arg( i ), mTablesTreeView->columnWidth( i ) ).toInt() );
}

//hide the search options by default
Expand Down Expand Up @@ -472,6 +472,10 @@ void QgsOracleSourceSelect::on_btnConnect_clicked()
this, SLOT( setLayerType( QgsOracleLayerProperty ) ) );
connect( mColumnTypeThread, SIGNAL( finished() ),
this, SLOT( columnThreadFinished() ) );
connect( mColumnTypeThread, SIGNAL( progress( int, int ) ),
this, SIGNAL( progress( int, int ) ) );
connect( mColumnTypeThread, SIGNAL( progressMessage( QString ) ),
this, SIGNAL( progressMessage( QString ) ) );

btnConnect->setText( tr( "Stop" ) );
mColumnTypeThread->start();
Expand Down
2 changes: 2 additions & 0 deletions src/providers/oracle/qgsoraclesourceselect.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ class QgsOracleSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
signals:
void addDatabaseLayers( QStringList const & layerPathList, QString const & providerKey );
void connectionsChanged();
void progress( int, int );
void progressMessage( QString );

public slots:
//! Determines the tables the user selected and closes the dialog
Expand Down
3 changes: 3 additions & 0 deletions src/providers/postgres/qgscolumntypethread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ void QgsGeomColumnTypeThread::run()

mStopped = false;

int i = 0;
foreach ( QgsPostgresLayerProperty layerProperty, layerProperties )
{
if ( !mStopped )
{
emit progress( i++, layerProperties.size() );
emit progressMessage( tr( "Scanning column %1.%2.%3..." ).arg( layerProperty.schemaName ).arg( layerProperty.tableName ).arg( layerProperty.geometryColName ) );
mConn->retrieveLayerTypes( layerProperty, mUseEstimatedMetadata );
}

Expand Down
2 changes: 2 additions & 0 deletions src/providers/postgres/qgscolumntypethread.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class QgsGeomColumnTypeThread : public QThread

signals:
void setLayerType( QgsPostgresLayerProperty layerProperty );
void progress( int, int );
void progressMessage( QString );

public slots:
void addGeometryColumn( QgsPostgresLayerProperty layerProperty );
Expand Down
9 changes: 9 additions & 0 deletions src/providers/postgres/qgspgsourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ void QgsPgSourceSelect::on_btnConnect_clicked()
bool dontResolveType = QgsPostgresConn::dontResolveType( cmbConnections->currentText() );
bool allowGeometrylessTables = cbxAllowGeometrylessTables->isChecked();

emit progressMessage( tr( "Retrieving tables from %1..." ).arg( cmbConnections->currentText() ) );

QVector<QgsPostgresLayerProperty> layers;
if ( conn->supportedLayers( layers, searchGeometryColumnsOnly, searchPublicOnly, allowGeometrylessTables ) )
{
Expand Down Expand Up @@ -526,6 +528,9 @@ void QgsPgSourceSelect::finishList()
mTablesTreeView->sortByColumn( QgsPgTableModel::dbtmTable, Qt::AscendingOrder );
mTablesTreeView->sortByColumn( QgsPgTableModel::dbtmSchema, Qt::AscendingOrder );

emit progress( 0, 0 );
emit progressMessage( tr( "Table retrieval finished." ) );

if ( mTablesTreeView->model()->rowCount() == 0 )
QMessageBox::information( this,
tr( "Postgres/PostGIS Provider" ),
Expand Down Expand Up @@ -599,6 +604,10 @@ void QgsPgSourceSelect::addSearchGeometryColumn( QgsPostgresLayerProperty layerP
mColumnTypeThread, SLOT( addGeometryColumn( QgsPostgresLayerProperty ) ) );
connect( mColumnTypeThread, SIGNAL( finished() ),
this, SLOT( columnThreadFinished() ) );
connect( mColumnTypeThread, SIGNAL( progress( int, int ) ),
this, SIGNAL( progress( int, int ) ) );
connect( mColumnTypeThread, SIGNAL( progressMessage( QString ) ),
this, SIGNAL( progressMessage( QString ) ) );
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/providers/postgres/qgspgsourceselect.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
void addDatabaseLayers( QStringList const & layerPathList, QString const & providerKey );
void connectionsChanged();
void addGeometryColumn( QgsPostgresLayerProperty );
void progress( int, int );
void progressMessage( QString );

public slots:
//! Determines the tables the user selected and closes the dialog
Expand Down
2 changes: 1 addition & 1 deletion src/providers/wcs/qgswcsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ void QgsWcsProvider::readBlock( int bandNo, QgsRectangle const & viewExtent, in
// It may happen (Geoserver) that if requested BBOX is larger than coverage
// extent, the returned data cover intersection of requested BBOX and coverage
// extent scaled to requested WIDTH/HEIGHT => check extent
// Unfortunately if received raster does not hac CRS, the extent is raster size
// Unfortunately if the received raster does not have a CRS, the extent is the raster size
// and in that case it cannot be used to verify extent
QgsCoordinateReferenceSystem cacheCrs;
if ( !cacheCrs.createFromWkt( GDALGetProjectionRef( mCachedGdalDataset ) ) &&
Expand Down
252 changes: 114 additions & 138 deletions src/ui/qgscustomprojectiondialogbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>474</width>
<height>548</height>
<width>542</width>
<height>650</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -25,7 +25,41 @@
<string>Define</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0" colspan="2">
<item row="2" column="0" colspan="4">
<widget class="QTreeWidget" name="leNameList">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="sortingEnabled">
<bool>false</bool>
</property>
<attribute name="headerShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<column>
<property name="text">
<string>ID</string>
</property>
</column>
<column>
<property name="text">
<string>Parameters</string>
</property>
</column>
</widget>
</item>
<item row="1" column="0" colspan="4">
<widget class="QLabel" name="label">
<property name="text">
<string>You can define your own custom Coordinate Reference System (CRS) here. The definition must conform to the proj4 format for specifying a CRS.</string>
Expand All @@ -35,118 +69,83 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="textLabel1">
<property name="text">
<string>Name</string>
<item row="5" column="3">
<widget class="QPlainTextEdit" name="teParameters">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="buddy">
<cstring>leName</cstring>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>70</height>
</size>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="4" column="3">
<widget class="QLineEdit" name="leName"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="textLabel3_2">
<item row="4" column="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Parameters</string>
</property>
<property name="buddy">
<cstring>leParameters</cstring>
<string>Name:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="leParameters"/>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout">
<item>
<widget class="QToolButton" name="pbnFirst">
<property name="text">
<string>|&lt;</string>
</property>
<property name="icon">
<iconset>
<normaloff>../../images/themes/default/mIconFirst.png</normaloff>../../images/themes/default/mIconFirst.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="pbnPrevious">
<property name="text">
<string>&lt;</string>
</property>
<property name="icon">
<iconset>
<normaloff>../../images/themes/default/mIconPrevious.png</normaloff>../../images/themes/default/mIconPrevious.png</iconset>
</property>
</widget>
</item>
<item row="5" column="2">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item>
<widget class="QLabel" name="lblRecordNo">
<widget class="QLabel" name="label_4">
<property name="text">
<string>1 of 1</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<string>Parameters:</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="pbnNext">
<widget class="QPushButton" name="pbnCopyCRS">
<property name="text">
<string>&gt;</string>
</property>
<property name="icon">
<iconset>
<normaloff>../../images/themes/default/mIconNext.png</normaloff>../../images/themes/default/mIconNext.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="pbnLast">
<property name="text">
<string>&gt;|</string>
</property>
<property name="icon">
<iconset>
<normaloff>../../images/themes/default/mIconLast.png</normaloff>../../images/themes/default/mIconLast.png</iconset>
<string>Copy
existing CRS</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="1" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QToolButton" name="pbnNew">
<widget class="QPushButton" name="pbnAdd">
<property name="text">
<string>*</string>
</property>
<property name="icon">
<iconset>
<normaloff>../../images/themes/default/mIconNew.png</normaloff>../../images/themes/default/mIconNew.png</iconset>
<string>Add new CRS</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="pbnSave">
<property name="text">
<string>S</string>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="icon">
<iconset>
<normaloff>../../images/themes/default/mActionFileSave.png</normaloff>../../images/themes/default/mActionFileSave.png</iconset>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</widget>
</spacer>
</item>
<item>
<widget class="QToolButton" name="pbnDelete">
<widget class="QPushButton" name="pbnRemove">
<property name="text">
<string>X</string>
</property>
<property name="icon">
<iconset>
<normaloff>../../images/themes/default/mIconDelete.png</normaloff>../../images/themes/default/mIconDelete.png</iconset>
<string>Remove</string>
</property>
</widget>
</item>
Expand All @@ -155,50 +154,54 @@
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Test</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label_2">
<item row="3" column="0">
<widget class="QLabel" name="textLabel2_2_2">
<property name="text">
<string>Use the text boxes below to test the CRS definition you are creating. Enter a coordinate where both the lat/long and the transformed result are known (for example by reading off a map). Then press the calculate button to see if the CRS definition you are creating is accurate.</string>
<string>East</string>
</property>
<property name="wordWrap">
<bool>true</bool>
<property name="buddy">
<cstring>eastWGS84</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="textLabel3_2_2">
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Parameters</string>
<string>Use the text boxes below to test the CRS definition you are creating. Enter a coordinate where both the lat/long and the transformed result are known (for example by reading off a map). Then press the calculate button to see if the CRS definition you are creating is accurate.</string>
</property>
<property name="buddy">
<cstring>leTestParameters</cstring>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QLineEdit" name="leTestParameters"/>
</item>
<item row="2" column="1">
<item row="1" column="1">
<widget class="QLabel" name="textLabel1_3">
<property name="text">
<string>Geographic / WGS84</string>
</property>
</widget>
</item>
<item row="2" column="2">
<item row="1" column="2">
<widget class="QLabel" name="textLabel2_3">
<property name="text">
<string>Destination CRS </string>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="2" column="0">
<widget class="QLabel" name="textLabel2_2">
<property name="text">
<string>North</string>
Expand All @@ -208,14 +211,14 @@
</property>
</widget>
</item>
<item row="3" column="1">
<item row="2" column="1">
<widget class="QLineEdit" name="northWGS84">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="2">
<item row="2" column="2">
<widget class="QLabel" name="projectedX">
<property name="enabled">
<bool>true</bool>
Expand All @@ -228,20 +231,10 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="textLabel2_2_2">
<property name="text">
<string>East</string>
</property>
<property name="buddy">
<cstring>eastWGS84</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="3" column="1">
<widget class="QLineEdit" name="eastWGS84"/>
</item>
<item row="4" column="2">
<item row="3" column="2">
<widget class="QLabel" name="projectedY">
<property name="enabled">
<bool>true</bool>
Expand All @@ -257,7 +250,7 @@
</property>
</widget>
</item>
<item row="5" column="0" colspan="3">
<item row="4" column="0" colspan="3">
<widget class="QPushButton" name="pbnCalculate">
<property name="text">
<string>Calculate</string>
Expand All @@ -267,27 +260,10 @@
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<tabstops>
<tabstop>leName</tabstop>
<tabstop>leParameters</tabstop>
<tabstop>pbnFirst</tabstop>
<tabstop>pbnPrevious</tabstop>
<tabstop>pbnNext</tabstop>
<tabstop>pbnLast</tabstop>
<tabstop>pbnNew</tabstop>
<tabstop>pbnSave</tabstop>
<tabstop>pbnDelete</tabstop>
<tabstop>leTestParameters</tabstop>
<tabstop>northWGS84</tabstop>
<tabstop>eastWGS84</tabstop>
<tabstop>pbnCalculate</tabstop>
Expand All @@ -297,17 +273,17 @@
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<signal>rejected()</signal>
<receiver>QgsCustomProjectionDialogBase</receiver>
<slot>accept()</slot>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>436</x>
<y>522</y>
<x>270</x>
<y>590</y>
</hint>
<hint type="destinationlabel">
<x>471</x>
<y>501</y>
<x>270</x>
<y>306</y>
</hint>
</hints>
</connection>
Expand Down
7 changes: 7 additions & 0 deletions src/ui/qgsoptionsbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1520,6 +1520,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbxAddOracleDC">
<property name="text">
<string>Add Oracle layers with double click and select in extended mode</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down
4 changes: 2 additions & 2 deletions src/ui/qgsprojectionselectorbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>574</width>
<height>390</height>
<width>820</width>
<height>591</height>
</rect>
</property>
<property name="sizePolicy">
Expand Down