Skip to content
Permalink
Browse files

indentation update

  • Loading branch information
jef-n committed Sep 26, 2015
1 parent b3f3d65 commit 56b5d4e723104cf68ca244b2f8c490d8e5d1dccf
@@ -68,7 +68,7 @@ def checkSupports(self):
def chooseOutputFile(self):
# get last used dir
settings = QSettings()
lastUsedDir = settings.value( self.lastUsedVectorDirSettingsKey, "." );
lastUsedDir = settings.value(self.lastUsedVectorDirSettingsKey, ".")

# get selected filter
selectedFilter = self.cboFileFormat.itemData(self.cboFileFormat.currentIndex())
@@ -80,7 +80,7 @@ def chooseOutputFile(self):
return

# store the last used dir
settings.setValue( self.lastUsedVectorDirSettingsKey, QFileInfo(filename).filePath() )
settings.setValue(self.lastUsedVectorDirSettingsKey, QFileInfo(filename).filePath())

self.editOutputFile.setText(filename)

@@ -103,14 +103,13 @@ def populateFileFilters(self):

# set the last used filter
settings = QSettings()
filt = settings.value( self.lastUsedVectorFilterSettingsKey, "ESRI Shapefile" );
filt = settings.value(self.lastUsedVectorFilterSettingsKey, "ESRI Shapefile")

idx = self.cboFileFormat.findText(filt)
if idx < 0:
idx = 0
self.cboFileFormat.setCurrentIndex(idx)


def accept(self):
# sanity checks
if self.editOutputFile.text() == "":
@@ -16,9 +16,9 @@ def __init__(self, alg):
self.setMainWidget()

cornerWidget = QWidget()
layout = QVBoxLayout();
layout.setContentsMargins(0,0,0,5);
self.tabWidget.setStyleSheet("QTabBar::tab { height: 30px; }");
layout = QVBoxLayout()
layout.setContentsMargins(0, 0, 0, 5)
self.tabWidget.setStyleSheet("QTabBar::tab { height: 30px; }")
runAsBatchButton = QPushButton("Run as batch process...")
runAsBatchButton.clicked.connect(self.runAsBatch)
layout.addWidget(runAsBatchButton)
@@ -72,9 +72,9 @@ def __init__(self, alg):
self.setMainWidget()

cornerWidget = QWidget()
layout = QVBoxLayout();
layout.setContentsMargins(0,0,0,5);
self.tabWidget.setStyleSheet("QTabBar::tab { height: 30px; }");
layout = QVBoxLayout()
layout.setContentsMargins(0, 0, 0, 5)
self.tabWidget.setStyleSheet("QTabBar::tab { height: 30px; }")
runAsBatchButton = QPushButton("Run as batch process...")
runAsBatchButton.clicked.connect(self.runAsBatch)
layout.addWidget(runAsBatchButton)
@@ -1,12 +1,13 @@
from qgis.utils import iface
from qgis.utils import iface
from PyQt4 import QtGui
from processing.core.Processing import Processing
from processing.gui.MessageDialog import MessageDialog
from processing.gui.AlgorithmDialog import AlgorithmDialog

algorithmsToolbar = None

def addAlgorithmEntry(algname, menuName, submenuName, actionText = None, icon = None, addButton = False):

def addAlgorithmEntry(algname, menuName, submenuName, actionText=None, icon=None, addButton=False):
alg = Processing.getAlgorithm(algname)
if alg is None:
return
@@ -30,7 +31,7 @@ def _executeAlgorithm(alg):
dlg.setTitle(tr('Missing dependency'))
dlg.setMessage(
tr('<h3>Missing dependency. This algorithm cannot '
'be run :-( </h3>\n%s') % message)
'be run :-( </h3>\n%s') % message)
dlg.exec_()
return
alg = alg.getCopy()
@@ -51,11 +52,10 @@ def _executeAlgorithm(alg):

def getMenu(name, parent):
menus = [c for c in parent.children() if isinstance(c, QtGui.QMenu)]
menusDict = {m.title():m for m in menus}
menusDict = {m.title(): m for m in menus}
if name in menusDict:
return menusDict[name]
else:
menu = QtGui.QMenu(name, parent)
parent.addMenu(menu)
return menu

