[packagechooserq] Apply renaming also to distro-visible code
- The distro-visible key is renamed *pkgc* to *packageChoice* - Read *packageChoice* only if there are no items to use
This commit is contained in:
parent
8b703ba6a3
commit
8a49fde016
@ -204,7 +204,6 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
PackageChooserMode::Required );
|
PackageChooserMode::Required );
|
||||||
m_method = PackageChooserMethodNames().find( CalamaresUtils::getString( configurationMap, "method" ),
|
m_method = PackageChooserMethodNames().find( CalamaresUtils::getString( configurationMap, "method" ),
|
||||||
PackageChooserMethod::Legacy );
|
PackageChooserMethod::Legacy );
|
||||||
setPackageChoice( CalamaresUtils::getString( configurationMap, "pkgc" ) );
|
|
||||||
|
|
||||||
if ( m_method == PackageChooserMethod::Legacy )
|
if ( m_method == PackageChooserMethod::Legacy )
|
||||||
{
|
{
|
||||||
@ -233,21 +232,25 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
if ( configurationMap.contains( "items" ) )
|
if ( configurationMap.contains( "items" ) )
|
||||||
{
|
{
|
||||||
fillModel( m_model, configurationMap.value( "items" ).toList() );
|
fillModel( m_model, configurationMap.value( "items" ).toList() );
|
||||||
}
|
|
||||||
|
|
||||||
QString default_item_id = CalamaresUtils::getString( configurationMap, "default" );
|
QString default_item_id = CalamaresUtils::getString( configurationMap, "default" );
|
||||||
if ( !default_item_id.isEmpty() )
|
if ( !default_item_id.isEmpty() )
|
||||||
{
|
|
||||||
for ( int item_n = 0; item_n < m_model->packageCount(); ++item_n )
|
|
||||||
{
|
{
|
||||||
QModelIndex item_idx = m_model->index( item_n, 0 );
|
for ( int item_n = 0; item_n < m_model->packageCount(); ++item_n )
|
||||||
QVariant item_id = m_model->data( item_idx, PackageListModel::IdRole );
|
|
||||||
|
|
||||||
if ( item_id.toString() == default_item_id )
|
|
||||||
{
|
{
|
||||||
m_defaultModelIndex = item_idx;
|
QModelIndex item_idx = m_model->index( item_n, 0 );
|
||||||
break;
|
QVariant item_id = m_model->data( item_idx, PackageListModel::IdRole );
|
||||||
|
|
||||||
|
if ( item_id.toString() == default_item_id )
|
||||||
|
{
|
||||||
|
m_defaultModelIndex = item_idx;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setPackageChoice( CalamaresUtils::getString( configurationMap, "packageChoice" ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,12 @@ method: legacy
|
|||||||
#
|
#
|
||||||
# id: ""
|
# id: ""
|
||||||
|
|
||||||
# The *pkgc* is used for setting the default selection in the QML view
|
# The *packageChoice* value is used for setting the default selection
|
||||||
pkgc: libreoffice
|
# in the QML view; this should match one of the keys used in the QML
|
||||||
|
# module for package names.
|
||||||
|
#
|
||||||
|
# (e.g. the sample QML uses "no_office_suite", "minimal_install" and
|
||||||
|
# "libreoffice" as possible choices).
|
||||||
|
#
|
||||||
|
packageChoice: libreoffice
|
||||||
|
|
||||||
|
@ -84,8 +84,8 @@ Item {
|
|||||||
print("L not used")
|
print("L not used")
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
config.pkgc = "libreoffice"
|
config.packageChoice = "libreoffice"
|
||||||
print( config.pkgc )
|
print( config.packageChoice )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -152,7 +152,7 @@ Item {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print("No Office Suite")
|
print("No Office Suite")
|
||||||
config.pkgc = "no_office_suite"
|
config.packageChoice = "no_office_suite"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -220,7 +220,7 @@ Item {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print("minimal")
|
print("minimal")
|
||||||
config.pkgc = "minimal_install"
|
config.packageChoice = "minimal_install"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user