Пример #1
0
    def __init__(self, edit_dialog):
        """Constructor"""
        ProductionChanges.__init__(self, edit_dialog)
        iface.actionToggleEditing().trigger()
        # set editing to edit polygon
        iface.actionVertexTool().trigger()
        selecttools = iface.attributesToolBar().findChildren(QToolButton)
        # selection actions
        iface.building_toolbar.addSeparator()
        for sel in selecttools:
            if sel.text() == "Select Feature(s)":
                for a in sel.actions()[0:3]:
                    iface.building_toolbar.addAction(a)
        # editing actions
        iface.building_toolbar.addSeparator()
        for dig in iface.digitizeToolBar().actions():
            if dig.objectName() in ["mActionVertexTool", "mActionMoveFeature"]:
                iface.building_toolbar.addAction(dig)
        # advanced Actions
        iface.building_toolbar.addSeparator()
        for adv in iface.advancedDigitizeToolBar().actions():
            if adv.objectName() in [
                    "mActionUndo", "mActionRedo", "mActionReshapeFeatures",
                    "mActionOffsetCurve"
            ]:
                iface.building_toolbar.addAction(adv)
        iface.building_toolbar.show()

        self.disable_UI_functions()
Пример #2
0
    def __init__(self, edit_dialog):
        """Constructor"""
        ProductionChanges.__init__(self, edit_dialog)
        # set editing to edit polygon
        iface.actionSelect().trigger()
        selecttools = iface.attributesToolBar().findChildren(QToolButton)
        # selection actions
        iface.building_toolbar.addSeparator()
        for sel in selecttools:
            if sel.text() == "Select Feature(s)":
                for a in sel.actions()[0:3]:
                    iface.building_toolbar.addAction(a)
        iface.building_toolbar.show()
        self.msgbox_remove = self.confirmation_dialog_box("remove")

        self.disable_UI_functions()

        if len(self.editing_layer.selectedFeatures()) > 0:
            if self.is_correct_selections():
                self.get_selections()
                self.enable_UI_functions()
                self.populate_edit_comboboxes()
                self.select_comboboxes_value()
            else:
                self.edit_dialog.ids = []
                self.edit_dialog.building_outline_id = None
                self.disable_UI_functions()
Пример #3
0
 def setup_toolbar(self):
     """Called on opening of from to set up the buildings toolbar for selection only"""
     selecttools = iface.attributesToolBar().findChildren(QToolButton)
     # selection actions
     iface.building_toolbar.addSeparator()
     for sel in selecttools:
         if sel.text() == "Select Feature(s)":
             for a in sel.actions()[0:3]:
                 iface.building_toolbar.addAction(a)
     # editing actions
     iface.building_toolbar.addSeparator()
     for dig in iface.digitizeToolBar().actions():
         if dig.objectName() in [
                 "mActionAddFeature", "mActionNodeTool",
                 "mActionMoveFeature"
         ]:
             iface.building_toolbar.addAction(dig)
     # advanced Actions
     iface.building_toolbar.addSeparator()
     for adv in iface.advancedDigitizeToolBar().actions():
         if adv.objectName() in [
                 "mActionUndo", "mActionRedo", "mActionReshapeFeatures",
                 "mActionOffsetCurve"
         ]:
             iface.building_toolbar.addAction(adv)
     iface.building_toolbar.show()
Пример #4
0
    def selectArea(self):
        for a in iface.attributesToolBar().actions():
            if a.objectName() == 'mActionDeselectAll':
                a.trigger()
                break

        l = self.proj.mapLayersByName('Beräkningsområde')
        if l:
            l = l[0]
            iface.setActiveLayer(l)
            iface.actionSelect().trigger()
Пример #5
0
    def selectStart(self, comboBox):
        # Start object selection for QGYF
        for a in iface.attributesToolBar().actions():
            if a.objectName() == 'mActionDeselectAll':
                a.trigger()
                break

        iface.actionSelect().trigger()

        def lyr(x):
            return {
                'punkt': 'Punktobjekt',
                'linje': 'Linjeobjekt'
            }.get(x, 'Ytobjekt')

        l = self.proj.mapLayersByName(lyr(comboBox.currentText()))
        if l:
            iface.setActiveLayer(l[0])
Пример #6
0
 def removeAllSelection(self):
     for a in iface.attributesToolBar().actions():
         if a.objectName() == 'mActionDeselectAll':
             a.trigger()
             break
Пример #7
0
 def unselectAll(self):
     """ Désélectionne toutes les entités """
     for a in iface.attributesToolBar().actions():
         if a.objectName() == 'mActionDeselectAll':
             a.trigger()
             break