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): """ Enable plugin """ if self._enabled: return # Fifedit plugin data self._action_show = Action(u"RegionTool", checkable=True) scripts.gui.action.activated.connect(self.toggle, sender=self._action_show) self._editor._tools_menu.addAction(self._action_show) self.create() self.toggle() postMapShown.connect(self.onNewMap) preMapClosed.connect(self._mapClosed) postSave.connect(self.save) if self.settings['docked']: self._editor.dockWidgetTo(self.container, self.settings['dockarea'])
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'])
def enable(self): """ enables the plugin and connects to the editor """ if self._enabled: return self._enabled = True # Fifedit plugin data self._action_show = Action(self.getName(), checkable=True) scripts.gui.action.activated.connect(self.toggle, sender=self._action_show) self._editor._tools_menu.addAction(self._action_show) postMapShown.connect(self.update) onObjectSelected.connect(self.set_object) onObjectsImported.connect(self.update_namespaces) self.create() self.toggle() if self.settings['docked']: self._editor.dockWidgetTo(self.container, self.settings['dockarea'])