@@ -25,7 +25,7 @@ QgsComposerImageExportOptionsDialog::QgsComposerImageExportOptionsDialog( QWidge
{
setupUi( this );

connect( mClipToContentGroupBox, SIGNAL(toggled(bool)), this, SLOT(clipToContentsToggled(bool)));
connect( mClipToContentGroupBox, SIGNAL( toggled( bool ) ), this, SLOT( clipToContentsToggled( bool ) ) );

QSettings settings;
restoreGeometry( settings.value( "/Windows/ComposerImageExportOptionsDialog/geometry" ).toByteArray() );
@@ -37,7 +37,7 @@ QgsComposerImageExportOptionsDialog::~QgsComposerImageExportOptionsDialog()
settings.setValue( "/Windows/ComposerImageExportOptionsDialog/geometry", saveGeometry() );
}

void QgsComposerImageExportOptionsDialog::setResolution(int resolution)
void QgsComposerImageExportOptionsDialog::setResolution( int resolution )
{
mResolutionSpinBox->setValue( resolution );

@@ -78,7 +78,7 @@ int QgsComposerImageExportOptionsDialog::height() const
return mHeightSpinBox->value();
}

void QgsComposerImageExportOptionsDialog::setCropToContents(bool crop)
void QgsComposerImageExportOptionsDialog::setCropToContents( bool crop )
{
mClipToContentGroupBox->setChecked( crop );
}
@@ -88,53 +88,53 @@ bool QgsComposerImageExportOptionsDialog::cropToContents() const
return mClipToContentGroupBox->isChecked();
}

void QgsComposerImageExportOptionsDialog::getCropMargins(int& topMargin, int& rightMargin, int& bottomMargin, int& leftMargin) const
void QgsComposerImageExportOptionsDialog::getCropMargins( int& topMargin, int& rightMargin, int& bottomMargin, int& leftMargin ) const
{
topMargin = mTopMarginSpinBox->value();
rightMargin = mRightMarginSpinBox->value();
bottomMargin = mBottomMarginSpinBox->value();
leftMargin = mLeftMarginSpinBox->value();
}

void QgsComposerImageExportOptionsDialog::setCropMargins(int topMargin, int rightMargin, int bottomMargin, int leftMargin)
void QgsComposerImageExportOptionsDialog::setCropMargins( int topMargin, int rightMargin, int bottomMargin, int leftMargin )
{
mTopMarginSpinBox->setValue( topMargin );
mRightMarginSpinBox->setValue( rightMargin );
mBottomMarginSpinBox->setValue( bottomMargin );
mLeftMarginSpinBox->setValue( leftMargin );
}

void QgsComposerImageExportOptionsDialog::on_mWidthSpinBox_valueChanged(int value)
void QgsComposerImageExportOptionsDialog::on_mWidthSpinBox_valueChanged( int value )
{
mHeightSpinBox->blockSignals( true );
mResolutionSpinBox->blockSignals( true );
mHeightSpinBox->setValue( mImageSize.height() * value / mImageSize.width() );
mResolutionSpinBox->setValue( value * 25.4 / mImageSize.width() );
mHeightSpinBox->blockSignals( false );
mResolutionSpinBox->blockSignals( false);
mResolutionSpinBox->blockSignals( false );
}

void QgsComposerImageExportOptionsDialog::on_mHeightSpinBox_valueChanged(int value)
void QgsComposerImageExportOptionsDialog::on_mHeightSpinBox_valueChanged( int value )
{
mWidthSpinBox->blockSignals( true );
mResolutionSpinBox->blockSignals( true );
mWidthSpinBox->setValue( mImageSize.width() * value / mImageSize.height() );
mResolutionSpinBox->setValue( value * 25.4 / mImageSize.height() );
mWidthSpinBox->blockSignals( false );
mResolutionSpinBox->blockSignals( false);
mResolutionSpinBox->blockSignals( false );
}

