UI/UserInterface.py

changeset 6931
faac36ec9d76
parent 6896
3716c4af48bb
child 6937
25317a7b5d40
--- a/UI/UserInterface.py	Sat Apr 06 16:33:49 2019 +0200
+++ b/UI/UserInterface.py	Sun Apr 07 19:55:21 2019 +0200
@@ -757,6 +757,12 @@
         self.__previewer = Previewer(self.viewmanager, splitter)
         splitter.addWidget(self.__previewer)
         
+        # Create AST viewer
+        logging.debug("Creating Python AST Viewer")
+        from .PythonAstViewer import PythonAstViewer
+        self.__astViewer = PythonAstViewer(self.viewmanager, splitter)
+        splitter.addWidget(self.__astViewer)
+        
         # Create layout with toolbox windows embedded in dock windows
         if self.__layoutType == "Toolboxes":
             logging.debug("Creating toolboxes...")
@@ -2872,6 +2878,14 @@
                 self.tr("Code Documentation Viewer"),
                 self.activateCodeDocumentationViewer)
         self.__menus["subwindow"].addAction(self.debugViewerActivateAct)
+        if self.pipWidget is not None:
+            self.__menus["subwindow"].addAction(
+                self.tr("PyPI"),
+                self.__activatePipWidget)
+        if self.condaWidget is not None:
+            self.__menus["subwindow"].addAction(
+                self.tr("Conda"),
+                self.__activateCondaWidget)
         if self.cooperation is not None:
             self.__menus["subwindow"].addAction(
                 self.cooperationViewerActivateAct)
@@ -4449,6 +4463,36 @@
                 self.codeDocumentationViewer.setFocus(
                     Qt.ActiveWindowFocusReason)
     
+    def __activatePipWidget(self):
+        """
+        Private slot to handle the activation of the PyPI manager widget.
+        """
+        if self.pipWidget is not None:
+            if self.__layoutType == "Toolboxes":
+                self.rToolboxDock.show()
+                self.rToolbox.setCurrentWidget(self.pipWidget)
+            elif self.__layoutType == "Sidebars":
+                self.rightSidebar.show()
+                self.rightSidebar.setCurrentWidget(self.pipWidget)
+            else:
+                self.pipWidget.show()
+            self.pipWidget.setFocus(Qt.ActiveWindowFocusReason)
+    
+    def __activateCondaWidget(self):
+        """
+        Private slot to handle the activation of the Conda manager widget.
+        """
+        if self.condaWidget is not None:
+            if self.__layoutType == "Toolboxes":
+                self.rToolboxDock.show()
+                self.rToolbox.setCurrentWidget(self.condaWidget)
+            elif self.__layoutType == "Sidebars":
+                self.rightSidebar.show()
+                self.rightSidebar.setCurrentWidget(self.condaWidget)
+            else:
+                self.condaWidget.show()
+            self.condaWidget.setFocus(Qt.ActiveWindowFocusReason)
+    
     def __toggleWindow(self, w):
         """
         Private method to toggle a workspace editor window.
@@ -6623,6 +6667,8 @@
         
         sessionCreated = self.__writeSession()
         
+        self.__astViewer.hide()
+        
         if not self.project.closeProject():
             return False
         
@@ -6640,6 +6686,8 @@
         
         self.__previewer.shutdown()
         
+        self.__astViewer.shutdown()
+        
         self.shell.closeShell()
         
         self.__writeTasks()

eric ide

mercurial