From 14130ae9c070f7e9128b5caf89633712a2026bce Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Mon, 1 Sep 2014 12:44:36 +0200 Subject: [PATCH] Only allow a ViewStep to change next button status if it's active now. --- src/libcalamaresui/ViewManager.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index d4cdfa07f..675dfcf38 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -111,7 +111,15 @@ ViewManager::insertViewStep( int before, ViewStep* step) m_stack->insertWidget( before, step->widget() ); connect( step, &ViewStep::nextStatusChanged, - m_next, &QPushButton::setEnabled ); + this, [this]( bool status ) + { + ViewStep* vs = qobject_cast< ViewStep* >( sender() ); + if ( vs ) + { + if ( vs == m_steps.at( m_currentStep ) ) + m_next->setEnabled( status ); + } + } ); m_stack->setCurrentIndex( 0 ); }