void QgsComposerImageExportOptionsDialog::on_mResolutionSpinBox_valueChanged(int value)
void QgsComposerImageExportOptionsDialog::on_mResolutionSpinBox_valueChanged( int value )
{
mWidthSpinBox->blockSignals( true );
mHeightSpinBox->blockSignals( true );
mWidthSpinBox->setValue( mImageSize.width() * value / 25.4 );
mHeightSpinBox->setValue( mImageSize.height() * value / 25.4 );
mWidthSpinBox->blockSignals( false );
mHeightSpinBox->blockSignals( false);
mHeightSpinBox->blockSignals( false );
}

void QgsComposerImageExportOptionsDialog::clipToContentsToggled(bool state)
void QgsComposerImageExportOptionsDialog::clipToContentsToggled( bool state )
{
mWidthSpinBox->setEnabled( !state );
mHeightSpinBox->setEnabled( !state );
@@ -203,7 +203,7 @@ class QgsBrowserTreeFilterProxyModel : public QSortFilterProxyModel
// also look into the comment column
QModelIndex commentIndex = mModel->index( sourceRow, 1, sourceParent );
return filterAcceptsItem( sourceIndex ) || filterAcceptsAncestor( sourceIndex ) || filterAcceptsDescendant( sourceIndex ) ||
filterAcceptsItem( commentIndex ) || filterAcceptsAncestor( commentIndex ) || filterAcceptsDescendant( commentIndex );
filterAcceptsItem( commentIndex ) || filterAcceptsAncestor( commentIndex ) || filterAcceptsDescendant( commentIndex );
}

// returns true if at least one ancestor is accepted by filter
@@ -576,7 +576,7 @@ void QgsCustomization::createTreeItemDocks()
{
if ( obj->inherits( "QDockWidget" ) )
{
QDockWidget* dw = qobject_cast<QDockWidget*> ( obj );
QDockWidget* dw = qobject_cast<QDockWidget*>( obj );
QStringList dwstrs;
dwstrs << dw->objectName() << dw->windowTitle();
QTreeWidgetItem* dwItem = new QTreeWidgetItem( topItem, dwstrs );
@@ -509,7 +509,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa
{
if ( QgsMapLayer::VectorLayer == mapLayer->type() )
{
vectorLayers.append( qobject_cast<QgsVectorLayer*> ( mapLayer ) );
vectorLayers.append( qobject_cast<QgsVectorLayer*>( mapLayer ) );
}
}
mRelationManagerDlg->setLayers( vectorLayers );
@@ -331,15 +331,15 @@ class CORE_EXPORT QgsLayerItem : public QgsDataItem

protected:

/** the provider key */
/** The provider key */
QString mProviderKey;
/** the URI */
/** The URI */
QString mUri;
/** the layer type */
/** The layer type */
LayerType mLayerType;
/** the list of supported CRS */
/** The list of supported CRS */
QStringList mSupportedCRS;
/** the list of supported formats */
/** The list of supported formats */
QStringList mSupportFormats;

public:
@@ -350,7 +350,7 @@ class CORE_EXPORT QgsLayerItem : public QgsDataItem
static const QIcon &iconRaster();
static const QIcon &iconDefault();

/** returns the layer name */
/** Returns the layer name */
virtual QString layerName() const { return name(); }
};

@@ -28,7 +28,7 @@


QgsAuthTrustedCAsDialog::QgsAuthTrustedCAsDialog( QWidget *parent,
QList<QSslCertificate> trustedCAs )
QList<QSslCertificate> trustedCAs )
: QDialog( parent )
, mTrustedCAs( trustedCAs )
, mAuthNotifyLayout( 0 )
@@ -58,7 +58,7 @@ QgsExpressionBuilderWidget::QgsExpressionBuilderWidget( QWidget *parent )
connect( btnLoadAll, SIGNAL( pressed() ), this, SLOT( loadAllValues() ) );
connect( btnLoadSample, SIGNAL( pressed() ), this, SLOT( loadSampleValues() ) );

