def selection_changed(self): try: app_name = self.ui.listAppsWidget.currentItem().text() except Exception: app_name = None if app_name is not None: info = metadata.dictionary(app_name, repo=HOST) # Set active tab to first self.ui.tabMetadata.setCurrentIndex(0) # Load icon self.load_icon(app_name=app_name, repo=HOST) self.ui.appname.setText(info.get("display_name")) self.ui.SelectionInfoBox.setTitle("Metadata: " + info.get("display_name")) self.ui.label_displayname.setText(info.get("display_name")) self.ui.version.setText(info.get("version")) self.ui.contributors.setText(info.get("contributors")) self.ui.releasedate.setText(info.get("release_date")) self.ui.developer.setText(info.get("coder")) if info.get("short_description") == "Unknown": self.ui.label_description.setText("No description specified.") else: self.ui.label_description.setText( info.get("short_description")) self.ui.longDescriptionBrowser.setText( info.get("long_description")) self.ui.FileNameLineEdit.setText(app_name + ".zip") self.ui.DirectLinkLineEdit.setText( metadata.url(app_name, repo=HOST)) self.ui.progressBar.setValue(0) self.status_message("Ready to download")
def selection_changed(self): app_name = self.ui.listAppsWidget.currentItem().text() info = metadata.dictionary(app_name) self.ui.appname.setText(info.get("display_name")) self.ui.SelectionInfoBox.setTitle("Metadata: " + info.get("display_name")) self.ui.label_displayname.setText(info.get("display_name")) self.ui.version.setText(info.get("version")) self.ui.contributors.setText(info.get("contributors")) self.ui.releasedate.setText(info.get("release_date")) self.ui.developer.setText(info.get("coder")) if info.get("short_description") == "Unknown": self.ui.label_description.setText("No description specified.") else: self.ui.label_description.setText(info.get("short_description")) self.ui.longDescriptionBrowser.setText(info.get("long_description")) self.ui.FileNameLineEdit.setText(app_name + ".zip") self.ui.progressBar.setValue(0)
def on_selection(self, event): w = event.widget selection = w.get(w.curselection()[0]) info = metadata.dictionary(selection) self.general_page.update(info) self.update_icon(download(metadata.icon(selection)))