312 |
312 |
313 # load the view profiles |
313 # load the view profiles |
314 self.profiles = Preferences.getUI("ViewProfiles") |
314 self.profiles = Preferences.getUI("ViewProfiles") |
315 |
315 |
316 splash.showMessage(self.tr("Initializing Basic Services...")) |
316 splash.showMessage(self.tr("Initializing Basic Services...")) |
317 logging.getLogger(__name__).debug(self.tr("Initializing Basic Services...")) |
317 logging.getLogger(__name__).debug("Initializing Basic Services...") |
318 |
318 |
319 # create the remote server interface |
319 # create the remote server interface |
320 logging.getLogger(__name__).debug("Creating 'eric-ide' Server Interface...") |
320 logging.getLogger(__name__).debug("Creating 'eric-ide' Server Interface...") |
321 self.__ericServerInterface = EricServerInterface(self) |
321 self.__ericServerInterface = EricServerInterface(self) |
322 # register it early because it is needed very soon |
322 # register it early because it is needed very soon |
358 # Create the background service object |
358 # Create the background service object |
359 logging.getLogger(__name__).debug("Creating Background Service...") |
359 logging.getLogger(__name__).debug("Creating Background Service...") |
360 self.backgroundService = BackgroundService(self) |
360 self.backgroundService = BackgroundService(self) |
361 |
361 |
362 splash.showMessage(self.tr("Initializing Plugin Manager...")) |
362 splash.showMessage(self.tr("Initializing Plugin Manager...")) |
363 logging.getLogger(__name__).debug(self.tr("Initializing Plugin Manager...")) |
363 logging.getLogger(__name__).debug("Initializing Plugin Manager...") |
364 |
364 |
365 # Initialize the Plugin Manager (Plugins are initialized later) |
365 # Initialize the Plugin Manager (Plugins are initialized later) |
366 self.pluginManager = PluginManager( |
366 self.pluginManager = PluginManager( |
367 self, self.__disabledPlugins, develPlugin=plugin |
367 self, self.__disabledPlugins, develPlugin=plugin |
368 ) |
368 ) |
369 |
369 |
370 splash.showMessage(self.tr("Generating Main User Interface...")) |
370 splash.showMessage(self.tr("Generating Main User Interface...")) |
371 logging.getLogger(__name__).debug(self.tr("Generating Main User Interface...")) |
371 logging.getLogger(__name__).debug("Generating Main User Interface...") |
372 |
372 |
373 self.__webBrowserProcess = None |
373 self.__webBrowserProcess = None |
374 self.__webBrowserClient = None |
374 self.__webBrowserClient = None |
375 self.__webBrowserSAName = QUuid.createUuid().toString()[1:-1] |
375 self.__webBrowserSAName = QUuid.createUuid().toString()[1:-1] |
376 |
376 |
636 self.toolbarManager.setMainWindow(self) |
636 self.toolbarManager.setMainWindow(self) |
637 self.preferencesChanged.connect(self.toolbarManager.preferencesChanged) |
637 self.preferencesChanged.connect(self.toolbarManager.preferencesChanged) |
638 |
638 |
639 # Initialize the tool groups and list of started tools |
639 # Initialize the tool groups and list of started tools |
640 splash.showMessage(self.tr("Initializing Tools...")) |
640 splash.showMessage(self.tr("Initializing Tools...")) |
641 logging.getLogger(__name__).debug(self.tr("Initializing Tools...")) |
641 logging.getLogger(__name__).debug("Initializing Tools...") |
642 self.toolGroups, self.currentToolGroup = Preferences.readToolGroups() |
642 self.toolGroups, self.currentToolGroup = Preferences.readToolGroups() |
643 self.toolProcs = [] |
643 self.toolProcs = [] |
644 self.__initExternalToolsActions() |
644 self.__initExternalToolsActions() |
645 |
645 |
646 # redirect handling of http, https and file URLs to ourselves |
646 # redirect handling of http, https and file URLs to ourselves |
648 QDesktopServices.setUrlHandler("http", self.handleUrl) |
648 QDesktopServices.setUrlHandler("http", self.handleUrl) |
649 QDesktopServices.setUrlHandler("https", self.handleUrl) |
649 QDesktopServices.setUrlHandler("https", self.handleUrl) |
650 |
650 |
651 # register all relevant objects |
651 # register all relevant objects |
652 splash.showMessage(self.tr("Registering Objects...")) |
652 splash.showMessage(self.tr("Registering Objects...")) |
653 logging.getLogger(__name__).debug(self.tr("Registering Objects...")) |
653 logging.getLogger(__name__).debug("Registering Objects...") |
654 ericApp().registerObject("UserInterface", self) |
654 ericApp().registerObject("UserInterface", self) |
655 ericApp().registerObject("DebugUI", self.debuggerUI) |
655 ericApp().registerObject("DebugUI", self.debuggerUI) |
656 ericApp().registerObject("DebugServer", self.__debugServer) |
656 ericApp().registerObject("DebugServer", self.__debugServer) |
657 ericApp().registerObject("BackgroundService", self.backgroundService) |
657 ericApp().registerObject("BackgroundService", self.backgroundService) |
658 ericApp().registerObject("ViewManager", self.viewmanager) |
658 ericApp().registerObject("ViewManager", self.viewmanager) |
683 self.__sessionFile = SessionFile(True) |
683 self.__sessionFile = SessionFile(True) |
684 self.__tasksFile = TasksFile(True) |
684 self.__tasksFile = TasksFile(True) |
685 |
685 |
686 # Initialize the actions, menus, toolbars and statusbar |
686 # Initialize the actions, menus, toolbars and statusbar |
687 splash.showMessage(self.tr("Initializing Actions...")) |
687 splash.showMessage(self.tr("Initializing Actions...")) |
688 logging.getLogger(__name__).debug(self.tr("Initializing Actions...")) |
688 logging.getLogger(__name__).debug("Initializing Actions...") |
689 self.__initActions() |
689 self.__initActions() |
690 splash.showMessage(self.tr("Initializing Menus...")) |
690 splash.showMessage(self.tr("Initializing Menus...")) |
691 logging.getLogger(__name__).debug(self.tr("Initializing Menus...")) |
691 logging.getLogger(__name__).debug("Initializing Menus...") |
692 self.__initMenus() |
692 self.__initMenus() |
693 splash.showMessage(self.tr("Initializing Toolbars...")) |
693 splash.showMessage(self.tr("Initializing Toolbars...")) |
694 logging.getLogger(__name__).debug(self.tr("Initializing Toolbars...")) |
694 logging.getLogger(__name__).debug("Initializing Toolbars...") |
695 self.__initToolbars() |
695 self.__initToolbars() |
696 splash.showMessage(self.tr("Initializing Statusbar...")) |
696 splash.showMessage(self.tr("Initializing Statusbar...")) |
697 logging.getLogger(__name__).debug(self.tr("Initializing Statusbar...")) |
697 logging.getLogger(__name__).debug("Initializing Statusbar...") |
698 self.__initStatusbar() |
698 self.__initStatusbar() |
699 |
699 |
700 # connect the appFocusChanged signal after all actions are ready |
700 # connect the appFocusChanged signal after all actions are ready |
701 app.focusChanged.connect(self.viewmanager.appFocusChanged) |
701 app.focusChanged.connect(self.viewmanager.appFocusChanged) |
702 |
702 |
729 else: |
729 else: |
730 self.SAServer = None |
730 self.SAServer = None |
731 |
731 |
732 # now finalize the plugin manager setup |
732 # now finalize the plugin manager setup |
733 splash.showMessage(self.tr("Initializing Plugins...")) |
733 splash.showMessage(self.tr("Initializing Plugins...")) |
734 logging.getLogger(__name__).debug(self.tr("Initializing Plugins...")) |
734 logging.getLogger(__name__).debug("Initializing Plugins...") |
735 self.pluginManager.finalizeSetup() |
735 self.pluginManager.finalizeSetup() |
736 # now activate plugins having autoload set to True |
736 # now activate plugins having autoload set to True |
737 splash.showMessage(self.tr("Activating Plugins...")) |
737 splash.showMessage(self.tr("Activating Plugins...")) |
738 logging.getLogger(__name__).debug(self.tr("Activating Plugins...")) |
738 logging.getLogger(__name__).debug("Activating Plugins...") |
739 self.pluginManager.activatePlugins() |
739 self.pluginManager.activatePlugins() |
740 splash.showMessage(self.tr("Generating Plugins Toolbars...")) |
740 splash.showMessage(self.tr("Generating Plugins Toolbars...")) |
741 logging.getLogger(__name__).debug(self.tr("Generating Plugins Toolbars...")) |
741 logging.getLogger(__name__).debug("Generating Plugins Toolbars...") |
742 self.pluginManager.initPluginToolbars(self.toolbarManager) |
742 self.pluginManager.initPluginToolbars(self.toolbarManager) |
743 if Preferences.getPluginManager("StartupCleanup"): |
743 if Preferences.getPluginManager("StartupCleanup"): |
744 splash.showMessage(self.tr("Cleaning Plugins Download Area...")) |
744 splash.showMessage(self.tr("Cleaning Plugins Download Area...")) |
745 logging.getLogger(__name__).debug( |
745 logging.getLogger(__name__).debug("Cleaning Plugins Download Area...") |
746 self.tr("Cleaning Plugins Download Area...") |
|
747 ) |
|
748 PluginRepositoryDownloadCleanup(quiet=True) |
746 PluginRepositoryDownloadCleanup(quiet=True) |
749 |
747 |
750 if self.__findFileWidget: |
748 if self.__findFileWidget: |
751 self.__findFileWidget.populateFileCategories() |
749 self.__findFileWidget.populateFileCategories() |
752 |
750 |
753 # now read the keyboard shortcuts for all the actions |
751 # now read the keyboard shortcuts for all the actions |
754 Shortcuts.readShortcuts() |
752 Shortcuts.readShortcuts() |
755 |
753 |
756 # restore toolbar manager state |
754 # restore toolbar manager state |
757 splash.showMessage(self.tr("Restoring Toolbarmanager...")) |
755 splash.showMessage(self.tr("Restoring Toolbarmanager...")) |
758 logging.getLogger(__name__).debug(self.tr("Restoring Toolbarmanager...")) |
756 logging.getLogger(__name__).debug("Restoring Toolbarmanager...") |
759 self.toolbarManager.restoreState(Preferences.getUI("ToolbarManagerState")) |
757 self.toolbarManager.restoreState(Preferences.getUI("ToolbarManagerState")) |
760 |
758 |
761 if self.codeDocumentationViewer is not None: |
759 if self.codeDocumentationViewer is not None: |
762 # finalize the initialization of the code documentation viewer |
760 # finalize the initialization of the code documentation viewer |
763 self.codeDocumentationViewer.finalizeSetup() |
761 self.codeDocumentationViewer.finalizeSetup() |
764 |
762 |
765 # now activate the initial view profile |
763 # now activate the initial view profile |
766 splash.showMessage(self.tr("Setting View Profile...")) |
764 splash.showMessage(self.tr("Setting View Profile...")) |
767 logging.getLogger(__name__).debug(self.tr("Setting View Profile...")) |
765 logging.getLogger(__name__).debug("Setting View Profile...") |
768 self.__setEditProfile() |
766 self.__setEditProfile() |
769 |
767 |
770 # special treatment for the VCS toolbars |
768 # special treatment for the VCS toolbars |
771 for tb in self.getToolbarsByCategory("vcs"): |
769 for tb in self.getToolbarsByCategory("vcs"): |
772 tb.setVisible(False) |
770 tb.setVisible(False) |
776 if Preferences.getVCS("ShowVcsToolbar"): |
774 if Preferences.getVCS("ShowVcsToolbar"): |
777 tb.setVisible(True) |
775 tb.setVisible(True) |
778 |
776 |
779 # now read the saved tasks |
777 # now read the saved tasks |
780 splash.showMessage(self.tr("Reading Tasks...")) |
778 splash.showMessage(self.tr("Reading Tasks...")) |
781 logging.getLogger(__name__).debug(self.tr("Reading Tasks...")) |
779 logging.getLogger(__name__).debug("Reading Tasks...") |
782 self.__readTasks() |
780 self.__readTasks() |
783 |
781 |
784 if self.templateViewer is not None: |
782 if self.templateViewer is not None: |
785 # now read the saved templates |
783 # now read the saved templates |
786 splash.showMessage(self.tr("Reading Templates...")) |
784 splash.showMessage(self.tr("Reading Templates...")) |
787 logging.getLogger(__name__).debug(self.tr("Reading Templates...")) |
785 logging.getLogger(__name__).debug("Reading Templates...") |
788 self.templateViewer.readTemplates() |
786 self.templateViewer.readTemplates() |
789 |
787 |
790 # now start the debug client with the most recently used virtual |
788 # now start the debug client with the most recently used virtual |
791 # environment |
789 # environment |
792 splash.showMessage(self.tr("Starting Debugger...")) |
790 splash.showMessage(self.tr("Starting Debugger...")) |
793 logging.getLogger(__name__).debug(self.tr("Starting Debugger...")) |
791 logging.getLogger(__name__).debug("Starting Debugger...") |
794 if Preferences.getShell("StartWithMostRecentlyUsedEnvironment"): |
792 if Preferences.getShell("StartWithMostRecentlyUsedEnvironment"): |
795 venvName = Preferences.getShell("LastVirtualEnvironment") |
793 venvName = Preferences.getShell("LastVirtualEnvironment") |
796 if venvName == "embedded environment": |
794 if venvName == "embedded environment": |
797 venvName = "" |
795 venvName = "" |
798 self.__debugServer.startClient(False, venvName=venvName) |
796 self.__debugServer.startClient(False, venvName=venvName) |