Skip to content
Permalink
Browse files
Merge branch 'master' of https://github.com/qgis/Quantum-GIS
  • Loading branch information
volaya committed Jan 7, 2013
2 parents e59de66 + 7e29d7c commit 964e84243582ecee5a166a39d62df97de077f784
Showing with 5,105 additions and 4,673 deletions.
  1. +37 −37 doc/TRANSLATORS
  2. +1,172 −1,634 i18n/qgis_de.ts
  3. +4 −0 python/core/qgsapplication.sip
  4. +3 −0 python/core/qgsmaplayerregistry.sip
  5. +5 −2 python/core/qgsvectorlayerimport.sip
  6. +2 −2 src/app/CMakeLists.txt
  7. +54 −0 src/app/main.cpp
  8. +8 −4 src/app/qgisapp.cpp
  9. +1 −1 src/app/qgisapp.h
  10. +5 −0 src/app/qgsbrowserdockwidget.cpp
  11. +1 −1 src/app/qgsfieldsproperties.cpp
  12. +11 −5 src/app/qgsmergeattributesdialog.cpp
  13. +225 −7 src/app/qgsoptions.cpp
  14. +31 −3 src/app/qgsoptions.h
  15. +2 −1 src/core/gps/tok.c
  16. +15 −0 src/core/qgsapplication.cpp
  17. +6 −1 src/core/qgsapplication.h
  18. +13 −2 src/core/qgsbrowsermodel.cpp
  19. +2 −3 src/core/qgsbrowsermodel.h
  20. +13 −0 src/core/qgsmaplayerregistry.cpp
  21. +3 −0 src/core/qgsmaplayerregistry.h
  22. +9 −8 src/core/qgsnetworkreplyparser.h
  23. +10 −3 src/core/qgsproject.cpp
  24. +5 −0 src/core/qgsproject.h
  25. +6 −0 src/core/qgsvectordataprovider.h
  26. +126 −87 src/core/qgsvectorlayer.cpp
  27. +6 −1 src/core/qgsvectorlayer.h
  28. +28 −4 src/core/qgsvectorlayerimport.cpp
  29. +7 −2 src/core/qgsvectorlayerimport.h
  30. +12 −6 src/core/qgswfsdata.h
  31. +6 −0 src/gui/attributetable/qgsattributetableidcolumnpair.cpp
  32. +19 −3 src/gui/qgsattributeeditor.cpp
  33. +1 −4 src/gui/qgssearchquerybuilder.cpp
  34. +1 −1 src/providers/mssql/qgsmssqlprovider.cpp
  35. +50 −8 src/providers/postgres/qgspostgresdataitems.cpp
  36. +4 −0 src/providers/postgres/qgspostgresdataitems.h
  37. +1 −1 src/providers/postgres/qgspostgresprovider.cpp
  38. +3 −1 src/providers/postgres/qgspostgresprovider.h
  39. +1 −1 src/providers/wms/qgswmssourceselect.cpp
  40. +3,197 −2,840 src/ui/qgsoptionsbase.ui

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -152,6 +152,10 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)
//! @note added in 1.4
static const QStringList svgPaths();

//! Returns the system environment variables passed to application.
//! @note added in 1.9
static const QMap<QString, QString> systemEnvVars();

//! Returns the path to the application prefix directory.
static const QString prefixPath();

@@ -22,6 +22,9 @@ class QgsMapLayerRegistry : QObject
//! Retrieve a pointer to a loaded layer by id
QgsMapLayer *mapLayer( QString theLayerId );

//! Retrieve all layers using their name
QList<QgsMapLayer *> mapLayersByName( QString layerName );

//! Retrieve the mapLayers collection (mainly intended for use by projection)
QMap<QString, QgsMapLayer*> & mapLayers();

@@ -9,6 +9,7 @@ class QgsVectorLayerImport
%TypeHeaderCode
#include <qgsvectorlayerimport.h>
#include <qgsfield.h>
class QProgressDialog;
%End

public:
@@ -37,7 +38,8 @@ class QgsVectorLayerImport
bool onlySelected = false,
QString *errorMessage /Out/ = 0,
bool skipAttributeCreation = false,
QMap<QString, QVariant> *options = 0
QMap<QString, QVariant> *options = 0,
QProgressDialog *progress = 0
);

/** create a empty layer and add fields to it */
@@ -47,7 +49,8 @@ class QgsVectorLayerImport
QGis::WkbType geometryType,
const QgsCoordinateReferenceSystem* crs,
bool overwrite = false,
const QMap<QString, QVariant> *options = 0
const QMap<QString, QVariant> *options = 0,
QProgressDialog *progress = 0
);

