[partition] Select initial swap choice
This commit is contained in:
parent
9f0f600aa4
commit
b518ef7dfe
@ -116,6 +116,13 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
bool nameFound = false; // In the name table (ignored, falls back to first entry in table)
|
bool nameFound = false; // In the name table (ignored, falls back to first entry in table)
|
||||||
m_initialInstallChoice = PartitionActions::Choices::installChoiceNames().find(
|
m_initialInstallChoice = PartitionActions::Choices::installChoiceNames().find(
|
||||||
CalamaresUtils::getString( configurationMap, "initialPartitioningChoice" ), nameFound );
|
CalamaresUtils::getString( configurationMap, "initialPartitioningChoice" ), nameFound );
|
||||||
|
m_initialSwapChoice = PartitionActions::Choices::swapChoiceNames().find(
|
||||||
|
CalamaresUtils::getString( configurationMap, "initialSwapChoice" ), nameFound );
|
||||||
|
if ( !m_swapChoices.contains( m_initialSwapChoice ) )
|
||||||
|
{
|
||||||
|
cWarning() << "Configuration for *initialSwapChoice* is not one of the *userSwapChoices*";
|
||||||
|
m_initialSwapChoice = PartitionActions::Choices::pickOne( m_swapChoices );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -28,14 +28,20 @@ public:
|
|||||||
|
|
||||||
PartitionActions::Choices::SwapChoiceSet swapChoices() const { return m_swapChoices; }
|
PartitionActions::Choices::SwapChoiceSet swapChoices() const { return m_swapChoices; }
|
||||||
|
|
||||||
/**
|
/** @brief What kind of installation (partitioning) is requested **initially**?
|
||||||
* @brief What kind of installation (partitioning) is requested **initially**?
|
|
||||||
*
|
*
|
||||||
* @return the partitioning choice (may by @c NoChoice)
|
* @return the partitioning choice (may be @c NoChoice)
|
||||||
*/
|
*/
|
||||||
PartitionActions::Choices::InstallChoice initialInstallChoice() const { return m_initialInstallChoice; }
|
PartitionActions::Choices::InstallChoice initialInstallChoice() const { return m_initialInstallChoice; }
|
||||||
|
|
||||||
|
/** @brief What kind of swap selection is requested **initially**?
|
||||||
|
*
|
||||||
|
* @return The swap choice (may be @c NoSwap )
|
||||||
|
*/
|
||||||
|
PartitionActions::Choices::SwapChoice initialSwapChoice() const { return m_initialSwapChoice; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
PartitionActions::Choices::SwapChoice m_initialSwapChoice;
|
||||||
PartitionActions::Choices::SwapChoiceSet m_swapChoices;
|
PartitionActions::Choices::SwapChoiceSet m_swapChoices;
|
||||||
PartitionActions::Choices::InstallChoice m_initialInstallChoice = PartitionActions::Choices::NoChoice;
|
PartitionActions::Choices::InstallChoice m_initialInstallChoice = PartitionActions::Choices::NoChoice;
|
||||||
qreal m_requiredStorageGiB = 0.0; // May duplicate setting in the welcome module
|
qreal m_requiredStorageGiB = 0.0; // May duplicate setting in the welcome module
|
||||||
|
@ -86,7 +86,7 @@ ChoicePage::ChoicePage( Config* config, QWidget* parent )
|
|||||||
, m_lastSelectedDeviceIndex( -1 )
|
, m_lastSelectedDeviceIndex( -1 )
|
||||||
, m_enableEncryptionWidget( true )
|
, m_enableEncryptionWidget( true )
|
||||||
, m_availableSwapChoices( config->swapChoices() )
|
, m_availableSwapChoices( config->swapChoices() )
|
||||||
, m_eraseSwapChoice( PartitionActions::Choices::pickOne( m_availableSwapChoices ) )
|
, m_eraseSwapChoice( config->initialSwapChoice() )
|
||||||
, m_allowManualPartitioning( true )
|
, m_allowManualPartitioning( true )
|
||||||
{
|
{
|
||||||
setupUi( this );
|
setupUi( this );
|
||||||
|
@ -74,8 +74,15 @@ alwaysShowPartitionLabels: true
|
|||||||
#
|
#
|
||||||
# The default is "none"
|
# The default is "none"
|
||||||
#
|
#
|
||||||
# TODO: this isn't implemented
|
initialPartitioningChoice: none
|
||||||
# initialPartitioningChoice: none
|
#
|
||||||
|
# Similarly, some of the installation choices may offer a choice of swap;
|
||||||
|
# the available choices depend on *userSwapChoices*, above, and this
|
||||||
|
# setting can be used to pick a specific one.
|
||||||
|
#
|
||||||
|
# The default is "none" (no swap) if that is one of the enabled options, otherwise
|
||||||
|
# one of the items from the options.
|
||||||
|
initialSwapChoice: none
|
||||||
|
|
||||||
# Default filesystem type, used when a "new" partition is made.
|
# Default filesystem type, used when a "new" partition is made.
|
||||||
#
|
#
|
||||||
|
@ -22,6 +22,7 @@ properties:
|
|||||||
allowManualPartitioning: { type: boolean, default: true }
|
allowManualPartitioning: { type: boolean, default: true }
|
||||||
partitionLayout: { type: array } # TODO: specify items
|
partitionLayout: { type: array } # TODO: specify items
|
||||||
initialPartitioningChoice: { type: string, enum: [ none, erase, replace, alongside, manual ] }
|
initialPartitioningChoice: { type: string, enum: [ none, erase, replace, alongside, manual ] }
|
||||||
|
initialSwapChoice: { type: string, enum: [ none, small, suspend, reuse, file ] }
|
||||||
|
|
||||||
requiredStorage: { type: number }
|
requiredStorage: { type: number }
|
||||||
required:
|
required:
|
||||||
|
Loading…
Reference in New Issue
Block a user