UI/UserInterface.py

branch
maintenance
changeset 5752
1860eca908e4
parent 5730
6422afc7adc4
parent 5743
630a68372016
child 5773
899700885725
diff -r 54829a44cea5 -r 1860eca908e4 UI/UserInterface.py
--- a/UI/UserInterface.py	Sat May 06 13:44:26 2017 +0200
+++ b/UI/UserInterface.py	Sat Jun 03 13:08:50 2017 +0200
@@ -27,12 +27,14 @@
 from PyQt5.Qsci import QSCINTILLA_VERSION_STR
 from PyQt5.QtNetwork import QNetworkProxyFactory, QNetworkAccessManager, \
     QNetworkRequest, QNetworkReply
+
+from Globals import qVersionTuple
 try:
     from PyQt5 import QtWebKit      # __IGNORE_WARNING__
     WEBKIT_AVAILABLE = True
 except ImportError:
     WEBKIT_AVAILABLE = False
-if qVersion() < "5.6.0":
+if qVersionTuple() < (5, 6, 0):
     WEBENGINE_AVAILABLE = False
 else:
     try:
@@ -575,12 +577,18 @@
             self.SAServer = None
         
         # now finalize the plugin manager setup
+        splash.showMessage(self.tr("Initializing Plugins..."))
         self.pluginManager.finalizeSetup()
         # now activate plugins having autoload set to True
         splash.showMessage(self.tr("Activating Plugins..."))
         self.pluginManager.activatePlugins()
         splash.showMessage(self.tr("Generating Plugins Toolbars..."))
         self.pluginManager.initPluginToolbars(self.toolbarManager)
+        if Preferences.getPluginManager("StartupCleanup"):
+            splash.showMessage(self.tr("Cleaning Plugins Download Area..."))
+            from PluginManager.PluginRepositoryDialog import \
+                PluginRepositoryDownloadCleanup
+            PluginRepositoryDownloadCleanup(quiet=True)
         
         # now read the keyboard shortcuts for all the actions
         from Preferences import Shortcuts
@@ -3192,7 +3200,7 @@
                 Utilities.generateDistroInfo("\r\n"))
         
         url = QUrl("mailto:{0}".format(address))
-        if qVersion() >= "5.0.0":
+        if qVersionTuple() >= (5, 0, 0):
             from PyQt5.QtCore import QUrlQuery
             urlQuery = QUrlQuery(url)
             urlQuery.addQueryItem("subject", subject)
@@ -3619,11 +3627,8 @@
         """
         menu.clear()
         
-        tbList = []
-        for name, (text, tb) in list(self.__toolbars.items()):
-            tbList.append((text, tb, name))
-        
-        for text, tb, name in sorted(tbList, key=lambda t: t[0]):
+        for name, (text, tb) in sorted(self.__toolbars.items(),
+                                       key=lambda t: t[1][0]):
             act = menu.addAction(text)
             act.setCheckable(True)
             act.setChecked(not tb.isHidden())

eric ide

mercurial