75 self.buttonBox.addButton(self.trUtf8("Close && Install"), |
75 self.buttonBox.addButton(self.trUtf8("Close && Install"), |
76 QDialogButtonBox.ActionRole) |
76 QDialogButtonBox.ActionRole) |
77 self.__downloadCancelButton.setEnabled(False) |
77 self.__downloadCancelButton.setEnabled(False) |
78 self.__installButton.setEnabled(False) |
78 self.__installButton.setEnabled(False) |
79 |
79 |
|
80 self.repositoryUrlEdit.setText(Preferences.getUI("PluginRepositoryUrl5")) |
|
81 |
80 self.repositoryList.headerItem().setText(self.repositoryList.columnCount(), "") |
82 self.repositoryList.headerItem().setText(self.repositoryList.columnCount(), "") |
81 self.repositoryList.header().setSortIndicator(0, Qt.AscendingOrder) |
83 self.repositoryList.header().setSortIndicator(0, Qt.AscendingOrder) |
82 |
84 |
83 self.pluginRepositoryFile = \ |
85 self.pluginRepositoryFile = \ |
84 os.path.join(Utilities.getConfigDir(), "PluginRepository") |
86 os.path.join(Utilities.getConfigDir(), "PluginRepository") |
182 |
184 |
183 def __updateList(self): |
185 def __updateList(self): |
184 """ |
186 """ |
185 Private slot to download a new list and display the contents. |
187 Private slot to download a new list and display the contents. |
186 """ |
188 """ |
187 url = Preferences.getUI("PluginRepositoryUrl5") |
189 url = self.repositoryUrlEdit.text() |
188 self.__downloadFile(url, |
190 self.__downloadFile(url, |
189 self.pluginRepositoryFile, |
191 self.pluginRepositoryFile, |
190 self.__downloadRepositoryFileDone) |
192 self.__downloadRepositoryFileDone) |
191 |
193 |
192 def __downloadRepositoryFileDone(self, status, filename): |
194 def __downloadRepositoryFileDone(self, status, filename): |
288 reader.readXML() |
290 reader.readXML() |
289 self.repositoryList.resizeColumnToContents(0) |
291 self.repositoryList.resizeColumnToContents(0) |
290 self.repositoryList.resizeColumnToContents(1) |
292 self.repositoryList.resizeColumnToContents(1) |
291 self.repositoryList.resizeColumnToContents(2) |
293 self.repositoryList.resizeColumnToContents(2) |
292 self.__resortRepositoryList() |
294 self.__resortRepositoryList() |
|
295 url = Preferences.getUI("PluginRepositoryUrl5") |
|
296 if url != self.repositoryUrlEdit.text(): |
|
297 self.repositoryUrlEdit.setText(url) |
|
298 E5MessageBox.warning(self, |
|
299 self.trUtf8("Plugins Repository URL Changed"), |
|
300 self.trUtf8("""The URL of the Plugins Repository has""" |
|
301 """ changed. Select the "Update" button to get""" |
|
302 """ the new repository file.""")) |
293 else: |
303 else: |
294 E5MessageBox.critical(self, |
304 E5MessageBox.critical(self, |
295 self.trUtf8("Read plugins repository file"), |
305 self.trUtf8("Read plugins repository file"), |
296 self.trUtf8("<p>The plugins repository file <b>{0}</b> " |
306 self.trUtf8("<p>The plugins repository file <b>{0}</b> " |
297 "could not be read. Select Update</p>")\ |
307 "could not be read. Select Update</p>")\ |
502 Public method to get the list of recently downloaded plugin files. |
512 Public method to get the list of recently downloaded plugin files. |
503 |
513 |
504 @return list of plugin filenames (list of strings) |
514 @return list of plugin filenames (list of strings) |
505 """ |
515 """ |
506 return self.__pluginsDownloaded |
516 return self.__pluginsDownloaded |
|
517 |
|
518 @pyqtSlot(bool) |
|
519 def on_repositoryUrlEditButton_toggled(self, checked): |
|
520 """ |
|
521 Private slot to set the read only status of the repository URL line edit. |
|
522 |
|
523 @param checked state of the push button (boolean) |
|
524 """ |
|
525 self.repositoryUrlEdit.setReadOnly(not checked) |
507 |
526 |
508 |
527 |
509 class PluginRepositoryDialog(QDialog): |
528 class PluginRepositoryDialog(QDialog): |
510 """ |
529 """ |
511 Class for the dialog variant. |
530 Class for the dialog variant. |