mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 01:45:36 -04:00
[partition] Use configured swap choices in choice page
This commit is contained in:
parent
5945e9584d
commit
2998c27545
4 changed files with 14 additions and 4 deletions
|
@ -72,7 +72,7 @@ using PartitionActions::Choices::SwapChoice;
|
||||||
* will show up as a list view.
|
* will show up as a list view.
|
||||||
* @param parent the QWidget parent.
|
* @param parent the QWidget parent.
|
||||||
*/
|
*/
|
||||||
ChoicePage::ChoicePage( QWidget* parent )
|
ChoicePage::ChoicePage( const SwapChoiceSet& swapChoices, QWidget* parent )
|
||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
, m_nextEnabled( false )
|
, m_nextEnabled( false )
|
||||||
, m_core( nullptr )
|
, m_core( nullptr )
|
||||||
|
@ -92,6 +92,7 @@ ChoicePage::ChoicePage( QWidget* parent )
|
||||||
, m_bootloaderComboBox( nullptr )
|
, m_bootloaderComboBox( nullptr )
|
||||||
, m_lastSelectedDeviceIndex( -1 )
|
, m_lastSelectedDeviceIndex( -1 )
|
||||||
, m_enableEncryptionWidget( true )
|
, m_enableEncryptionWidget( true )
|
||||||
|
, m_swapChoices( swapChoices )
|
||||||
{
|
{
|
||||||
setupUi( this );
|
setupUi( this );
|
||||||
|
|
||||||
|
@ -259,7 +260,7 @@ ChoicePage::setupChoices()
|
||||||
|
|
||||||
// Fill up swap options
|
// Fill up swap options
|
||||||
// .. TODO: only if enabled in the config
|
// .. TODO: only if enabled in the config
|
||||||
m_eraseSwapChoices = createCombo( { SwapChoice::NoSwap, SwapChoice::SmallSwap, SwapChoice::FullSwap } );
|
m_eraseSwapChoices = createCombo( m_swapChoices );
|
||||||
m_eraseButton->addOptionsComboBox( m_eraseSwapChoices );
|
m_eraseButton->addOptionsComboBox( m_eraseSwapChoices );
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
#include "core/OsproberEntry.h"
|
#include "core/OsproberEntry.h"
|
||||||
|
#include "core/PartitionActions.h"
|
||||||
|
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
@ -43,6 +44,7 @@ class DeviceInfoWidget;
|
||||||
|
|
||||||
class Device;
|
class Device;
|
||||||
|
|
||||||
|
using SwapChoiceSet = QSet< PartitionActions::Choices::SwapChoice>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The ChoicePage class is the first page of the partitioning interface.
|
* @brief The ChoicePage class is the first page of the partitioning interface.
|
||||||
|
@ -62,7 +64,7 @@ public:
|
||||||
Manual
|
Manual
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit ChoicePage( QWidget* parent = nullptr );
|
explicit ChoicePage( const SwapChoiceSet& swapChoices, QWidget* parent = nullptr );
|
||||||
virtual ~ChoicePage();
|
virtual ~ChoicePage();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -167,6 +169,7 @@ private:
|
||||||
|
|
||||||
QString m_defaultFsType;
|
QString m_defaultFsType;
|
||||||
bool m_enableEncryptionWidget;
|
bool m_enableEncryptionWidget;
|
||||||
|
SwapChoiceSet m_swapChoices;
|
||||||
|
|
||||||
QMutex m_coreMutex;
|
QMutex m_coreMutex;
|
||||||
};
|
};
|
||||||
|
|
|
@ -91,7 +91,7 @@ PartitionViewStep::continueLoading()
|
||||||
Q_ASSERT( !m_manualPartitionPage );
|
Q_ASSERT( !m_manualPartitionPage );
|
||||||
|
|
||||||
m_manualPartitionPage = new PartitionPage( m_core );
|
m_manualPartitionPage = new PartitionPage( m_core );
|
||||||
m_choicePage = new ChoicePage();
|
m_choicePage = new ChoicePage( m_swapChoices );
|
||||||
|
|
||||||
m_choicePage->init( m_core );
|
m_choicePage->init( m_core );
|
||||||
|
|
||||||
|
@ -534,6 +534,7 @@ PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
else
|
else
|
||||||
choices.insert( PartitionActions::Choices::SwapChoice::SmallSwap );
|
choices.insert( PartitionActions::Choices::SwapChoice::SmallSwap );
|
||||||
}
|
}
|
||||||
|
m_swapChoices = choices;
|
||||||
|
|
||||||
// These gs settings seem to be unused (in upstream Calamares) outside of
|
// These gs settings seem to be unused (in upstream Calamares) outside of
|
||||||
// the partition module itself.
|
// the partition module itself.
|
||||||
|
|
|
@ -26,7 +26,10 @@
|
||||||
|
|
||||||
#include <PluginDllMacro.h>
|
#include <PluginDllMacro.h>
|
||||||
|
|
||||||
|
#include "core/PartitionActions.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QSet>
|
||||||
|
|
||||||
class ChoicePage;
|
class ChoicePage;
|
||||||
class PartitionPage;
|
class PartitionPage;
|
||||||
|
@ -76,6 +79,8 @@ private:
|
||||||
PartitionPage* m_manualPartitionPage;
|
PartitionPage* m_manualPartitionPage;
|
||||||
|
|
||||||
QWidget* m_waitingWidget;
|
QWidget* m_waitingWidget;
|
||||||
|
|
||||||
|
QSet< PartitionActions::Choices::SwapChoice > m_swapChoices;
|
||||||
};
|
};
|
||||||
|
|
||||||
CALAMARES_PLUGIN_FACTORY_DECLARATION( PartitionViewStepFactory )
|
CALAMARES_PLUGIN_FACTORY_DECLARATION( PartitionViewStepFactory )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue