commit
830e67fae2
4
CHANGES
4
CHANGES
@ -14,6 +14,10 @@ This release contains contributions from (alphabetically by first name):
|
|||||||
the UI opportunities it offers, so begin the process of deprecating
|
the UI opportunities it offers, so begin the process of deprecating
|
||||||
and removing that. Sometime in the future, QML pages will fill the
|
and removing that. Sometime in the future, QML pages will fill the
|
||||||
gap for easily-prototyped-yet-slick UI elements.
|
gap for easily-prototyped-yet-slick UI elements.
|
||||||
|
- A crash when no *finished* page (or rather, no page at all) is
|
||||||
|
configured after the last *exec* section of the sequence has been
|
||||||
|
solved. The *finished* page can be left out (but then you don't get
|
||||||
|
the restart-now functionality).
|
||||||
|
|
||||||
## Modules ##
|
## Modules ##
|
||||||
|
|
||||||
|
@ -283,18 +283,35 @@ ViewManager::next()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_currentStep++;
|
m_currentStep++;
|
||||||
m_stack->setCurrentIndex( m_currentStep );
|
|
||||||
|
m_stack->setCurrentIndex( m_currentStep ); // Does nothing if out of range
|
||||||
step->onLeave();
|
step->onLeave();
|
||||||
m_steps.at( m_currentStep )->onActivate();
|
|
||||||
executing = qobject_cast< ExecutionViewStep* >( m_steps.at( m_currentStep ) ) != nullptr;
|
if ( m_currentStep < m_steps.count() )
|
||||||
emit currentStepChanged();
|
{
|
||||||
|
m_steps.at( m_currentStep )->onActivate();
|
||||||
|
executing = qobject_cast< ExecutionViewStep* >( m_steps.at( m_currentStep ) ) != nullptr;
|
||||||
|
emit currentStepChanged();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Reached the end in a weird state (e.g. no finished step after an exec)
|
||||||
|
executing = false;
|
||||||
|
m_next->setEnabled( false );
|
||||||
|
m_back->setEnabled( false );
|
||||||
|
}
|
||||||
updateCancelEnabled( !settings->disableCancel() && !(executing && settings->disableCancelDuringExec() ) );
|
updateCancelEnabled( !settings->disableCancel() && !(executing && settings->disableCancelDuringExec() ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
step->next();
|
step->next();
|
||||||
|
}
|
||||||
|
|
||||||
m_next->setEnabled( !executing && m_steps.at( m_currentStep )->isNextEnabled() );
|
if ( m_currentStep < m_steps.count() )
|
||||||
m_back->setEnabled( !executing && m_steps.at( m_currentStep )->isBackEnabled() );
|
{
|
||||||
|
m_next->setEnabled( !executing && m_steps.at( m_currentStep )->isNextEnabled() );
|
||||||
|
m_back->setEnabled( !executing && m_steps.at( m_currentStep )->isBackEnabled() );
|
||||||
|
}
|
||||||
|
|
||||||
updateButtonLabels();
|
updateButtonLabels();
|
||||||
}
|
}
|
||||||
@ -320,7 +337,7 @@ ViewManager::updateButtonLabels()
|
|||||||
else
|
else
|
||||||
m_next->setText( tr( "&Next" ) );
|
m_next->setText( tr( "&Next" ) );
|
||||||
|
|
||||||
if ( m_currentStep == m_steps.count() -1 && m_steps.last()->isAtEnd() )
|
if ( isAtVeryEnd() )
|
||||||
{
|
{
|
||||||
m_quit->setText( tr( "&Done" ) );
|
m_quit->setText( tr( "&Done" ) );
|
||||||
m_quit->setToolTip( complete );
|
m_quit->setToolTip( complete );
|
||||||
@ -368,7 +385,7 @@ bool ViewManager::confirmCancelInstallation()
|
|||||||
const auto* const settings = Calamares::Settings::instance();
|
const auto* const settings = Calamares::Settings::instance();
|
||||||
|
|
||||||
// When we're at the very end, then it's always OK to exit.
|
// When we're at the very end, then it's always OK to exit.
|
||||||
if ( m_currentStep == m_steps.count() -1 && m_steps.last()->isAtEnd() )
|
if ( isAtVeryEnd() )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Not at the very end, cancel/quit might be disabled
|
// Not at the very end, cancel/quit might be disabled
|
||||||
|
@ -130,7 +130,12 @@ private:
|
|||||||
void insertViewStep( int before, ViewStep* step );
|
void insertViewStep( int before, ViewStep* step );
|
||||||
void updateButtonLabels();
|
void updateButtonLabels();
|
||||||
void updateCancelEnabled( bool enabled );
|
void updateCancelEnabled( bool enabled );
|
||||||
|
|
||||||
|
bool isAtVeryEnd() const
|
||||||
|
{
|
||||||
|
return ( m_currentStep >= m_steps.count() ) || ( m_currentStep == m_steps.count() - 1 && m_steps.last()->isAtEnd() );
|
||||||
|
}
|
||||||
|
|
||||||
static ViewManager* s_instance;
|
static ViewManager* s_instance;
|
||||||
|
|
||||||
ViewStepList m_steps;
|
ViewStepList m_steps;
|
||||||
|
Loading…
Reference in New Issue
Block a user