PluginManager/PluginRepositoryDialog.py

changeset 2192
61b3849df76d
parent 2101
5bac7dee9e1a
child 2302
f29e9405c851
equal deleted inserted replaced
2191:7c7251ce9497 2192:61b3849df76d
24 24
25 from .Ui_PluginRepositoryDialog import Ui_PluginRepositoryDialog 25 from .Ui_PluginRepositoryDialog import Ui_PluginRepositoryDialog
26 26
27 from E5Gui import E5MessageBox 27 from E5Gui import E5MessageBox
28 from E5Gui.E5MainWindow import E5MainWindow 28 from E5Gui.E5MainWindow import E5MainWindow
29 from E5Gui.E5Application import e5App
29 30
30 from E5XML.PluginRepositoryReader import PluginRepositoryReader 31 from E5XML.PluginRepositoryReader import PluginRepositoryReader
31 32
32 from E5Network.E5NetworkProxyFactory import proxyAuthenticationRequired 33 from E5Network.E5NetworkProxyFactory import proxyAuthenticationRequired
33 34
50 51
51 @signal closeAndInstall() emitted when the Close & Install button is pressed 52 @signal closeAndInstall() emitted when the Close & Install button is pressed
52 """ 53 """
53 closeAndInstall = pyqtSignal() 54 closeAndInstall = pyqtSignal()
54 55
55 def __init__(self, parent=None): 56 def __init__(self, parent=None, external=False):
56 """ 57 """
57 Constructor 58 Constructor
58 59
59 @param parent parent of this dialog (QWidget) 60 @param parent parent of this dialog (QWidget)
60 """ 61 """
84 self.repositoryList.header().setSortIndicator(0, Qt.AscendingOrder) 85 self.repositoryList.header().setSortIndicator(0, Qt.AscendingOrder)
85 86
86 self.pluginRepositoryFile = \ 87 self.pluginRepositoryFile = \
87 os.path.join(Utilities.getConfigDir(), "PluginRepository") 88 os.path.join(Utilities.getConfigDir(), "PluginRepository")
88 89
90 self.__external = external
91
89 # attributes for the network objects 92 # attributes for the network objects
90 self.__networkManager = QNetworkAccessManager(self) 93 self.__networkManager = QNetworkAccessManager(self)
91 self.__networkManager.proxyAuthenticationRequired.connect( 94 self.__networkManager.proxyAuthenticationRequired.connect(
92 proxyAuthenticationRequired) 95 proxyAuthenticationRequired)
93 if SSL_AVAILABLE: 96 if SSL_AVAILABLE:
251 """ 254 """
252 self.__downloadButton.setEnabled(len(self.__selectedItems())) 255 self.__downloadButton.setEnabled(len(self.__selectedItems()))
253 self.__downloadInstallButton.setEnabled(len(self.__selectedItems())) 256 self.__downloadInstallButton.setEnabled(len(self.__selectedItems()))
254 self.__installButton.setEnabled(True) 257 self.__installButton.setEnabled(True)
255 self.__doneMethod = None 258 self.__doneMethod = None
259 if not self.__external:
260 ui = e5App().getObject("UserInterface")
261 else:
262 ui = None
263 if ui and ui.notificationsEnabled():
264 ui.showNotification(UI.PixmapCache.getPixmap("plugin48.png"),
265 self.trUtf8("Download Plugin Files"),
266 self.trUtf8("""The requested plugins were downloaded."""))
267
256 if self.__isDownloadInstall: 268 if self.__isDownloadInstall:
257 self.closeAndInstall.emit() 269 self.closeAndInstall.emit()
258 else: 270 else:
259 E5MessageBox.information(self, 271 if ui is None or not ui.notificationsEnabled():
260 self.trUtf8("Download Plugin Files"), 272 E5MessageBox.information(self,
261 self.trUtf8("""The requested plugins were downloaded.""")) 273 self.trUtf8("Download Plugin Files"),
274 self.trUtf8("""The requested plugins were downloaded."""))
262 self.downloadProgress.setValue(0) 275 self.downloadProgress.setValue(0)
263 276
264 # repopulate the list to update the refresh icons 277 # repopulate the list to update the refresh icons
265 self.__populateList() 278 self.__populateList()
266 279
579 Constructor 592 Constructor
580 593
581 @param parent reference to the parent widget (QWidget) 594 @param parent reference to the parent widget (QWidget)
582 """ 595 """
583 super().__init__(parent) 596 super().__init__(parent)
584 self.cw = PluginRepositoryWidget(self) 597 self.cw = PluginRepositoryWidget(self, external=True)
585 size = self.cw.size() 598 size = self.cw.size()
586 self.setCentralWidget(self.cw) 599 self.setCentralWidget(self.cw)
587 self.resize(size) 600 self.resize(size)
588 601
589 self.setStyle(Preferences.getUI("Style"), Preferences.getUI("StyleSheet")) 602 self.setStyle(Preferences.getUI("Style"), Preferences.getUI("StyleSheet"))

eric ide

mercurial