Skip to content
Permalink
Browse files
Merge branch 'master' of github.com:qgis/Quantum-GIS
  • Loading branch information
timlinux committed Nov 22, 2011
2 parents 6191319 + 376adc4 commit 200c44ea2a9975b83e4f0133f3f2f7f99ee3de80
@@ -474,13 +474,17 @@ int main( int argc, char *argv[] )
}
#endif

#ifdef Q_WS_WIN
//for windows lets use plastique style!
QApplication::setStyle( new QPlastiqueStyle );
#endif

QSettings mySettings;

// 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();
if ( !style.isNull() )
QApplication::setStyle( style );
#ifdef Q_WS_WIN
else
QApplication::setStyle( new QPlastiqueStyle );
#endif

/* Translation file for QGIS.
*/
@@ -30,6 +30,7 @@
#include <QLocale>
#include <QToolBar>
#include <QSize>
#include <QStyleFactory>

#if QT_VERSION >= 0x40500
#include <QNetworkDiskCache>
@@ -58,12 +59,19 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
connect( cmbSize, SIGNAL( activated( const QString& ) ), this, SLOT( iconSizeChanged( const QString& ) ) );
connect( cmbSize, SIGNAL( highlighted( const QString& ) ), this, SLOT( iconSizeChanged( const QString& ) ) );
connect( cmbSize, SIGNAL( textChanged( const QString& ) ), this, SLOT( iconSizeChanged( const QString& ) ) );

connect( this, SIGNAL( accepted() ), this, SLOT( saveOptions() ) );

cmbSize->addItem( "16" );
cmbSize->addItem( "24" );
cmbSize->addItem( "32" );

QStringList styles = QStyleFactory::keys();
foreach(QString style, styles )
{
cmbStyle->addItem( style );
}

cmbIdentifyMode->addItem( tr( "Current layer" ), 0 );
cmbIdentifyMode->addItem( tr( "Top down, stop at first" ), 1 );
cmbIdentifyMode->addItem( tr( "Top down" ), 2 );
@@ -270,6 +278,8 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
// set the theme combo
cmbTheme->setCurrentIndex( cmbTheme->findText( settings.value( "/Themes", "default" ).toString() ) );
cmbSize->setCurrentIndex( cmbSize->findText( settings.value( "/IconSize", 24 ).toString() ) );
QString name = QApplication::style()->objectName();
cmbStyle->setCurrentIndex( cmbStyle->findText( name, Qt::MatchFixedString ) );
//set the state of the checkboxes
//Changed to default to true as of QGIS 1.7
chkAntiAliasing->setChecked( settings.value( "/qgis/enable_anti_aliasing", true ).toBool() );
@@ -589,6 +599,7 @@ void QgsOptions::saveOptions()
settings.setValue( "/qgis/askToSaveProjectChanges", chbAskToSaveProjectChanges->isChecked() );
settings.setValue( "/qgis/warnOldProjectVersion", chbWarnOldProjectVersion->isChecked() );
settings.setValue( "/qgis/nullValue", leNullValue->text() );
settings.setValue( "/qgis/style", cmbStyle->currentText() );

