CondaInterface/CondaPackagesWidget.py

branch
conda
changeset 6738
a7f835b41606
parent 6731
c70eaa492741
child 6771
bcffbb627791
--- a/CondaInterface/CondaPackagesWidget.py	Wed Feb 13 19:03:29 2019 +0100
+++ b/CondaInterface/CondaPackagesWidget.py	Wed Feb 13 19:48:48 2019 +0100
@@ -51,6 +51,21 @@
         
         self.__conda = conda
         
+        if not CondaInterface.isCondaAvailable():
+            self.baseWidget.hide()
+            self.searchWidget.hide()
+        
+        else:
+            self.notAvailableWidget.hide()
+            
+            self.__initCondaInterface()
+    
+    def __initCondaInterface(self):
+        """
+        Private method to initialize the conda interface elements.
+        """
+        self.statusLabel.hide()
+        
         self.condaMenuButton.setObjectName(
             "navigation_supermenu_button")
         self.condaMenuButton.setIcon(UI.PixmapCache.getIcon("superMenu.png"))
@@ -196,6 +211,8 @@
         prefix = self.environmentsComboBox.itemData(index)
         if prefix:
             QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
+            self.statusLabel.show()
+            self.statusLabel.setText(self.tr("Getting installed packages..."))
             QApplication.processEvents()
             
             # 1. populate with installed packages
@@ -207,6 +224,7 @@
                 itm.setData(1, self.PackageVersionRole, version)
                 itm.setData(1, self.PackageBuildRole, build)
             self.packagesList.setUpdatesEnabled(True)
+            self.statusLabel.setText(self.tr("Getting outdated packages..."))
             QApplication.processEvents()
             
             # 2. update with update information
@@ -237,6 +255,7 @@
                 self.packagesList.resizeColumnToContents(col)
             self.packagesList.setUpdatesEnabled(True)
             QApplication.restoreOverrideCursor()
+            self.statusLabel.hide()
         
         self.__updateActionButtons()
         self.__updateSearchActionButtons()
@@ -681,3 +700,15 @@
         Private slot to open the configuration page.
         """
         e5App().getObject("UserInterface").showPreferences("condaPage")
+    
+    @pyqtSlot()
+    def on_recheckButton_clicked(self):
+        """
+        Private slot to re-check the availability of conda and adjust the
+        interface if it became available.
+        """
+        if CondaInterface.isCondaAvailable():
+            self.__initCondaInterface()
+            
+            self.notAvailableWidget.hide()
+            self.baseWidget.show()

eric ide

mercurial