[partition] ChoicePage to use Config object

This commit is contained in:
Adriaan de Groot 2020-07-30 10:44:10 +02:00
parent d103c42091
commit 824dac62d8
3 changed files with 17 additions and 14 deletions

View File

@ -20,7 +20,15 @@
#include "ChoicePage.h"
#include "BootInfoWidget.h"
#include "DeviceInfoWidget.h"
#include "PartitionBarsView.h"
#include "PartitionLabelsView.h"
#include "PartitionSplitterWidget.h"
#include "ReplaceWidget.h"
#include "ScanningDialog.h"
#include "core/BootLoaderModel.h"
#include "core/Config.h"
#include "core/DeviceModel.h"
#include "core/KPMHelpers.h"
#include "core/OsproberEntry.h"
@ -30,14 +38,6 @@
#include "core/PartitionInfo.h"
#include "core/PartitionModel.h"
#include "BootInfoWidget.h"
#include "DeviceInfoWidget.h"
#include "PartitionBarsView.h"
#include "PartitionLabelsView.h"
#include "PartitionSplitterWidget.h"
#include "ReplaceWidget.h"
#include "ScanningDialog.h"
#include "Branding.h"
#include "GlobalStorage.h"
#include "JobQueue.h"
@ -75,8 +75,9 @@ using Calamares::PrettyRadioButton;
* the module loading code path.
* @param parent the QWidget parent.
*/
ChoicePage::ChoicePage( const SwapChoiceSet& swapChoices, QWidget* parent )
ChoicePage::ChoicePage( Config* config, QWidget* parent )
: QWidget( parent )
, m_config( config )
, m_nextEnabled( false )
, m_core( nullptr )
, m_choice( NoChoice )
@ -93,8 +94,8 @@ ChoicePage::ChoicePage( const SwapChoiceSet& swapChoices, QWidget* parent )
, m_bootloaderComboBox( nullptr )
, m_lastSelectedDeviceIndex( -1 )
, m_enableEncryptionWidget( true )
, m_availableSwapChoices( swapChoices )
, m_eraseSwapChoice( PartitionActions::Choices::pickOne( swapChoices ) )
, m_availableSwapChoices( config->swapChoices() )
, m_eraseSwapChoice( PartitionActions::Choices::pickOne( m_availableSwapChoices ) )
, m_allowManualPartitioning( true )
{
setupUi( this );

View File

@ -42,11 +42,12 @@ namespace Calamares
class PrettyRadioButton;
}
class Config;
class DeviceInfoWidget;
class PartitionBarsView;
class PartitionSplitterWidget;
class PartitionLabelsView;
class PartitionCoreModule;
class DeviceInfoWidget;
class Device;
@ -70,7 +71,7 @@ public:
Manual
};
explicit ChoicePage( const SwapChoiceSet& swapChoices, QWidget* parent = nullptr );
explicit ChoicePage( Config* config, QWidget* parent = nullptr );
virtual ~ChoicePage();
/**
@ -147,6 +148,7 @@ private:
// Translations support
void updateSwapChoicesTr( QComboBox* box );
Config* m_config;
bool m_nextEnabled;
PartitionCoreModule* m_core;

View File

@ -94,7 +94,7 @@ void
PartitionViewStep::continueLoading()
{
Q_ASSERT( !m_choicePage );
m_choicePage = new ChoicePage( m_config->swapChoices() );
m_choicePage = new ChoicePage( m_config );
m_choicePage->init( m_core );
m_widget->addWidget( m_choicePage );