From 64d296aa06193fe3a0073a50e6759b726b830a90 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Tue, 5 Jan 2016 18:44:23 +0100 Subject: [PATCH] Sensible default to current device in bootloader picker. --- src/modules/partition/gui/ChoicePage.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index 0024ebc83..e6d1d948c 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -324,6 +324,13 @@ ChoicePage::createBootloaderComboBox( ExpandableRadioButton* parentButton ) if ( expanded ) updateBootloaderDevice(); }, Qt::QueuedConnection ); + connect( m_core, &PartitionCoreModule::deviceReverted, + this, [ this, bcb ]( Device* dev ) + { + if ( bcb->model() != m_core->bootLoaderModel() ) + bcb->setModel( m_core->bootLoaderModel() ); + bcb->setCurrentIndex( m_lastSelectedDeviceIndex ); + } ); // ^ Must be Queued so it's sure to run when the widget is already visible. return bcb;