5 changes: 5 additions & 0 deletions resources/function_help/Field
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
Double click to add field name to expression string.
<br><br>
Right-Click on field name to open context menu sample value loading options.

<p><h4>Note:</h4>
Loading field values from WFS layers isn't supported, before the layer is
actually inserted, ie. when building queries.
</p>
4 changes: 4 additions & 0 deletions resources/function_help/Fields and Values
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ Contains a list of fields from the layer. Sample values can also be accessed vi
<br><br>
Select the field name from the list then right-click to access context menu with options to load sample values from the selected field.

<p><h4>Note:</h4>
Loading field values from WFS layers isn't supported, before the layer is
actually inserted, ie. when building queries.
</p>
2 changes: 0 additions & 2 deletions src/app/qgsattributetabledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
// info from table to application
connect( this, SIGNAL( saveEdits( QgsMapLayer * ) ), QgisApp::instance(), SLOT( saveEdits( QgsMapLayer * ) ) );

connect( mMainView, SIGNAL( currentChanged( int ) ), mMainViewButtonGroup, SLOT( currentChanged( int ) ) );

bool myDockFlag = settings.value( "/qgis/dockAttributeTable", false ).toBool();
if ( myDockFlag )
{
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsexpressionbuilderdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ QgsExpressionBuilderDialog::QgsExpressionBuilderDialog( QgsVectorLayer* layer, Q
{
setupUi( this );

QPushButton* okButuon = buttonBox->button( QDialogButtonBox::Ok );
connect( builder, SIGNAL( expressionParsed( bool ) ), okButuon, SLOT( setEnabled( bool ) ) );
QPushButton* okButton = buttonBox->button( QDialogButtonBox::Ok );
connect( builder, SIGNAL( expressionParsed( bool ) ), okButton, SLOT( setEnabled( bool ) ) );

builder->setLayer( layer );
builder->setExpressionText( startText );
Expand Down
10 changes: 5 additions & 5 deletions src/gui/qgsexpressionbuilderwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,17 @@ void QgsExpressionBuilderWidget::currentChanged( const QModelIndex &index, const
// Get the item
QModelIndex idx = mProxyModel->mapToSource( index );
QgsExpressionItem* item = dynamic_cast<QgsExpressionItem*>( mModel->itemFromIndex( idx ) );
if ( item == 0 )
if ( !item )
return;

if ( item->getItemType() != QgsExpressionItem::Field )
{
mValueListWidget->clear();
}

btnLoadAll->setVisible( item->getItemType() == QgsExpressionItem::Field );
btnLoadSample->setVisible( item->getItemType() == QgsExpressionItem::Field );
mValueGroupBox->setVisible( item->getItemType() == QgsExpressionItem::Field );
btnLoadAll->setVisible( item->getItemType() == QgsExpressionItem::Field && mLayer );
btnLoadSample->setVisible( item->getItemType() == QgsExpressionItem::Field && mLayer );
mValueGroupBox->setVisible( item->getItemType() == QgsExpressionItem::Field && mLayer );

// Show the help for the current item.
QString help = loadFunctionHelp( item );
Expand Down Expand Up @@ -369,7 +369,7 @@ void QgsExpressionBuilderWidget::showContextMenu( const QPoint & pt )
if ( !item )
return;

if ( item->getItemType() == QgsExpressionItem::Field )
if ( item->getItemType() == QgsExpressionItem::Field && mLayer )
{
QMenu* menu = new QMenu( this );
menu->addAction( tr( "Load top 10 unique values" ), this, SLOT( loadSampleValues() ) );
Expand Down
2 changes: 2 additions & 0 deletions src/gui/qgsnewhttpconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ QgsNewHttpConnection::QgsNewHttpConnection(
cbxIgnoreGetMapURI->setVisible( false );
cbxIgnoreAxisOrientation->setVisible( false );
cbxInvertAxisOrientation->setVisible( false );
cbxSmoothPixmapTransform->setVisible( false );
mGroupBox->layout()->removeWidget( cbxIgnoreGetMapURI );
mGroupBox->layout()->removeWidget( cbxIgnoreAxisOrientation );
mGroupBox->layout()->removeWidget( cbxInvertAxisOrientation );
mGroupBox->layout()->removeWidget( cbxSmoothPixmapTransform );
}

cbxIgnoreGetFeatureInfoURI->setVisible( false );
Expand Down
33 changes: 0 additions & 33 deletions src/gui/qgsowssourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,39 +710,6 @@ void QgsOWSSourceSelect::searchFinished()
r->deleteLater();
}

void QgsOWSSourceSelect::on_mAddWMSButton_clicked()
{
// TODO: deactivate button if dialog is open?
// TODO: remove from config on close?

int selectedRow = mSearchTableWidget->currentRow();
if ( selectedRow == -1 )
{
return;
}

QString wmsTitle = mSearchTableWidget->item( selectedRow, 0 )->text();
QString wmsUrl = mSearchTableWidget->item( selectedRow, 2 )->text();

QSettings settings;
if ( settings.contains( QString( "Qgis/connections-wms/%1/url" ).arg( wmsTitle ) ) )
{
QString msg = tr( "The %1 connection already exists. Do you want to overwrite it?" ).arg( wmsTitle );
QMessageBox::StandardButton result = QMessageBox::information( this, tr( "Confirm Overwrite" ), msg, QMessageBox::Ok | QMessageBox::Cancel );
if ( result != QMessageBox::Ok )
{
return;
}
}

// add selected WMS to config and mark as current
settings.setValue( QString( "Qgis/connections-wms/%1/url" ).arg( wmsTitle ), wmsUrl );
QgsOWSConnection::setSelectedConnection( mService, wmsTitle );
populateConnectionList();

mTabWidget->setCurrentIndex( 0 );
}

void QgsOWSSourceSelect::on_mSearchTableWidget_itemSelectionChanged()
{
mSearchAddButton->setEnabled( mSearchTableWidget->currentRow() != -1 );
Expand Down
1 change: 0 additions & 1 deletion src/gui/qgsowssourceselect.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ class GUI_EXPORT QgsOWSSourceSelect : public QDialog, public Ui::QgsOWSSourceSel

private slots:
void on_mSearchButton_clicked();
void on_mAddWMSButton_clicked();
void on_mSearchTableWidget_itemSelectionChanged();
void on_mTilesetsTableWidget_itemClicked( QTableWidgetItem *item );
void on_mLayerUpButton_clicked();
Expand Down
12 changes: 6 additions & 6 deletions src/providers/wfs/qgswfssourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget* parent, Qt::WFlags fl, bool emb
connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addLayer() ) );

buttonBox->addButton( mBuildQueryButton, QDialogButtonBox::ActionRole );
connect( mBuildQueryButton, SIGNAL( clicked() ), this, SLOT( on_mBuildQueryButton_clicked() ) );
connect( mBuildQueryButton, SIGNAL( clicked() ), this, SLOT( buildQueryButtonClicked() ) );

connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
connect( btnNew, SIGNAL( clicked() ), this, SLOT( addEntryToServerList() ) );
Expand Down Expand Up @@ -94,8 +94,8 @@ QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget* parent, Qt::WFlags fl, bool emb
mModelProxy->setSortCaseSensitivity( Qt::CaseInsensitive );
treeView->setModel( mModelProxy );

connect( treeView, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( on_treeWidget_itemDoubleClicked( const QModelIndex& ) ) );
connect( treeView->selectionModel(), SIGNAL( currentRowChanged( QModelIndex, QModelIndex ) ), this, SLOT( on_treeWidget_currentRowChanged( const QModelIndex&, const QModelIndex& ) ) );
connect( treeView, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( treeWidgetItemDoubleClicked( const QModelIndex& ) ) );
connect( treeView->selectionModel(), SIGNAL( currentRowChanged( QModelIndex, QModelIndex ) ), this, SLOT( treeWidgetCurrentRowChanged( const QModelIndex&, const QModelIndex& ) ) );
}

QgsWFSSourceSelect::~QgsWFSSourceSelect()
Expand Down Expand Up @@ -519,13 +519,13 @@ void QgsWFSSourceSelect::on_btnLoad_clicked()
emit connectionsChanged();
}

void QgsWFSSourceSelect::on_treeWidget_itemDoubleClicked( const QModelIndex& index )
void QgsWFSSourceSelect::treeWidgetItemDoubleClicked( const QModelIndex& index )
{
QgsDebugMsg( "double click called" );
buildQuery( index );
}

void QgsWFSSourceSelect::on_treeWidget_currentRowChanged( const QModelIndex & current, const QModelIndex & previous )
void QgsWFSSourceSelect::treeWidgetCurrentRowChanged( const QModelIndex & current, const QModelIndex & previous )
{
Q_UNUSED( previous )
QgsDebugMsg( "treeWidget_currentRowChanged called" );
Expand All @@ -534,7 +534,7 @@ void QgsWFSSourceSelect::on_treeWidget_currentRowChanged( const QModelIndex & cu
mAddButton->setEnabled( current.isValid() );
}

void QgsWFSSourceSelect::on_mBuildQueryButton_clicked()
void QgsWFSSourceSelect::buildQueryButtonClicked()
{
QgsDebugMsg( "mBuildQueryButton click called" );
buildQuery( treeView->selectionModel()->currentIndex() );
Expand Down
6 changes: 3 additions & 3 deletions src/providers/wfs/qgswfssourceselect.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ class QgsWFSSourceSelect: public QDialog, private Ui::QgsWFSSourceSelectBase
void capabilitiesReplyFinished();
void on_btnSave_clicked();
void on_btnLoad_clicked();
void on_treeWidget_itemDoubleClicked( const QModelIndex & index );
void on_treeWidget_currentRowChanged( const QModelIndex & current, const QModelIndex & previous );
void on_mBuildQueryButton_clicked();
void treeWidgetItemDoubleClicked( const QModelIndex & index );
void treeWidgetCurrentRowChanged( const QModelIndex & current, const QModelIndex & previous );
void buildQueryButtonClicked();
void filterChanged( QString text );

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