Register plugin in Spyder's main window

def register_plugin(self):
        """Register plugin in Spyder's main window"""
        self.main.restore_scrollbar_position.connect(
            self.restore_scrollbar_position)
        self.main.console.edit_goto.connect(self.load)
        self.exec_in_extconsole.connect(self.main.execute_in_external_console)
        self.redirect_stdio.connect(self.main.redirect_internalshell_stdio)
        self.open_dir.connect(self.main.workingdirectory.chdir)
        self.set_help(self.main.help)
        if self.main.outlineexplorer is not None:
            self.set_outlineexplorer(self.main.outlineexplorer)
        editorstack = self.get_current_editorstack()
        if not editorstack.data:
            self.__load_temp_file()
        self.main.add_dockwidget(self)
        self.main.add_to_fileswitcher(self, editorstack.tabs, editorstack.data,
                                      ima.icon('TextFileIcon'))