Q_FOREACH( QPushButton* button, mOperatorsGroupBox->findChildren<QPushButton *>() )
Q_FOREACH ( QPushButton* button, mOperatorsGroupBox->findChildren<QPushButton *>() )
{
connect( button, SIGNAL( pressed() ), this, SLOT( operatorButtonClicked() ) );
}
@@ -138,7 +138,7 @@ void QgsExpressionBuilderWidget::currentChanged( const QModelIndex &index, const
}

mLoadGroupBox->setVisible( item->getItemType() == QgsExpressionItem::Field && mLayer );
mValueGroupBox->setVisible( ( item->getItemType() == QgsExpressionItem::Field && mLayer ) || mValuesListView->model()->rowCount() > 0 );
mValueGroupBox->setVisible(( item->getItemType() == QgsExpressionItem::Field && mLayer ) || mValuesListView->model()->rowCount() > 0 );

// Show the help for the current item.
QString help = loadFunctionHelp( item );
@@ -193,7 +193,7 @@ void QgsExpressionBuilderWidget::updateFunctionFileList( QString path )
dir.setNameFilters( QStringList() << "*.py" );
QStringList files = dir.entryList( QDir::Files );
cmbFileNames->clear();
Q_FOREACH( const QString& name, files )
Q_FOREACH ( const QString& name, files )
{
QFileInfo info( mFunctionsPath + QDir::separator() + name );
if ( info.baseName() == "__init__" ) continue;
@@ -297,7 +297,7 @@ void QgsExpressionBuilderWidget::loadFieldNames( const QgsFields& fields )
void QgsExpressionBuilderWidget::loadFieldsAndValues( const QMap<QString, QStringList> &fieldValues )
{
QgsFields fields;
Q_FOREACH( const QString& fieldName, fieldValues.keys() )
Q_FOREACH ( const QString& fieldName, fieldValues.keys() )
{
fields.append( QgsField( fieldName ) );
}
@@ -322,7 +322,7 @@ void QgsExpressionBuilderWidget::fillFieldValues( const QString& fieldName, int
QList<QVariant> values;
QStringList strValues;
mLayer->uniqueValues( fieldIndex, values, countLimit );
Q_FOREACH( const QVariant& value, values )
Q_FOREACH ( const QVariant& value, values )
{
QString strValue;
if ( value.isNull() )
@@ -415,7 +415,7 @@ void QgsExpressionBuilderWidget::loadRecent( QString key )
QSettings settings;
QString location = QString( "/expressions/recent/%1" ).arg( key );
QStringList expressions = settings.value( location ).toStringList();
Q_FOREACH( const QString& expression, expressions )
Q_FOREACH ( const QString& expression, expressions )
{
this->registerItem( name, expression, expression, expression );
}
@@ -596,7 +596,7 @@ QString QgsExpressionBuilderWidget::formatPreviewString( const QString& previewS
void QgsExpressionBuilderWidget::loadExpressionContext()
{
QStringList variableNames = mExpressionContext.filteredVariableNames();
Q_FOREACH( const QString& variable, variableNames )
Q_FOREACH ( const QString& variable, variableNames )
{
registerItem( "Variables", variable, " @" + variable + " ",
QgsExpression::variableHelpText( variable, true, mExpressionContext.variable( variable ) ),
@@ -606,7 +606,7 @@ void QgsExpressionBuilderWidget::loadExpressionContext()

// Load the functions from the expression context
QStringList contextFunctions = mExpressionContext.functionNames();
Q_FOREACH( const QString& functionName, contextFunctions )
Q_FOREACH ( const QString& functionName, contextFunctions )
{
QgsExpression::Function* func = mExpressionContext.function( functionName );
QString name = func->name();
@@ -16,8 +16,8 @@

#include "qgsgrassaddfeature.h"

QgsGrassAddFeature::QgsGrassAddFeature(QgsMapCanvas* canvas, CaptureMode mode)
: QgsMapToolAddFeature(canvas, mode)
QgsGrassAddFeature::QgsGrassAddFeature( QgsMapCanvas* canvas, CaptureMode mode )
: QgsMapToolAddFeature( canvas, mode )
{
mCheckGeometryType = false;
}

0 comments on commit 56b5d4e

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