[partition] Add setting for requiredstorage

- If the welcome module isn't used, can set a required amount
   of storage for the installation here.
This commit is contained in:
Adriaan de Groot 2019-06-08 07:48:47 -04:00
parent b5c50c8d04
commit e6a2cb607f
3 changed files with 18 additions and 0 deletions

View File

@ -69,6 +69,7 @@ PartitionViewStep::PartitionViewStep( QObject* parent )
, m_widget( new QStackedWidget() )
, m_choicePage( nullptr )
, m_manualPartitionPage( nullptr )
, m_requiredStorageGiB( 0.0 )
{
m_widget->setContentsMargins( 0, 0, 0, 0 );
@ -564,6 +565,9 @@ PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap )
m_swapChoices = choices;
// Settings that overlap with the Welcome module
m_requiredStorageGiB = CalamaresUtils::getDouble( configurationMap, "requiredStorage", -1.0 );
// These gs settings seem to be unused (in upstream Calamares) outside of
// the partition module itself.
gs->insert( "ensureSuspendToDisk", ensureSuspendToDisk );

View File

@ -86,6 +86,8 @@ private:
QFutureWatcher<void>* m_future;
QSet< PartitionActions::Choices::SwapChoice > m_swapChoices;
qreal m_requiredStorageGiB; // May duplicate setting in the welcome module
};
CALAMARES_PLUGIN_FACTORY_DECLARATION( PartitionViewStepFactory )

View File

@ -120,3 +120,15 @@ defaultFileSystemType: "ext4"
# % of the available drive space if a '%' is appended to the value
# - minSize: minimum partition size (optional parameter)
# - maxSize: maximum partition size (optional parameter)
# Checking for available storage
#
# This overlaps with the setting of the same name in the welcome module's
# requirements section. If nothing is set by the welcome module, this
# value is used instead. It is still a problem if there is no required
# size set at all, and the replace and resize options will not be offered
# if no required size is set.
#
# The value is in Gibibytes (GiB).
#
# requiredStorage: 3.5