diff --git a/src/modules/packagechooser/PackageChooserViewStep.cpp b/src/modules/packagechooser/PackageChooserViewStep.cpp index a3b853b39..fadacf8d4 100644 --- a/src/modules/packagechooser/PackageChooserViewStep.cpp +++ b/src/modules/packagechooser/PackageChooserViewStep.cpp @@ -232,7 +232,14 @@ PackageChooserViewStep::fillModel( const QVariantList& items ) continue; } - m_model->addPackage( PackageItem( item_map ) ); + if ( item_map.contains( "appdata" ) ) + { + m_model->addPackage( PackageItem::fromAppData( CalamaresUtils::getString( item_map, "appdata" ) ) ); + } + else + { + m_model->addPackage( PackageItem( item_map ) ); + } } } diff --git a/src/modules/packagechooser/packagechooser.conf b/src/modules/packagechooser/packagechooser.conf index 7d60b50a4..f20d1da77 100644 --- a/src/modules/packagechooser/packagechooser.conf +++ b/src/modules/packagechooser/packagechooser.conf @@ -24,8 +24,11 @@ mode: required # pretty short list to avoid overwhelming the UI. This is a list # of objects, and the items are displayed in list order. # -# Each item has an id, which is used in setting # the value of -# *packagechooser_*). The following fields +# Either provide the data for an item in the list (using the keys +# below), or use existing AppData XML files as a source for the data. +# +# For data provided by the list: the item has an id, which is used in +# setting the value of *packagechooser_*). The following fields # are mandatory: # # - *id* ID for the product. The ID "" is special, and is used for @@ -33,13 +36,24 @@ mode: required # selecting none. # - *package* Package name for the product. While mandatory, this is # not actually used anywhere. -# - *name* Human-readable, but untranslated, name of the product. -# - *description* Human-readable, but untranslated, description. +# - *name* Human-readable name of the product. To provide translations, +# add a *[lang]* decoration as part of the key name, e.g. `name[nl]` +# for Dutch. The list of usable languages can be found in +# `CMakeLists.txt` or as part of the debug output of Calamares. +# - *description* Human-readable description. These can be translated +# as well. # - *screenshot* Path to a single screenshot of the product. May be # a filesystem path or a QRC path (e.g. ":/images/no-selection.png"). # # Use the empty string "" as ID / key for the "no selection" item if # you want to customize the display of that item as well. +# +# For data provided by AppData XML: the item has an *appdata* +# key which points to an AppData XML file in the local filesystem. +# This file is parsed to provide the id (from AppData id), name +# (from AppData name), description (from AppData description paragraphs +# or the summary entries), and a screenshot (the defautl screenshot +# from AppData). No package is set (but that is unused anyway). items: - id: "" package: "" @@ -58,5 +72,5 @@ items: name: GNOME description: GNU Networked Object Modeling Environment Desktop screenshot: ":/images/gnome.png" - + - appdata: ../io.calamares.calamares.appdata.xml