127 @param previous reference to the old current item (QTreeWidgetItem) |
127 @param previous reference to the old current item (QTreeWidgetItem) |
128 """ |
128 """ |
129 if self.__repositoryMissing or current is None: |
129 if self.__repositoryMissing or current is None: |
130 return |
130 return |
131 |
131 |
132 self.urlEdit.setText(current.data(0, urlRole).toString()) |
132 self.urlEdit.setText(current.data(0, urlRole)) |
133 self.descriptionEdit.setPlainText( |
133 self.descriptionEdit.setPlainText( |
134 self.__formatDescription(current.data(0, descrRole).toStringList())) |
134 self.__formatDescription(current.data(0, descrRole))) |
135 self.authorEdit.setText(current.data(0, authorRole).toString()) |
135 self.authorEdit.setText(current.data(0, authorRole)) |
136 |
136 |
137 def __selectedItems(self): |
137 def __selectedItems(self): |
138 """ |
138 """ |
139 Private method to get all selected items without the toplevel ones. |
139 Private method to get all selected items without the toplevel ones. |
140 |
140 |
204 self.__pluginsToDownload = [] |
204 self.__pluginsToDownload = [] |
205 self.__downloadButton.setEnabled(False) |
205 self.__downloadButton.setEnabled(False) |
206 self.__installButton.setEnabled(False) |
206 self.__installButton.setEnabled(False) |
207 for itm in self.repositoryList.selectedItems(): |
207 for itm in self.repositoryList.selectedItems(): |
208 if itm not in [self.__stableItem, self.__unstableItem, self.__unknownItem]: |
208 if itm not in [self.__stableItem, self.__unstableItem, self.__unknownItem]: |
209 url = itm.data(0, urlRole).toString() |
209 url = itm.data(0, urlRole) |
210 filename = os.path.join( |
210 filename = os.path.join( |
211 Preferences.getPluginManager("DownloadPath"), |
211 Preferences.getPluginManager("DownloadPath"), |
212 itm.data(0, filenameRole).toString()) |
212 itm.data(0, filenameRole)) |
213 self.__pluginsToDownload.append((url, filename)) |
213 self.__pluginsToDownload.append((url, filename)) |
214 self.__downloadPlugin() |
214 self.__downloadPlugin() |
215 |
215 |
216 def __downloadPluginsDone(self): |
216 def __downloadPluginsDone(self): |
217 """ |
217 """ |
471 QTreeWidgetItem(self.repositoryList, [self.trUtf8("Unknown")]) |
471 QTreeWidgetItem(self.repositoryList, [self.trUtf8("Unknown")]) |
472 self.__unknownItem.setExpanded(True) |
472 self.__unknownItem.setExpanded(True) |
473 parent = self.__unknownItem |
473 parent = self.__unknownItem |
474 itm = QTreeWidgetItem(parent, [name, version, short]) |
474 itm = QTreeWidgetItem(parent, [name, version, short]) |
475 |
475 |
476 itm.setData(0, urlRole, QVariant(url)) |
476 itm.setData(0, urlRole, url) |
477 itm.setData(0, filenameRole, QVariant(filename)) |
477 itm.setData(0, filenameRole, filename) |
478 itm.setData(0, authorRole, QVariant(author)) |
478 itm.setData(0, authorRole, author) |
479 itm.setData(0, descrRole, QVariant(description)) |
479 itm.setData(0, descrRole, description) |
480 |
480 |
481 if self.__isUpToDate(filename, version): |
481 if self.__isUpToDate(filename, version): |
482 itm.setIcon(1, UI.PixmapCache.getIcon("empty.png")) |
482 itm.setIcon(1, UI.PixmapCache.getIcon("empty.png")) |
483 else: |
483 else: |
484 itm.setIcon(1, UI.PixmapCache.getIcon("download.png")) |
484 itm.setIcon(1, UI.PixmapCache.getIcon("download.png")) |