def enable(self): """ enables the plugin """ if self._enabled: return self._enabled = True onInstancesSelected.connect(self.highlight) preMapClosed.connect(self.reset) postMapShown.connect(self.reset) onLayerDelete.connect(self.reset) mouseClicked.connect(self.mouse_clicked) onQuit.connect(self.reset)
def enable(self): """ plugin method """ if self._enabled: return self._enabled = True self._action_show = Action(unicode(self.getName(),"utf-8"), checkable=True) scripts.gui.action.activated.connect(self.toggle_gui, sender=self._action_show) self._editor._tools_menu.addAction(self._action_show) onObjectSelected.connect(self.update) onInstancesSelected.connect(self.update) preMapClosed.connect(self.hide) postMapShown.connect(self.update) self.create_gui() self.update_gui() if self.settings['docked']: self._editor.dockWidgetTo(self.container, self.settings['dockarea'])