def activate(self, ideSettings, ideGlobalData): """Activates the plugin. The plugin may override the method to do specific plugin activation handling. ideSettings - reference to the IDE Settings singleton see codimension/src/utils/settings.py ideGlobalData - reference to the IDE global settings see codimension/src/utils/globals.py Note: if overriden do not forget to call the base class activate() """ WizardInterface.activate(self, ideSettings, ideGlobalData) self.__resultViewer = PylintResultViewer(self.ide, PLUGIN_HOME_DIR) self.ide.sideBars['bottom'].addTab( self.__resultViewer, QIcon(PLUGIN_HOME_DIR + 'pylint.png'), 'Pylint', 'pylint', 2) self.ide.sideBars['bottom'].tabButton('pylint', QTabBar.RightSide).resize(0, 0) # The clear call must be here, not in the results viewer __init__() # This is because the viewer has not been inserted into the side bar at # the time of __init__() so the tooltip setting does not work self.__resultViewer.clear() self.__pylintDriver = PylintDriver(self.ide) self.__pylintDriver.sigFinished.connect(self.__pylintFinished) if self.__globalShortcut is None: self.__globalShortcut = QShortcut(QKeySequence('Ctrl+L'), self.ide.mainWindow, self.__run) else: self.__globalShortcut.setKey('Ctrl+L') # Add buttons for _, _, tabWidget in self.ide.editorsManager.getTextEditors(): self.__addButton(tabWidget) # File type changed & new tab self.ide.editorsManager.sigTextEditorTabAdded.connect( self.__textEditorTabAdded) self.ide.editorsManager.sigFileTypeChanged.connect( self.__fileTypeChanged) # Add main menu self.__mainMenu = QMenu('Pylint', self.ide.mainWindow) self.__mainMenu.setIcon(QIcon(PLUGIN_HOME_DIR + 'pylint.png')) self.__mainRunAction = self.__mainMenu.addAction( QIcon(PLUGIN_HOME_DIR + 'pylint.png'), 'Run pylint\t(Ctrl+L)', self.__run) self.__mainGenerateAction = self.__mainMenu.addAction( QIcon(PLUGIN_HOME_DIR + 'generate.png'), 'Generate/open pylintrc file', self.__generate) toolsMenu = self.ide.mainWindow.menuBar().findChild(QMenu, 'tools') self.__mainMenuSeparator = toolsMenu.addSeparator() toolsMenu.addMenu(self.__mainMenu) self.__mainMenu.aboutToShow.connect(self.__mainMenuAboutToShow)
def activate(self, ideSettings, ideGlobalData): """Activates the plugin. The plugin may override the method to do specific plugin activation handling. ideSettings - reference to the IDE Settings singleton see codimension/src/utils/settings.py ideGlobalData - reference to the IDE global settings see codimension/src/utils/globals.py Note: if overriden do not forget to call the base class activate() """ WizardInterface.activate(self, ideSettings, ideGlobalData) QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) try: self.__where = self.__getConfiguredWhere() mainToolbar = self.ide.mainWindow.getToolbar() beforeWidget = mainToolbar.findChild(QAction, 'debugSpacer') self.__separator = mainToolbar.insertSeparator(beforeWidget) self.__memtopButton = QAction( QIcon(PLUGIN_HOME_DIR + 'memtop.png'), 'memtop report', mainToolbar) self.__memtopButton.triggered.connect(self.__onMemtop) mainToolbar.insertAction(beforeWidget, self.__memtopButton) self.__debuggerButton = QAction( QIcon(PLUGIN_HOME_DIR + 'debugger.png'), 'stop with debugger', mainToolbar) self.__debuggerButton.triggered.connect(self.__onDebugger) mainToolbar.insertAction(beforeWidget, self.__debuggerButton) self.__repeatButton = QAction( QIcon(PLUGIN_HOME_DIR + 'repeat.png'), 'Repeated actions', mainToolbar) self.__repeatButton.triggered.connect(self.__onRepeatedAction) mainToolbar.insertAction(beforeWidget, self.__repeatButton) self.__resetButton = QAction(QIcon(PLUGIN_HOME_DIR + 'reset.png'), 'Reset the heap reference point', mainToolbar) self.__resetButton.triggered.connect(self.__onResetHeap) mainToolbar.insertAction(beforeWidget, self.__resetButton) self.hpy = hpy() self.hpy.setref() except: QApplication.restoreOverrideCursor() raise QApplication.restoreOverrideCursor()
def activate(self, ideSettings, ideGlobalData): """ The plugin may override the method to do specific plugin activation handling. ideSettings - reference to the IDE Settings singleton see codimension/src/utils/settings.py ideGlobalData - reference to the IDE global settings see codimension/src/utils/globals.py Note: if overriden do not forget to call the base class activate() """ WizardInterface.activate(self, ideSettings, ideGlobalData) self.__where = self.__getConfiguredWhere() self.connect(self.ide.editorsManager, SIGNAL('tabClosed'), self.__collectGarbage) self.ide.project.projectChanged.connect(self.__collectGarbage) return
def activate( self, ideSettings, ideGlobalData ): """ The plugin may override the method to do specific plugin activation handling. ideSettings - reference to the IDE Settings singleton see codimension/src/utils/settings.py ideGlobalData - reference to the IDE global settings see codimension/src/utils/globals.py Note: if overriden do not forget to call the base class activate() """ WizardInterface.activate( self, ideSettings, ideGlobalData ) self.__where = self.__getConfiguredWhere() self.connect( self.ide.editorsManager, SIGNAL( 'tabClosed' ), self.__collectGarbage ) self.ide.project.projectChanged.connect( self.__collectGarbage ) return