mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 01:15:38 -04:00
Continue asynchronously loading PartitionViewStep after config load.
This commit is contained in:
parent
3ba058d5b7
commit
9a67f6372c
2 changed files with 40 additions and 23 deletions
|
@ -57,25 +57,31 @@ PartitionViewStep::PartitionViewStep( QObject* parent )
|
||||||
: Calamares::ViewStep( parent )
|
: Calamares::ViewStep( parent )
|
||||||
, m_widget( new QStackedWidget() )
|
, m_widget( new QStackedWidget() )
|
||||||
, m_core( new PartitionCoreModule( this ) )
|
, m_core( new PartitionCoreModule( this ) )
|
||||||
, m_choicePage( new ChoicePage() )
|
, m_choicePage( nullptr )
|
||||||
, m_erasePage( new EraseDiskPage() )
|
, m_erasePage( new EraseDiskPage() )
|
||||||
, m_alongsidePage( new AlongsidePage() )
|
, m_alongsidePage( new AlongsidePage() )
|
||||||
, m_manualPartitionPage( new PartitionPage( m_core ) )
|
, m_manualPartitionPage( new PartitionPage( m_core ) )
|
||||||
, m_replacePage( new ReplacePage( m_core ) )
|
, m_replacePage( new ReplacePage( m_core ) )
|
||||||
|
, m_compactMode( true )
|
||||||
{
|
{
|
||||||
m_widget->setContentsMargins( 0, 0, 0, 0 );
|
m_widget->setContentsMargins( 0, 0, 0, 0 );
|
||||||
|
|
||||||
WaitingWidget* waitingWidget = new WaitingWidget( QString() );
|
m_waitingWidget = new WaitingWidget( QString() );
|
||||||
m_widget->addWidget( waitingWidget );
|
m_widget->addWidget( m_waitingWidget );
|
||||||
CALAMARES_RETRANSLATE( waitingWidget->setText( tr( "Gathering system information..." ) ); )
|
CALAMARES_RETRANSLATE( qobject_cast< WaitingWidget* >( m_waitingWidget )->setText( tr( "Gathering system information..." ) ); )
|
||||||
|
|
||||||
QTimer* timer = new QTimer;
|
// We're not done loading, but we need the configuration map first.
|
||||||
timer->setSingleShot( true );
|
}
|
||||||
connect( timer, &QTimer::timeout,
|
|
||||||
[=]()
|
|
||||||
|
void
|
||||||
|
PartitionViewStep::continueLoading()
|
||||||
{
|
{
|
||||||
OsproberEntryList osproberEntries = PartUtils::runOsprober( m_core );
|
OsproberEntryList osproberEntries = PartUtils::runOsprober( m_core );
|
||||||
|
|
||||||
|
Q_ASSERT( !m_choicePage );
|
||||||
|
m_choicePage = new ChoicePage( m_compactMode );
|
||||||
|
|
||||||
m_choicePage->init( m_core, osproberEntries );
|
m_choicePage->init( m_core, osproberEntries );
|
||||||
m_erasePage->init( m_core );
|
m_erasePage->init( m_core );
|
||||||
m_alongsidePage->init( m_core, osproberEntries );
|
m_alongsidePage->init( m_core, osproberEntries );
|
||||||
|
@ -85,12 +91,9 @@ PartitionViewStep::PartitionViewStep( QObject* parent )
|
||||||
m_widget->addWidget( m_alongsidePage );
|
m_widget->addWidget( m_alongsidePage );
|
||||||
m_widget->addWidget( m_erasePage );
|
m_widget->addWidget( m_erasePage );
|
||||||
m_widget->addWidget( m_replacePage );
|
m_widget->addWidget( m_replacePage );
|
||||||
m_widget->removeWidget( waitingWidget );
|
m_widget->removeWidget( m_waitingWidget );
|
||||||
waitingWidget->deleteLater();
|
m_waitingWidget->deleteLater();
|
||||||
|
m_waitingWidget = nullptr;
|
||||||
timer->deleteLater();
|
|
||||||
} );
|
|
||||||
timer->start( 0 );
|
|
||||||
|
|
||||||
connect( m_core, &PartitionCoreModule::hasRootMountPointChanged,
|
connect( m_core, &PartitionCoreModule::hasRootMountPointChanged,
|
||||||
this, &PartitionViewStep::nextStatusChanged );
|
this, &PartitionViewStep::nextStatusChanged );
|
||||||
|
@ -394,6 +397,14 @@ PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
{
|
{
|
||||||
gs->insert( "ensureSuspendToDisk", true );
|
gs->insert( "ensureSuspendToDisk", true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( configurationMap.contains( "compactMode" ) &&
|
||||||
|
configurationMap.value( "compactMode" ).type() == QVariant::Bool )
|
||||||
|
{
|
||||||
|
m_compactMode = configurationMap.value( "compactMode", true ).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
QTimer::singleShot( 0, this, &PartitionViewStep::continueLoading );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,8 @@ public:
|
||||||
explicit PartitionViewStep( QObject* parent = 0 );
|
explicit PartitionViewStep( QObject* parent = 0 );
|
||||||
virtual ~PartitionViewStep();
|
virtual ~PartitionViewStep();
|
||||||
|
|
||||||
|
void continueLoading();
|
||||||
|
|
||||||
QString prettyName() const override;
|
QString prettyName() const override;
|
||||||
QWidget* createSummaryWidget() const override;
|
QWidget* createSummaryWidget() const override;
|
||||||
|
|
||||||
|
@ -76,6 +78,10 @@ private:
|
||||||
AlongsidePage* m_alongsidePage;
|
AlongsidePage* m_alongsidePage;
|
||||||
PartitionPage* m_manualPartitionPage;
|
PartitionPage* m_manualPartitionPage;
|
||||||
ReplacePage* m_replacePage;
|
ReplacePage* m_replacePage;
|
||||||
|
|
||||||
|
QWidget* m_waitingWidget;
|
||||||
|
|
||||||
|
bool m_compactMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
CALAMARES_PLUGIN_FACTORY_DECLARATION( PartitionViewStepFactory )
|
CALAMARES_PLUGIN_FACTORY_DECLARATION( PartitionViewStepFactory )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue