diff --git a/Makefile b/Makefile index 9226150..134edab 100755 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/cogo_dialogs.py b/cogo_dialogs.py index 6550744..4d9e269 100755 --- a/cogo_dialogs.py +++ b/cogo_dialogs.py @@ -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 @@ -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