mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-03 00:02:25 -05:00
[app][bugfix] Update layer editable state when filter is changed
Fixes #17507
This commit is contained in:
parent
2169c8809c
commit
d775a0d97a
@ -8940,6 +8940,7 @@ void QgisApp::layerSubsetString()
|
||||
if ( qb->exec() && ( subsetBefore != qb->sql() ) && mLayerTreeView )
|
||||
{
|
||||
mLayerTreeView->refreshLayerSymbology( vlayer->id() );
|
||||
activateDeactivateLayerRelatedActions( vlayer );
|
||||
}
|
||||
}
|
||||
|
||||
@ -11089,14 +11090,13 @@ void QgisApp::layersWereAdded( const QList<QgsMapLayer *> &layers )
|
||||
connect( vlayer, &QgsVectorLayer::labelingFontNotFound, this, &QgisApp::labelingFontNotFound );
|
||||
|
||||
QgsVectorDataProvider *vProvider = vlayer->dataProvider();
|
||||
if ( vProvider && vProvider->capabilities() & QgsVectorDataProvider::EditingCapabilities )
|
||||
{
|
||||
connect( vlayer, &QgsVectorLayer::layerModified, this, &QgisApp::updateLayerModifiedActions );
|
||||
connect( vlayer, &QgsVectorLayer::editingStarted, this, &QgisApp::layerEditStateChanged );
|
||||
connect( vlayer, &QgsVectorLayer::editingStopped, this, &QgisApp::layerEditStateChanged );
|
||||
connect( vlayer, &QgsVectorLayer::readOnlyChanged, this, &QgisApp::layerEditStateChanged );
|
||||
}
|
||||
|
||||
// Do not check for layer editing capabilities because they may change
|
||||
// (for example when subsetString is added/removed) and signals need to
|
||||
// be in place in order to update the GUI
|
||||
connect( vlayer, &QgsVectorLayer::layerModified, this, &QgisApp::updateLayerModifiedActions );
|
||||
connect( vlayer, &QgsVectorLayer::editingStarted, this, &QgisApp::layerEditStateChanged );
|
||||
connect( vlayer, &QgsVectorLayer::editingStopped, this, &QgisApp::layerEditStateChanged );
|
||||
connect( vlayer, &QgsVectorLayer::readOnlyChanged, this, &QgisApp::layerEditStateChanged );
|
||||
connect( vlayer, &QgsVectorLayer::raiseError, this, &QgisApp::onLayerError );
|
||||
|
||||
provider = vProvider;
|
||||
|
@ -689,7 +689,13 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
|
||||
//! mark project dirty
|
||||
void markDirty();
|
||||
|
||||
void layersWereAdded( const QList<QgsMapLayer *> & );
|
||||
/**
|
||||
* \brief layersWereAdded is triggered when layers were added
|
||||
* This method loops through the list of \a layers and connect all
|
||||
* application signals that need to listen to layer events.
|
||||
* \param layers list of map layers that have been added
|
||||
*/
|
||||
void layersWereAdded( const QList<QgsMapLayer *> &layers );
|
||||
|
||||
/* layer will be removed - changed from removingLayer to removingLayers
|
||||
in 1.8.
|
||||
|
@ -226,6 +226,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
|
||||
{
|
||||
menu->addAction( toggleEditingAction );
|
||||
toggleEditingAction->setChecked( vlayer->isEditable() );
|
||||
toggleEditingAction->setEnabled( true );
|
||||
}
|
||||
if ( saveLayerEditsAction && vlayer->isModified() )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user