25 QDialog, QSplitter, QApplication, QMenu, QVBoxLayout, QDockWidget, \ |
25 QDialog, QSplitter, QApplication, QMenu, QVBoxLayout, QDockWidget, \ |
26 QAction, QLabel |
26 QAction, QLabel |
27 from PyQt5.Qsci import QSCINTILLA_VERSION_STR |
27 from PyQt5.Qsci import QSCINTILLA_VERSION_STR |
28 from PyQt5.QtNetwork import QNetworkProxyFactory, QNetworkAccessManager, \ |
28 from PyQt5.QtNetwork import QNetworkProxyFactory, QNetworkAccessManager, \ |
29 QNetworkRequest, QNetworkReply |
29 QNetworkRequest, QNetworkReply |
|
30 |
|
31 from Globals import qVersionTuple |
30 try: |
32 try: |
31 from PyQt5 import QtWebKit # __IGNORE_WARNING__ |
33 from PyQt5 import QtWebKit # __IGNORE_WARNING__ |
32 WEBKIT_AVAILABLE = True |
34 WEBKIT_AVAILABLE = True |
33 except ImportError: |
35 except ImportError: |
34 WEBKIT_AVAILABLE = False |
36 WEBKIT_AVAILABLE = False |
35 if qVersion() < "5.6.0": |
37 if qVersionTuple() < (5, 6, 0): |
36 WEBENGINE_AVAILABLE = False |
38 WEBENGINE_AVAILABLE = False |
37 else: |
39 else: |
38 try: |
40 try: |
39 from PyQt5 import QtWebEngineWidgets # __IGNORE_WARNING__ |
41 from PyQt5 import QtWebEngineWidgets # __IGNORE_WARNING__ |
40 WEBENGINE_AVAILABLE = True |
42 WEBENGINE_AVAILABLE = True |
573 self.SAServer = E5SingleApplicationServer() |
575 self.SAServer = E5SingleApplicationServer() |
574 else: |
576 else: |
575 self.SAServer = None |
577 self.SAServer = None |
576 |
578 |
577 # now finalize the plugin manager setup |
579 # now finalize the plugin manager setup |
|
580 splash.showMessage(self.tr("Initializing Plugins...")) |
578 self.pluginManager.finalizeSetup() |
581 self.pluginManager.finalizeSetup() |
579 # now activate plugins having autoload set to True |
582 # now activate plugins having autoload set to True |
580 splash.showMessage(self.tr("Activating Plugins...")) |
583 splash.showMessage(self.tr("Activating Plugins...")) |
581 self.pluginManager.activatePlugins() |
584 self.pluginManager.activatePlugins() |
582 splash.showMessage(self.tr("Generating Plugins Toolbars...")) |
585 splash.showMessage(self.tr("Generating Plugins Toolbars...")) |
583 self.pluginManager.initPluginToolbars(self.toolbarManager) |
586 self.pluginManager.initPluginToolbars(self.toolbarManager) |
|
587 if Preferences.getPluginManager("StartupCleanup"): |
|
588 splash.showMessage(self.tr("Cleaning Plugins Download Area...")) |
|
589 from PluginManager.PluginRepositoryDialog import \ |
|
590 PluginRepositoryDownloadCleanup |
|
591 PluginRepositoryDownloadCleanup(quiet=True) |
584 |
592 |
585 # now read the keyboard shortcuts for all the actions |
593 # now read the keyboard shortcuts for all the actions |
586 from Preferences import Shortcuts |
594 from Preferences import Shortcuts |
587 Shortcuts.readShortcuts() |
595 Shortcuts.readShortcuts() |
588 |
596 |
3190 Utilities.generateVersionInfo("\r\n"), |
3198 Utilities.generateVersionInfo("\r\n"), |
3191 Utilities.generatePluginsVersionInfo("\r\n"), |
3199 Utilities.generatePluginsVersionInfo("\r\n"), |
3192 Utilities.generateDistroInfo("\r\n")) |
3200 Utilities.generateDistroInfo("\r\n")) |
3193 |
3201 |
3194 url = QUrl("mailto:{0}".format(address)) |
3202 url = QUrl("mailto:{0}".format(address)) |
3195 if qVersion() >= "5.0.0": |
3203 if qVersionTuple() >= (5, 0, 0): |
3196 from PyQt5.QtCore import QUrlQuery |
3204 from PyQt5.QtCore import QUrlQuery |
3197 urlQuery = QUrlQuery(url) |
3205 urlQuery = QUrlQuery(url) |
3198 urlQuery.addQueryItem("subject", subject) |
3206 urlQuery.addQueryItem("subject", subject) |
3199 urlQuery.addQueryItem("body", body) |
3207 urlQuery.addQueryItem("body", body) |
3200 url.setQuery(urlQuery) |
3208 url.setQuery(urlQuery) |
3617 |
3625 |
3618 @param menu reference to the menu to be populated (QMenu) |
3626 @param menu reference to the menu to be populated (QMenu) |
3619 """ |
3627 """ |
3620 menu.clear() |
3628 menu.clear() |
3621 |
3629 |
3622 tbList = [] |
3630 for name, (text, tb) in sorted(self.__toolbars.items(), |
3623 for name, (text, tb) in list(self.__toolbars.items()): |
3631 key=lambda t: t[1][0]): |
3624 tbList.append((text, tb, name)) |
|
3625 |
|
3626 for text, tb, name in sorted(tbList, key=lambda t: t[0]): |
|
3627 act = menu.addAction(text) |
3632 act = menu.addAction(text) |
3628 act.setCheckable(True) |
3633 act.setCheckable(True) |
3629 act.setChecked(not tb.isHidden()) |
3634 act.setChecked(not tb.isHidden()) |
3630 act.setData(name) |
3635 act.setData(name) |
3631 menu.addSeparator() |
3636 menu.addSeparator() |