mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-01 19:35:36 -04:00
Enable/disable Next button based on whether we have a root mount point
This commit is contained in:
parent
52028d95f9
commit
36b3de7107
3 changed files with 29 additions and 2 deletions
|
@ -88,13 +88,28 @@ PartitionCoreModule::createPartition( Device* device, PartitionInfo* partitionIn
|
||||||
partitionModel->reload();
|
partitionModel->reload();
|
||||||
m_jobs << Calamares::job_ptr( job );
|
m_jobs << Calamares::job_ptr( job );
|
||||||
|
|
||||||
|
if ( partitionInfo->mountPoint == "/" && !m_hasRootMountPoint )
|
||||||
|
{
|
||||||
|
m_hasRootMountPoint = true;
|
||||||
|
hasRootMountPointChanged( m_hasRootMountPoint );
|
||||||
|
}
|
||||||
|
|
||||||
dumpQueue();
|
dumpQueue();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PartitionCoreModule::deletePartition( Device* device, Partition* partition )
|
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 )
|
if ( partition->state() == Partition::StateNew )
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,6 +41,7 @@ class PartitionModel;
|
||||||
*/
|
*/
|
||||||
class PartitionCoreModule : public QObject
|
class PartitionCoreModule : public QObject
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
PartitionCoreModule( QObject* parent = nullptr );
|
PartitionCoreModule( QObject* parent = nullptr );
|
||||||
~PartitionCoreModule();
|
~PartitionCoreModule();
|
||||||
|
@ -58,10 +59,19 @@ public:
|
||||||
return m_jobs;
|
return m_jobs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool hasRootMountPoint() const
|
||||||
|
{
|
||||||
|
return m_hasRootMountPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void hasRootMountPointChanged( bool value );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList< Device* > m_devices;
|
QList< Device* > m_devices;
|
||||||
QHash< Device*, PartitionModel* > m_partitionModelForDeviceHash;
|
QHash< Device*, PartitionModel* > m_partitionModelForDeviceHash;
|
||||||
DeviceModel* m_deviceModel;
|
DeviceModel* m_deviceModel;
|
||||||
|
bool m_hasRootMountPoint = false;
|
||||||
|
|
||||||
InfoForPartitionHash m_infoForPartitionHash;
|
InfoForPartitionHash m_infoForPartitionHash;
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,8 @@ PartitionViewStep::PartitionViewStep( QObject* parent )
|
||||||
, m_core( new PartitionCoreModule( this ) )
|
, m_core( new PartitionCoreModule( this ) )
|
||||||
, m_widget( new PartitionPage( m_core ) )
|
, m_widget( new PartitionPage( m_core ) )
|
||||||
{
|
{
|
||||||
|
connect( m_core, SIGNAL( hasRootMountPointChanged( bool ) ),
|
||||||
|
SIGNAL( nextStatusChanged( bool ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,7 +62,7 @@ PartitionViewStep::back()
|
||||||
bool
|
bool
|
||||||
PartitionViewStep::isNextEnabled() const
|
PartitionViewStep::isNextEnabled() const
|
||||||
{
|
{
|
||||||
return false;
|
return m_core->hasRootMountPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue