mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 10:55:46 -05:00
[partition] defuse is-next-enabled
Both the KPMCore and the ChoicePage -- asynchronously -- were connected to the nextStatusChanged() signal. So if the core said next was true, that could end up communicated to the ViewManager, enabling the *next* button in the UI. Changing to the *erase* page generally triggers a KPMCore reload, which later emits a `hasRootMountPointChanged()` signal, once the layout is applied and the disk gets a root mount point. So we'd get a `true` from KPMCore, which -- because it was connected directly to the signal to the VM -- would override any other considerations. Hook up both signals to an intermediate slot that just recalculates whether the next button should be enabled, based on the state both of the Choice page and whatever else.
This commit is contained in:
parent
f1c4caba48
commit
0eb1f002db
2 changed files with 10 additions and 2 deletions
|
@ -107,8 +107,8 @@ PartitionViewStep::continueLoading()
|
|||
m_waitingWidget->deleteLater();
|
||||
m_waitingWidget = nullptr;
|
||||
|
||||
connect( m_core, &PartitionCoreModule::hasRootMountPointChanged, this, &PartitionViewStep::nextStatusChanged );
|
||||
connect( m_choicePage, &ChoicePage::nextStatusChanged, this, &PartitionViewStep::nextStatusChanged );
|
||||
connect( m_core, &PartitionCoreModule::hasRootMountPointChanged, this, &PartitionViewStep::nextPossiblyChanged );
|
||||
connect( m_choicePage, &ChoicePage::nextStatusChanged, this, &PartitionViewStep::nextPossiblyChanged );
|
||||
}
|
||||
|
||||
|
||||
|
@ -348,6 +348,11 @@ PartitionViewStep::isNextEnabled() const
|
|||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
PartitionViewStep::nextPossiblyChanged(bool)
|
||||
{
|
||||
emit nextStatusChanged( isNextEnabled() );
|
||||
}
|
||||
|
||||
bool
|
||||
PartitionViewStep::isBackEnabled() const
|
||||
|
|
|
@ -78,6 +78,9 @@ private:
|
|||
void initPartitionCoreModule();
|
||||
void continueLoading();
|
||||
|
||||
/// "slot" for changes to next-status from the KPMCore and ChoicePage
|
||||
void nextPossiblyChanged( bool );
|
||||
|
||||
PartitionCoreModule* m_core;
|
||||
QStackedWidget* m_widget;
|
||||
ChoicePage* m_choicePage;
|
||||
|
|
Loading…
Add table
Reference in a new issue