Improve setting ESP.
This commit is contained in:
parent
e27b9fc295
commit
e91d213872
@ -462,16 +462,8 @@ ChoicePage::doAlongsideSetupSplitter( const QModelIndex& current,
|
||||
|
||||
setNextEnabled( m_beforePartitionBarsView->selectionModel()->currentIndex().isValid() );
|
||||
|
||||
QList< Partition* > efiSystemPartitions = m_core->efiSystemPartitions();
|
||||
if ( m_isEfi && m_efiLabel && efiSystemPartitions.count() <= 1 ) //should never happen
|
||||
{
|
||||
m_efiLabel->show();
|
||||
}
|
||||
else if ( m_isEfi && m_efiLabel && efiSystemPartitions.count() > 1 )
|
||||
{
|
||||
m_efiLabel->show();
|
||||
m_efiComboBox->show();
|
||||
}
|
||||
if ( m_isEfi )
|
||||
setupEfiSystemPartitionSelector();
|
||||
|
||||
cDebug() << "Partition selected for Alongside.";
|
||||
}
|
||||
@ -592,16 +584,8 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current,
|
||||
} ),
|
||||
[=]
|
||||
{
|
||||
QList< Partition* > efiSystemPartitions = m_core->efiSystemPartitions();
|
||||
if ( m_isEfi && m_efiLabel && efiSystemPartitions.count() <= 1 ) //should never happen
|
||||
{
|
||||
m_efiLabel->show();
|
||||
}
|
||||
else if ( m_isEfi && m_efiLabel && efiSystemPartitions.count() > 1 )
|
||||
{
|
||||
m_efiLabel->show();
|
||||
m_efiComboBox->show();
|
||||
}
|
||||
if ( m_isEfi )
|
||||
setupEfiSystemPartitionSelector();
|
||||
|
||||
setNextEnabled( !m_beforePartitionBarsView->selectionModel()->selectedRows().isEmpty() );
|
||||
if ( !m_bootloaderComboBox.isNull() &&
|
||||
@ -841,9 +825,31 @@ ChoicePage::updateActionChoicePreview( ChoicePage::Choice choice )
|
||||
m_efiComboBox = new QComboBox( m_previewAfterFrame );
|
||||
efiLayout->addWidget( m_efiComboBox );
|
||||
m_efiLabel->setBuddy( m_efiComboBox );
|
||||
m_efiLabel->hide();
|
||||
m_efiComboBox->hide();
|
||||
efiLayout->addStretch();
|
||||
}
|
||||
|
||||
// Also handle selection behavior on beforeFrame.
|
||||
QAbstractItemView::SelectionMode previewSelectionMode;
|
||||
switch ( m_choice )
|
||||
{
|
||||
case Replace:
|
||||
case Alongside:
|
||||
previewSelectionMode = QAbstractItemView::SingleSelection;
|
||||
break;
|
||||
default:
|
||||
previewSelectionMode = QAbstractItemView::NoSelection;
|
||||
}
|
||||
|
||||
m_beforePartitionBarsView->setSelectionMode( previewSelectionMode );
|
||||
m_beforePartitionLabelsView->setSelectionMode( previewSelectionMode );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ChoicePage::setupEfiSystemPartitionSelector()
|
||||
{
|
||||
Q_ASSERT( m_isEfi );
|
||||
|
||||
// Only the already existing ones:
|
||||
QList< Partition* > efiSystemPartitions = m_core->efiSystemPartitions();
|
||||
@ -884,22 +890,6 @@ ChoicePage::updateActionChoicePreview( ChoicePage::Choice choice )
|
||||
}
|
||||
}
|
||||
|
||||
// Also handle selection behavior on beforeFrame.
|
||||
QAbstractItemView::SelectionMode previewSelectionMode;
|
||||
switch ( m_choice )
|
||||
{
|
||||
case Replace:
|
||||
case Alongside:
|
||||
previewSelectionMode = QAbstractItemView::SingleSelection;
|
||||
break;
|
||||
default:
|
||||
previewSelectionMode = QAbstractItemView::NoSelection;
|
||||
}
|
||||
|
||||
m_beforePartitionBarsView->setSelectionMode( previewSelectionMode );
|
||||
m_beforePartitionLabelsView->setSelectionMode( previewSelectionMode );
|
||||
}
|
||||
|
||||
|
||||
QComboBox*
|
||||
ChoicePage::createBootloaderComboBox( QWidget* parent )
|
||||
|
@ -88,6 +88,7 @@ private:
|
||||
void setupActions();
|
||||
OsproberEntryList getOsproberEntriesForDevice( Device* device ) const;
|
||||
void doAlongsideApply();
|
||||
void setupEfiSystemPartitionSelector();
|
||||
|
||||
bool m_nextEnabled;
|
||||
PartitionCoreModule* m_core;
|
||||
|
Loading…
Reference in New Issue
Block a user