mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
Remember button checked status
This commit is contained in:
parent
d1ec4ac0aa
commit
db98a38c02
@ -263,13 +263,17 @@ class ProcessingPlugin:
|
|||||||
|
|
||||||
def sync_in_place_button_state(self, layer=None):
|
def sync_in_place_button_state(self, layer=None):
|
||||||
"""Synchronise the button state with layer state and selection"""
|
"""Synchronise the button state with layer state and selection"""
|
||||||
|
|
||||||
if layer is None:
|
if layer is None:
|
||||||
layer = self.iface.activeLayer()
|
layer = self.iface.activeLayer()
|
||||||
if layer is None or layer.type() != QgsMapLayer.VectorLayer or not layer.isEditable() or not layer.selectedFeatureCount():
|
|
||||||
self.editSelectedAction.setChecked(False)
|
old_enabled_state = self.editSelectedAction.isEnabled()
|
||||||
self.editSelectedAction.setEnabled(False)
|
|
||||||
else:
|
new_enabled_state = layer is not None and layer.type() == QgsMapLayer.VectorLayer and layer.isEditable() and layer.selectedFeatureCount()
|
||||||
self.editSelectedAction.setEnabled(True)
|
self.editSelectedAction.setEnabled(new_enabled_state)
|
||||||
|
|
||||||
|
if new_enabled_state != old_enabled_state:
|
||||||
|
self.toolbox.set_in_place_edit_mode(new_enabled_state and self.editSelectedAction.isChecked())
|
||||||
|
|
||||||
def openProcessingOptions(self):
|
def openProcessingOptions(self):
|
||||||
self.iface.showOptionsDialog(self.iface.mainWindow(), currentPage='processingOptions')
|
self.iface.showOptionsDialog(self.iface.mainWindow(), currentPage='processingOptions')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user