//overlay placement method
int overlayIndex = mOverlayAlgorithmComboBox->currentIndex();
@@ -18,7 +18,6 @@
#include "qgspointdisplacementrenderer.h"
#include "qgsgeometry.h"
#include "qgslogger.h"
#include "qgsrendererv2registry.h"
#include "qgsspatialindex.h"
#include "qgssymbolv2.h"
#include "qgssymbollayerv2utils.h"
@@ -276,12 +275,7 @@ QgsFeatureRendererV2* QgsPointDisplacementRenderer::create( QDomElement& symbolo
QDomElement embeddedRendererElem = symbologyElem.firstChildElement( "renderer-v2" );
if ( !embeddedRendererElem.isNull() )
{
QString rendererName = embeddedRendererElem.attribute( "type" );
QgsRendererV2AbstractMetadata* metaData = QgsRendererV2Registry::instance()->rendererMetadata( rendererName );
if ( metaData )
{
r->setEmbeddedRenderer( metaData->createRenderer( embeddedRendererElem ) );
}
r->setEmbeddedRenderer( QgsFeatureRendererV2::load( embeddedRendererElem ) );
}

//center symbol
@@ -52,14 +52,25 @@ QgsProjectionSelector::QgsProjectionSelector( QWidget* parent, const char *name,
lstCoordinateSystems->header()->setResizeMode( AUTHID_COLUMN, QHeaderView::Stretch );
lstCoordinateSystems->header()->resizeSection( QGIS_CRS_ID_COLUMN, 0 );
lstCoordinateSystems->header()->setResizeMode( QGIS_CRS_ID_COLUMN, QHeaderView::Fixed );
// Hide (internal) ID column
lstCoordinateSystems->setColumnHidden(QGIS_CRS_ID_COLUMN, true);

lstRecent->header()->setResizeMode( AUTHID_COLUMN, QHeaderView::Stretch );
lstRecent->header()->resizeSection( QGIS_CRS_ID_COLUMN, 0 );
lstRecent->header()->setResizeMode( QGIS_CRS_ID_COLUMN, QHeaderView::Fixed );
// Hide (internal) ID column
lstRecent->setColumnHidden(QGIS_CRS_ID_COLUMN, true);

cbxAuthority->addItem( tr( "All" ) );
cbxAuthority->addItems( authorities() );

// TEMP? hide buttons, we now implemented filter
cbxAuthority->hide();
cbxMode->hide();
label->hide();
label_2->hide();
pbnFind->hide();

// Read settings from persistent storage
QSettings settings;
mRecentProjections = settings.value( "/UI/recentProjections" ).toStringList();
@@ -189,7 +200,6 @@ QString QgsProjectionSelector::ogcWmsCrsFilterAsSqlExpression( QSet<QString> * c
{
return sqlExpression;
}

/*
Ref: WMS 1.3.0, section 6.7.3 "Layer CRS":
@@ -794,7 +804,8 @@ void QgsProjectionSelector::loadCrsList( QSet<QString> *crsFilter )
newItem->setText( AUTHID_COLUMN, QString::fromUtf8(( char * )sqlite3_column_text( ppStmt, 2 ) ) );
// display the qgis srs_id (field 1) in the third column of the list view
newItem->setText( QGIS_CRS_ID_COLUMN, QString::fromUtf8(( char * )sqlite3_column_text( ppStmt, 1 ) ) );

// expand also parent node
newItem->parent()->setExpanded(true);
}

// display the qgis deprecated in the user data of the item
@@ -982,6 +993,65 @@ void QgsProjectionSelector::on_pbnFind_clicked()
teProjection->setText( "" );
}

void QgsProjectionSelector::on_leSearch_textChanged( const QString & theFilterTxt)
{
// filter recent crs's
QTreeWidgetItemIterator itr(lstRecent);
while (*itr) {
if ( (*itr)->childCount() == 0 ) // it's an end node aka a projection
{
if ( (*itr)->text( NAME_COLUMN ).contains( theFilterTxt, Qt::CaseInsensitive )
|| (*itr)->text( AUTHID_COLUMN ).contains( theFilterTxt, Qt::CaseInsensitive )
)
{
(*itr)->setHidden(false);
QTreeWidgetItem * parent = (*itr)->parent();
while (parent != NULL)
{
parent->setExpanded(true);
parent->setHidden(false);
parent = parent->parent();
}
}
else{
(*itr)->setHidden(true);
}
}
else{
(*itr)->setHidden(true);
}
++itr;
}
// filter crs's
QTreeWidgetItemIterator it(lstCoordinateSystems);
while (*it) {
if ( (*it)->childCount() == 0 ) // it's an end node aka a projection
{
if ( (*it)->text( NAME_COLUMN ).contains( theFilterTxt, Qt::CaseInsensitive )
|| (*it)->text( AUTHID_COLUMN ).contains( theFilterTxt, Qt::CaseInsensitive )
)
{
(*it)->setHidden(false);
QTreeWidgetItem * parent = (*it)->parent();
while (parent != NULL)
{
parent->setExpanded(true);
parent->setHidden(false);
parent = parent->parent();
}
}
else{
(*it)->setHidden(true);
}
}
else{
(*it)->setHidden(true);
}
++it;
}
}


long QgsProjectionSelector::getLargestCRSIDMatch( QString theSql )
{
long mySrsId = 0;
@@ -1094,7 +1164,7 @@ QStringList QgsProjectionSelector::authorities()
return authorities;
}

/*!
/*!linfinity qtcreator qgis
* \brief Make the string safe for use in SQL statements.
* This involves escaping single quotes, double quotes, backslashes,
* and optionally, percentage symbols. Percentage symbols are used
@@ -117,6 +117,7 @@ class GUI_EXPORT QgsProjectionSelector: public QWidget, private Ui::QgsProjectio
void on_pbnFind_clicked();
void on_lstRecent_currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem * );
void on_cbxHideDeprecated_stateChanged();
void on_leSearch_textChanged(const QString &);

protected:
/** Used to ensure the projection list view is actually populated */
@@ -132,8 +132,8 @@ RgLineVectorLayerSettingsWidget::RgLineVectorLayerSettingsWidget( RgLineVectorLa
QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( layer_it.value() );
if ( !vl )
continue;
// if ( vl->geometryType() != QGis::Line )
// continue;
if ( vl->geometryType() != QGis::Line )
continue;
mcbLayers->insertItem( 0, vl->name() );
}

@@ -294,7 +294,14 @@ QgsOgrProvider::QgsOgrProvider( QString const & uri )
}

ogrLayer = ogrOrigLayer;
setSubsetString( mSubsetString );
if (ogrLayer != NULL )
{
setSubsetString( mSubsetString );
}
else
{
valid = false;
}
}
else
{

0 comments on commit 200c44e

Please sign in to comment.