[packagechooser] Allow setting an ID for the module's GS key

This commit is contained in:
Adriaan de Groot 2019-08-03 23:24:30 +02:00
parent 2f2080727d
commit 87d7b2a5c0
3 changed files with 16 additions and 2 deletions

View file

@ -149,7 +149,6 @@ PackageChooserViewStep::jobs() const
void
PackageChooserViewStep::setConfigurationMap( const QVariantMap& configurationMap )
{
// TODO: use the configurationMap
QString mode = CalamaresUtils::getString( configurationMap, "mode" );
bool ok = false;
if ( !mode.isEmpty() )
@ -160,7 +159,10 @@ PackageChooserViewStep::setConfigurationMap( const QVariantMap& configurationMap
{
m_mode = PackageChooserMode::Required;
}
m_id = CalamaresUtils::getString( configurationMap, "id" );
// TODO: replace this hard-coded model
if ( !m_model )
{

View file

@ -60,7 +60,10 @@ private:
PackageChooserPage* m_widget;
PackageListModel* m_model;
// Configuration
PackageChooserMode m_mode;
QString m_id;
};
CALAMARES_PLUGIN_FACTORY_DECLARATION( PackageChooserViewStepFactory )

View file

@ -1,5 +1,14 @@
# Configuration for the low-density software chooser
---
# The packagechooser writes a GlobalStorage value for the choice that
# has been made. The key is *packagechooser_<id>*. If *id* is set here,
# it is substituted into the key name. If it is not set, the module's
# instance name is used; see the *instances* section of `settings.conf`.
# If there is just one packagechooser module, and no *id* is set,
# resulting GS key is probably *packagechooser_packagechooser*.
#
# id: ""
# Software selection mode, to set whether the software packages
# can be chosen singly, or multiply.
#