/** checks whether there were any errors */
@@ -91,7 +91,7 @@ SET(QGIS_APP_SRCS
qgsmeasuretool.cpp
qgsmergeattributesdialog.cpp
qgsoptions.cpp
qgspastetransformations.cpp
#qgspastetransformations.cpp
qgspointrotationitem.cpp
qgspluginitem.cpp
qgspluginmanager.cpp
@@ -244,7 +244,7 @@ SET (QGIS_APP_MOC_HDRS
qgsmeasuretool.h
qgsmergeattributesdialog.h
qgsoptions.h
qgspastetransformations.h
#qgspastetransformations.h
qgspluginmanager.h
qgsprojectlayergroupdialog.h
qgsprojectproperties.h
@@ -569,6 +569,60 @@ int main( int argc, char *argv[] )

QSettings mySettings;

// custom environment variables
QMap<QString, QString> systemEnvVars = QgsApplication::systemEnvVars();
bool useCustomVars = mySettings.value( "qgis/customEnvVarsUse", QVariant( false ) ).toBool();
if ( useCustomVars )
{
QStringList customVarsList = mySettings.value( "qgis/customEnvVars", "" ).toStringList();
if ( !customVarsList.isEmpty() )
{
foreach ( const QString &varStr, customVarsList )
{
int pos = varStr.indexOf( QLatin1Char( '|' ) );
if ( pos == -1 )
continue;
QString envVarApply = varStr.left( pos );
QString varStrNameValue = varStr.mid( pos + 1 );
pos = varStrNameValue.indexOf( QLatin1Char( '=' ) );
if ( pos == -1 )
continue;
QString envVarName = varStrNameValue.left( pos );
QString envVarValue = varStrNameValue.mid( pos + 1 );

if ( systemEnvVars.contains( envVarName ) )
{
if ( envVarApply == "prepend" )
{
envVarValue += systemEnvVars.value( envVarName );
}
else if ( envVarApply == "append" )
{
envVarValue = systemEnvVars.value( envVarName ) + envVarValue;
}
}

if ( systemEnvVars.contains( envVarName ) && envVarApply == "unset" )
{
#ifdef Q_WS_WIN
putenv( envVarName.toUtf8().constData() );
#else
unsetenv( envVarName.toUtf8().constData() );
#endif
}
else
{
#ifdef Q_WS_WIN
if ( envVarApply != "undefined" || !getenv( envVarName.toUtf8().constData() ) )
putenv( QString( "%1=%2" ).arg( envVarName ).arg( envVarValue ).toUtf8().constData() );
#else
setenv( envVarName.toUtf8().constData(), envVarValue.toUtf8().constData(), envVarApply == "undefined" ? 0 : 1 );
#endif
}
}
}
}

// Set the application style. If it's not set QT will use the platform style except on Windows
// as it looks really ugly so we use QPlastiqueStyle.
QString style = mySettings.value( "/qgis/style" ).toString();
@@ -147,7 +147,7 @@
#include "qgsmultibandcolorrenderer.h"
#include "qgsnewvectorlayerdialog.h"
#include "qgsoptions.h"
#include "qgspastetransformations.h"
// #include "qgspastetransformations.h"
#include "qgspluginitem.h"
#include "qgspluginlayer.h"
#include "qgspluginlayerregistry.h"
@@ -3330,11 +3330,12 @@ bool QgisApp::addProject( QString projectFile )

if ( ! QgsProject::instance()->read( projectFile ) )
{
QApplication::restoreOverrideCursor();

QMessageBox::critical( this,
tr( "Unable to open project" ),
QgsProject::instance()->error() );

QApplication::restoreOverrideCursor();

mMapCanvas->freeze( false );
mMapCanvas->refresh();
@@ -4964,11 +4965,13 @@ void QgisApp::editPaste( QgsMapLayer *destinationLayer )

QHash<int, int> remap;
const QgsFieldMap &fields = clipboard()->fields();
QgsAttributeList pkAttrList = pasteVectorLayer->pendingPkAttributesList();
for ( QgsFieldMap::const_iterator it = fields.begin(); it != fields.end(); it++ )
{
int dst = pasteVectorLayer->fieldNameIndex( it->name() );
if ( dst < 0 )
if ( dst < 0 || pkAttrList.contains( dst ) )
{
// skip primary key attributes
continue;
}
remap.insert( it.key(), dst );
@@ -5064,6 +5067,7 @@ void QgisApp::pasteStyle( QgsMapLayer * destinationLayer )
}
}

#if 0
void QgisApp::pasteTransformations()
{
QgsPasteTransformations *pt = new QgsPasteTransformations();
@@ -5072,7 +5076,7 @@ void QgisApp::pasteTransformations()

pt->exec();
}

#endif

void QgisApp::refreshMapCanvas()
{
@@ -1048,7 +1048,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
//! Read Well Known Binary stream from PostGIS
//void readWKB(const char *, QStringList tables);
//! shows the paste-transformations dialog
void pasteTransformations();
// void pasteTransformations();
//! check to see if file is dirty and if so, prompt the user th save it
bool saveDirty();
/** Helper function to union several geometries together (used in function mergeSelectedFeatures)
@@ -28,6 +28,7 @@
#include "qgsrasterlayer.h"
#include "qgsvectorlayer.h"
#include "qgisapp.h"
#include "qgsproject.h"

// browser layer properties dialog
#include "qgsapplication.h"
@@ -285,6 +286,10 @@ void QgsBrowserDockWidget::showEvent( QShowEvent * e )
if ( item && item->type() == QgsDataItem::Favourites )
mBrowserView->expand( index );
}

connect( QgsProject::instance(), SIGNAL( readProject( const QDomDocument & ) ), mModel, SLOT( reload() ) );
connect( QgsProject::instance(), SIGNAL( writeProject( QDomDocument & ) ), mModel, SLOT( reload() ) );
connect( QgisApp::instance(), SIGNAL( newProject() ), mModel, SLOT( reload() ) );
}

QDockWidget::showEvent( e );
@@ -752,7 +752,7 @@ QgsAttributeEditorElement* QgsFieldsProperties::createAttributeEditorWidget( QTr

if ( item->data( 0, Qt::UserRole ) == "field" )
{
int idx = *mLayer->dataProvider()->fieldNameMap().find( item->text( 0 ) );
int idx = *( mLayer->dataProvider()->fieldNameMap() ).find( item->text( 0 ) );
widgetDef = new QgsAttributeEditorField( item->text( 0 ), idx, parent );
}
else
@@ -84,6 +84,7 @@ void QgsMergeAttributesDialog::createTableWidgetContents()

//create combo boxes and insert attribute names
const QgsFieldMap& fieldMap = mVectorLayer->pendingFields();
QgsAttributeList pkAttrList = mVectorLayer->pendingPkAttributesList();

int col = 0;
for ( QgsFieldMap::const_iterator fieldIt = fieldMap.constBegin();
@@ -96,7 +97,12 @@ void QgsMergeAttributesDialog::createTableWidgetContents()

mTableWidget->setColumnCount( col + 1 );

mTableWidget->setCellWidget( 0, col, createMergeComboBox( fieldIt->type() ) );
QComboBox *cb = createMergeComboBox( fieldIt->type() );
if ( pkAttrList.contains( fieldIt.key() ) )
{
cb->setCurrentIndex( cb->findText( tr( "Skip attribute" ) ) );
}
mTableWidget->setCellWidget( 0, col, cb );

QTableWidgetItem *item = new QTableWidgetItem( fieldIt.value().name() );
item->setData( Qt::UserRole, fieldIt.key() );
@@ -135,14 +141,14 @@ void QgsMergeAttributesDialog::createTableWidgetContents()
}
}

QComboBox* QgsMergeAttributesDialog::createMergeComboBox( QVariant::Type columnType ) const
QComboBox *QgsMergeAttributesDialog::createMergeComboBox( QVariant::Type columnType ) const
{
QComboBox* newComboBox = new QComboBox();
QComboBox *newComboBox = new QComboBox();
//add items for feature
QgsFeatureList::const_iterator f_it = mFeatureList.constBegin();
for ( ; f_it != mFeatureList.constEnd(); ++f_it )
{
newComboBox->addItem( tr( "feature %1" ).arg( f_it->id() ) );
newComboBox->addItem( tr( "Feature %1" ).arg( f_it->id() ) );
}

if ( columnType == QVariant::Double || columnType == QVariant::Int )
@@ -183,7 +189,7 @@ int QgsMergeAttributesDialog::findComboColumn( QComboBox* c ) const
void QgsMergeAttributesDialog::comboValueChanged( const QString &text )
{
Q_UNUSED( text );
QComboBox* senderComboBox = qobject_cast<QComboBox *>( sender() );
QComboBox *senderComboBox = qobject_cast<QComboBox *>( sender() );
if ( !senderComboBox )
{
return;

0 comments on commit 964e842

Please sign in to comment.