Enable/disable Next button based on whether we have a root mount point

main
Aurélien Gâteau 11 years ago
parent 52028d95f9
commit 36b3de7107

@ -88,13 +88,28 @@ PartitionCoreModule::createPartition( Device* device, PartitionInfo* partitionIn
partitionModel->reload();
m_jobs << Calamares::job_ptr( job );
if ( partitionInfo->mountPoint == "/" && !m_hasRootMountPoint )
{
m_hasRootMountPoint = true;
hasRootMountPointChanged( m_hasRootMountPoint );
}
dumpQueue();
}
void
PartitionCoreModule::deletePartition( Device* device, Partition* partition )
{
m_infoForPartitionHash.remove( partition );
auto it = m_infoForPartitionHash.find( partition );
if ( it != m_infoForPartitionHash.end() )
{
if ( it.value()->mountPoint == "/" )
{
m_hasRootMountPoint = false;
hasRootMountPointChanged( m_hasRootMountPoint );
}
m_infoForPartitionHash.erase( it );
}
if ( partition->state() == Partition::StateNew )
{

@ -41,6 +41,7 @@ class PartitionModel;
*/
class PartitionCoreModule : public QObject
{
Q_OBJECT
public:
PartitionCoreModule( QObject* parent = nullptr );
~PartitionCoreModule();
@ -58,10 +59,19 @@ public:
return m_jobs;
}
bool hasRootMountPoint() const
{
return m_hasRootMountPoint;
}
Q_SIGNALS:
void hasRootMountPointChanged( bool value );
private:
QList< Device* > m_devices;
QHash< Device*, PartitionModel* > m_partitionModelForDeviceHash;
DeviceModel* m_deviceModel;
bool m_hasRootMountPoint = false;
InfoForPartitionHash m_infoForPartitionHash;

@ -27,6 +27,8 @@ PartitionViewStep::PartitionViewStep( QObject* parent )
, m_core( new PartitionCoreModule( this ) )
, m_widget( new PartitionPage( m_core ) )
{
connect( m_core, SIGNAL( hasRootMountPointChanged( bool ) ),
SIGNAL( nextStatusChanged( bool ) ) );
}
@ -60,7 +62,7 @@ PartitionViewStep::back()
bool
PartitionViewStep::isNextEnabled() const
{
return false;
return m_core->hasRootMountPoint();
}

Loading…
Cancel
Save