Skip to content

Commit

Permalink
better fix for #13
Browse files Browse the repository at this point in the history
  • Loading branch information
slarosa committed Oct 6, 2019
1 parent bbcf276 commit 5f8f9d1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions select_by_relationship_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def __init__(self, iface):
self.iface = iface
self.sFr = None

self.iface.newProjectCreated.connect(self.resetRelation)

self.actions = []
self.menu = self.tr(u'&Select by relationship')
self.toolbar = self.iface.addToolBar(u'SelectByRelationship')
Expand Down Expand Up @@ -188,6 +190,12 @@ def unload(self):
self.sFr.disable()
del self.sFr

def resetRelation(self):
if self.sFr:
self.sFr.relationsChecked = {}
self.comboRelations._checkedItems = set()
self.comboRelations.setCheckedItems(set())

def populateComboRelations(self):
self.comboRelations.clear()
relations = self.sFr.manager.relations().keys()
Expand Down

0 comments on commit 5f8f9d1

Please sign in to comment.