eric7/PluginManager/PluginRepositoryDialog.py

branch
eric7
changeset 9031
8c9013b363bc
parent 9016
6f079c524e99
equal deleted inserted replaced
9030:13a03f9eee6b 9031:8c9013b363bc
100 self.__actionButtonsLayout.addStretch() 100 self.__actionButtonsLayout.addStretch()
101 101
102 self.__updateButton = QToolButton(self) 102 self.__updateButton = QToolButton(self)
103 self.__updateButton.setIcon(UI.PixmapCache.getIcon("reload")) 103 self.__updateButton.setIcon(UI.PixmapCache.getIcon("reload"))
104 self.__updateButton.setToolTip(self.tr("Update")) 104 self.__updateButton.setToolTip(self.tr("Update"))
105 self.__updateButton.clicked.connect(self.updateList) 105 self.__updateButton.clicked.connect(self.__updateList)
106 self.__actionButtonsLayout.addWidget(self.__updateButton) 106 self.__actionButtonsLayout.addWidget(self.__updateButton)
107 107
108 self.__downloadButton = QToolButton(self) 108 self.__downloadButton = QToolButton(self)
109 self.__downloadButton.setIcon(UI.PixmapCache.getIcon("download")) 109 self.__downloadButton.setIcon(UI.PixmapCache.getIcon("download"))
110 self.__downloadButton.setToolTip(self.tr("Download")) 110 self.__downloadButton.setToolTip(self.tr("Download"))
184 self.tr("Cleanup Downloads"), self.__cleanupDownloads) 184 self.tr("Cleanup Downloads"), self.__cleanupDownloads)
185 185
186 self.pluginRepositoryFile = os.path.join(Utilities.getConfigDir(), 186 self.pluginRepositoryFile = os.path.join(Utilities.getConfigDir(),
187 "PluginRepository") 187 "PluginRepository")
188 188
189 self.__pluginManager.pluginRepositoryFileDownloaded.connect(
190 self.__populateList)
191
189 # attributes for the network objects 192 # attributes for the network objects
190 self.__networkManager = QNetworkAccessManager(self) 193 self.__networkManager = QNetworkAccessManager(self)
191 self.__networkManager.proxyAuthenticationRequired.connect( 194 self.__networkManager.proxyAuthenticationRequired.connect(
192 proxyAuthenticationRequired) 195 proxyAuthenticationRequired)
193 if SSL_AVAILABLE: 196 if SSL_AVAILABLE:
244 Private slot to handle the click of a button of the button box. 247 Private slot to handle the click of a button of the button box.
245 248
246 @param button reference to the button pressed (QAbstractButton) 249 @param button reference to the button pressed (QAbstractButton)
247 """ 250 """
248 if button == self.__updateButton: 251 if button == self.__updateButton:
249 self.updateList() 252 self.__updateList()
250 elif button == self.__downloadButton: 253 elif button == self.__downloadButton:
251 self.__downloadButtonClicked() 254 self.__downloadButtonClicked()
252 elif button == self.__downloadInstallButton: 255 elif button == self.__downloadInstallButton:
253 self.__downloadInstallButtonClicked() 256 self.__downloadInstallButtonClicked()
254 elif button == self.__downloadCancelButton: 257 elif button == self.__downloadCancelButton:
371 enable = bool(self.__selectedItems()) 374 enable = bool(self.__selectedItems())
372 self.__downloadButton.setEnabled(enable and self.__online) 375 self.__downloadButton.setEnabled(enable and self.__online)
373 self.__downloadInstallButton.setEnabled(enable and self.__online) 376 self.__downloadInstallButton.setEnabled(enable and self.__online)
374 self.__installButton.setEnabled(enable) 377 self.__installButton.setEnabled(enable)
375 378
376 def updateList(self): 379 def reloadList(self):
377 """ 380 """
378 Public slot to download a new list and display the contents. 381 Public method to reload the list of plugins.
382 """
383 self.__populateList()
384
385 @pyqtSlot()
386 def __updateList(self):
387 """
388 Private slot to download a new list and display the contents.
379 """ 389 """
380 url = self.repositoryUrlEdit.text() 390 url = self.repositoryUrlEdit.text()
381 self.__downloadFile(url, 391 self.__pluginManager.downLoadRepositoryFile(url=url)
382 self.pluginRepositoryFile,
383 self.__downloadRepositoryFileDone)
384 392
385 def __downloadRepositoryFileDone(self, status, filename): 393 def __downloadRepositoryFileDone(self, status, filename):
386 """ 394 """
387 Private method called after the repository file was downloaded. 395 Private method called after the repository file was downloaded.
388 396

eric ide

mercurial