Skip to content

Commit

Permalink
Fix editing parcel (#88)
Browse files Browse the repository at this point in the history
* Fixes #88
  • Loading branch information
mazano authored Jul 8, 2021
1 parent 95f120c commit d8510df
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,31 +56,31 @@ compile: $(UI_FILES) $(RESOURCE_FILES)

# The deploy target only works on unix like operating system where
# the Python plugin directory is located at:
# $HOME/.qgis/python/plugins
# $HOME/.qgis3/python/plugins
deploy: compile doc transcompile
mkdir -p $(HOME)/.qgis/python/plugins/$(PLUGINNAME)
cp -vf $(PY_FILES) $(HOME)/.qgis/python/plugins/$(PLUGINNAME)
cp -vf $(UI_FILES) $(HOME)/.qgis/python/plugins/$(PLUGINNAME)
cp -vf $(RESOURCE_FILES) $(HOME)/.qgis/python/plugins/$(PLUGINNAME)
cp -vf $(EXTRAS) $(HOME)/.qgis/python/plugins/$(PLUGINNAME)
cp -vfr i18n $(HOME)/.qgis/python/plugins/$(PLUGINNAME)
cp -vfr $(HELP) $(HOME)/.qgis/python/plugins/$(PLUGINNAME)/help
mkdir -p $(HOME)/.qgis3/python/plugins/$(PLUGINNAME)
cp -vf $(PY_FILES) $(HOME)/.qgis3/python/plugins/$(PLUGINNAME)
cp -vf $(UI_FILES) $(HOME)/.qgis3/python/plugins/$(PLUGINNAME)
cp -vf $(RESOURCE_FILES) $(HOME)/.qgis3/python/plugins/$(PLUGINNAME)
cp -vf $(EXTRAS) $(HOME)/.qgis3/python/plugins/$(PLUGINNAME)
cp -vfr i18n $(HOME)/.qgis3/python/plugins/$(PLUGINNAME)
cp -vfr $(HELP) $(HOME)/.qgis3/python/plugins/$(PLUGINNAME)/help

# The dclean target removes compiled python files from plugin directory
# also delets any .svn entry
dclean:
find $(HOME)/.qgis/python/plugins/$(PLUGINNAME) -iname "*.pyc" -delete
find $(HOME)/.qgis/python/plugins/$(PLUGINNAME) -iname ".svn" -prune -exec rm -Rf {} \;
find $(HOME)/.qgis3/python/plugins/$(PLUGINNAME) -iname "*.pyc" -delete
find $(HOME)/.qgis3/python/plugins/$(PLUGINNAME) -iname ".svn" -prune -exec rm -Rf {} \;

# The derase deletes deployed plugin
derase:
rm -Rf $(HOME)/.qgis/python/plugins/$(PLUGINNAME)
rm -Rf $(HOME)/.qgis3/python/plugins/$(PLUGINNAME)

# The zip target deploys the plugin and creates a zip file with the deployed
# content. You can then upload the zip file on http://plugins.qgis.org
# content. You can then upload the zip file on http://plugins.qgis3.org
zip: deploy dclean
rm -f $(PLUGINNAME).zip
cd $(HOME)/.qgis/python/plugins; zip -9r $(CURDIR)/$(PLUGINNAME).zip $(PLUGINNAME)
cd $(HOME)/.qgis3/python/plugins; zip -9r $(CURDIR)/$(PLUGINNAME).zip $(PLUGINNAME)

# Create a zip package of the plugin named $(PLUGINNAME).zip.
# This requires use of git (your plugin development directory must be a
Expand Down
7 changes: 6 additions & 1 deletion cogo_dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from PyQt5.QtWidgets import QDialog, QMessageBox, QGridLayout, QVBoxLayout, QLabel, QFormLayout, QComboBox, \
QHBoxLayout, QPushButton, QSpacerItem, QApplication, QDialogButtonBox, QLayout, QSplitter, QWidget, QLineEdit, \
QCheckBox, QRadioButton, QFrame, QCompleter, QSizePolicy, QListWidget, QToolBox
from qgis._core import QgsFeatureRequest, QgsExpression
from qgis.core import QgsCredentials, QgsDataSourceUri
from qgis.gui import QgsAuthConfigSelect

Expand Down Expand Up @@ -1059,7 +1060,11 @@ def checker(data, key):
def highlight_feature(self, layer, feature):
""" Highlight a single feature on a vector layer
"""
self.highlight_features(layer, [feature, ])
request = QgsFeatureRequest(QgsExpression('parcel_id = %s' % feature)).setFlags(
QgsFeatureRequest.NoGeometry).setSubsetOfAttributes([])
for feat in layer.getFeatures(request):
single_feat = feat.id()
return single_feat

def highlight_features(self, layer, features):
""" Highlight multiple features on a vector layer
Expand Down

0 comments on commit d8510df

Please sign in to comment.