mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 19:05:46 -05:00
[packagechooser] Add *packageNames* to package items
This is prep-work for connecting to the *packages* module by simply installing packages straight from packagechooser, rather than using a workaround.
This commit is contained in:
parent
dd52e10839
commit
a7f983db5f
2 changed files with 12 additions and 7 deletions
|
@ -34,9 +34,7 @@ packageChooserModeNames()
|
|||
|
||||
PackageItem::PackageItem() {}
|
||||
|
||||
PackageItem::PackageItem( const QString& a_id,
|
||||
const QString& a_name,
|
||||
const QString& a_description )
|
||||
PackageItem::PackageItem( const QString& a_id, const QString& a_name, const QString& a_description )
|
||||
: id( a_id )
|
||||
, name( a_name )
|
||||
, description( a_description )
|
||||
|
@ -59,6 +57,7 @@ PackageItem::PackageItem::PackageItem( const QVariantMap& item_map )
|
|||
, name( CalamaresUtils::Locale::TranslatedString( item_map, "name" ) )
|
||||
, description( CalamaresUtils::Locale::TranslatedString( item_map, "description" ) )
|
||||
, screenshot( CalamaresUtils::getString( item_map, "screenshot" ) )
|
||||
, packageNames( CalamaresUtils::getStringList( item_map, "packages" ) )
|
||||
{
|
||||
if ( name.isEmpty() && id.isEmpty() )
|
||||
{
|
||||
|
|
|
@ -34,6 +34,7 @@ struct PackageItem
|
|||
CalamaresUtils::Locale::TranslatedString name;
|
||||
CalamaresUtils::Locale::TranslatedString description;
|
||||
QPixmap screenshot;
|
||||
QStringList packageNames;
|
||||
|
||||
/// @brief Create blank PackageItem
|
||||
PackageItem();
|
||||
|
@ -50,16 +51,21 @@ struct PackageItem
|
|||
* @p screenshotPath, which may be a QRC path (:/path/in/qrc) or
|
||||
* a filesystem path, whatever QPixmap understands.
|
||||
*/
|
||||
PackageItem( const QString& id,
|
||||
const QString& name,
|
||||
const QString& description,
|
||||
const QString& screenshotPath );
|
||||
PackageItem( const QString& id, const QString& name, const QString& description, const QString& screenshotPath );
|
||||
|
||||
/** @brief Creates a PackageItem from a QVariantMap
|
||||
*
|
||||
* This is intended for use when loading PackageItems from a
|
||||
* configuration map. It will look up the various keys in the map
|
||||
* and handle translation strings as well.
|
||||
*
|
||||
* The following keys are used:
|
||||
* - *id*: the identifier for this item; if it is the empty string
|
||||
* then this is the special "no-package".
|
||||
* - *name* (and *name[lang]*): for the name and its translations
|
||||
* - *description* (and *description[lang]*)
|
||||
* - *screenshot*: a path to a screenshot for this package
|
||||
* - *packages*: a list of package names
|
||||
*/
|
||||
PackageItem( const QVariantMap& map );
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue