From 65230c795497976b87bddffc433407b9a0846863 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Fri, 15 Jan 2016 17:53:07 +0100 Subject: [PATCH] Add a SelectionFilter lambda for Alongside. --- src/modules/partition/gui/ChoicePage.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index c2efe4dc5..6c7b9f06b 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -24,6 +24,7 @@ #include "core/DeviceModel.h" #include "core/PartitionModel.h" #include "core/OsproberEntry.h" +#include "core/PartUtils.h" #include "ReplaceWidget.h" #include "PrettyRadioButton.h" @@ -676,9 +677,17 @@ ChoicePage::updateDeviceStatePreview() switch ( m_choice ) { case Replace: + m_beforePartitionBarsView->setSelectionMode( QAbstractItemView::SingleSelection ); + m_beforePartitionLabelsView->setSelectionMode( QAbstractItemView::SingleSelection ); + break; case Alongside: m_beforePartitionBarsView->setSelectionMode( QAbstractItemView::SingleSelection ); m_beforePartitionLabelsView->setSelectionMode( QAbstractItemView::SingleSelection ); + m_beforePartitionBarsView->setSelectionFilter( [ this ]( const QModelIndex& index ) + { + return PartUtils::canBeResized( m_core, + index.data( PartitionModel::PartitionPathRole ).toString() ); + }); break; default: m_beforePartitionBarsView->setSelectionMode( QAbstractItemView::NoSelection );