Move osprober management out of ctor.
This commit is contained in:
parent
a2f1d49983
commit
905835295a
@ -31,7 +31,6 @@
|
|||||||
#include <gui/PartitionPage.h>
|
#include <gui/PartitionPage.h>
|
||||||
#include <gui/ReplacePage.h>
|
#include <gui/ReplacePage.h>
|
||||||
#include <gui/PartitionPreview.h>
|
#include <gui/PartitionPreview.h>
|
||||||
#include "OsproberEntry.h"
|
|
||||||
|
|
||||||
#include "CalamaresVersion.h"
|
#include "CalamaresVersion.h"
|
||||||
#include "utils/CalamaresUtilsGui.h"
|
#include "utils/CalamaresUtilsGui.h"
|
||||||
@ -72,6 +71,49 @@ PartitionViewStep::PartitionViewStep( QObject* parent )
|
|||||||
connect( timer, &QTimer::timeout,
|
connect( timer, &QTimer::timeout,
|
||||||
[=]()
|
[=]()
|
||||||
{
|
{
|
||||||
|
OsproberEntryList osproberEntries = runOsprober();
|
||||||
|
|
||||||
|
m_choicePage->init( m_core, osproberEntries );
|
||||||
|
m_erasePage->init( m_core );
|
||||||
|
m_alongsidePage->init( m_core, osproberEntries );
|
||||||
|
|
||||||
|
m_widget->addWidget( m_choicePage );
|
||||||
|
m_widget->addWidget( m_manualPartitionPage );
|
||||||
|
m_widget->addWidget( m_alongsidePage );
|
||||||
|
m_widget->addWidget( m_erasePage );
|
||||||
|
m_widget->addWidget( m_replacePage );
|
||||||
|
m_widget->removeWidget( waitingWidget );
|
||||||
|
waitingWidget->deleteLater();
|
||||||
|
|
||||||
|
timer->deleteLater();
|
||||||
|
} );
|
||||||
|
timer->start( 0 );
|
||||||
|
|
||||||
|
connect( m_core, &PartitionCoreModule::hasRootMountPointChanged,
|
||||||
|
this, &PartitionViewStep::nextStatusChanged );
|
||||||
|
connect( m_choicePage, &ChoicePage::nextStatusChanged,
|
||||||
|
this, &PartitionViewStep::nextStatusChanged );
|
||||||
|
connect( m_erasePage, &EraseDiskPage::nextStatusChanged,
|
||||||
|
this, &PartitionViewStep::nextStatusChanged );
|
||||||
|
connect( m_alongsidePage, &AlongsidePage::nextStatusChanged,
|
||||||
|
this, &PartitionViewStep::nextStatusChanged );
|
||||||
|
connect( m_replacePage, &ReplacePage::nextStatusChanged,
|
||||||
|
this, &PartitionViewStep::nextStatusChanged );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PartitionViewStep::~PartitionViewStep()
|
||||||
|
{
|
||||||
|
if ( m_choicePage && m_choicePage->parent() == nullptr )
|
||||||
|
m_choicePage->deleteLater();
|
||||||
|
if ( m_manualPartitionPage && m_manualPartitionPage->parent() == nullptr )
|
||||||
|
m_manualPartitionPage->deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
OsproberEntryList
|
||||||
|
PartitionViewStep::runOsprober()
|
||||||
|
{
|
||||||
QString osproberOutput;
|
QString osproberOutput;
|
||||||
QProcess osprober;
|
QProcess osprober;
|
||||||
osprober.setProgram( "os-prober" );
|
osprober.setProgram( "os-prober" );
|
||||||
@ -116,43 +158,10 @@ PartitionViewStep::PartitionViewStep( QObject* parent )
|
|||||||
}
|
}
|
||||||
osProberReport.append( osproberCleanLines.join( '\n' ) );
|
osProberReport.append( osproberCleanLines.join( '\n' ) );
|
||||||
cDebug() << osProberReport;
|
cDebug() << osProberReport;
|
||||||
|
|
||||||
Calamares::JobQueue::instance()->globalStorage()->insert( "osproberLines", osproberCleanLines );
|
Calamares::JobQueue::instance()->globalStorage()->insert( "osproberLines", osproberCleanLines );
|
||||||
|
|
||||||
m_choicePage->init( m_core, osproberEntries );
|
return osproberEntries;
|
||||||
m_erasePage->init( m_core );
|
|
||||||
m_alongsidePage->init( m_core, osproberEntries );
|
|
||||||
|
|
||||||
m_widget->addWidget( m_choicePage );
|
|
||||||
m_widget->addWidget( m_manualPartitionPage );
|
|
||||||
m_widget->addWidget( m_alongsidePage );
|
|
||||||
m_widget->addWidget( m_erasePage );
|
|
||||||
m_widget->addWidget( m_replacePage );
|
|
||||||
m_widget->removeWidget( waitingWidget );
|
|
||||||
waitingWidget->deleteLater();
|
|
||||||
|
|
||||||
timer->deleteLater();
|
|
||||||
} );
|
|
||||||
timer->start( 0 );
|
|
||||||
|
|
||||||
connect( m_core, &PartitionCoreModule::hasRootMountPointChanged,
|
|
||||||
this, &PartitionViewStep::nextStatusChanged );
|
|
||||||
connect( m_choicePage, &ChoicePage::nextStatusChanged,
|
|
||||||
this, &PartitionViewStep::nextStatusChanged );
|
|
||||||
connect( m_erasePage, &EraseDiskPage::nextStatusChanged,
|
|
||||||
this, &PartitionViewStep::nextStatusChanged );
|
|
||||||
connect( m_alongsidePage, &AlongsidePage::nextStatusChanged,
|
|
||||||
this, &PartitionViewStep::nextStatusChanged );
|
|
||||||
connect( m_replacePage, &ReplacePage::nextStatusChanged,
|
|
||||||
this, &PartitionViewStep::nextStatusChanged );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
PartitionViewStep::~PartitionViewStep()
|
|
||||||
{
|
|
||||||
if ( m_choicePage && m_choicePage->parent() == nullptr )
|
|
||||||
m_choicePage->deleteLater();
|
|
||||||
if ( m_manualPartitionPage && m_manualPartitionPage->parent() == nullptr )
|
|
||||||
m_manualPartitionPage->deleteLater();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "viewpages/ViewStep.h"
|
#include "viewpages/ViewStep.h"
|
||||||
#include "PluginDllMacro.h"
|
#include "PluginDllMacro.h"
|
||||||
|
#include "OsproberEntry.h"
|
||||||
|
|
||||||
class ChoicePage;
|
class ChoicePage;
|
||||||
class EraseDiskPage;
|
class EraseDiskPage;
|
||||||
@ -69,6 +70,7 @@ public:
|
|||||||
QList< Calamares::job_ptr > jobs() const override;
|
QList< Calamares::job_ptr > jobs() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
OsproberEntryList runOsprober();
|
||||||
bool canBeResized( const QString& partitionPath );
|
bool canBeResized( const QString& partitionPath );
|
||||||
|
|
||||||
PartitionCoreModule* m_core;
|
PartitionCoreModule* m_core;
|
||||||
|
Loading…
Reference in New Issue
Block a user