mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 09:55:37 -04:00
Hook up PartitionLabelsView to model.
This commit is contained in:
parent
3940e2b09d
commit
4f41cf54a9
1 changed files with 15 additions and 2 deletions
|
@ -58,6 +58,9 @@ PartitionPage::PartitionPage( PartitionCoreModule* core, QWidget* parent )
|
||||||
, m_core( core )
|
, m_core( core )
|
||||||
{
|
{
|
||||||
m_ui->setupUi( this );
|
m_ui->setupUi( this );
|
||||||
|
m_ui->partitionLabelsView->setVisible(
|
||||||
|
Calamares::JobQueue::instance()->globalStorage()->
|
||||||
|
value( "alwaysShowPartitionLabels" ).toBool() );
|
||||||
m_ui->deviceComboBox->setModel( m_core->deviceModel() );
|
m_ui->deviceComboBox->setModel( m_core->deviceModel() );
|
||||||
m_ui->bootLoaderComboBox->setModel( m_core->bootLoaderModel() );
|
m_ui->bootLoaderComboBox->setModel( m_core->bootLoaderModel() );
|
||||||
PartitionBarsView::NestedPartitionsMode mode = Calamares::JobQueue::instance()->globalStorage()->
|
PartitionBarsView::NestedPartitionsMode mode = Calamares::JobQueue::instance()->globalStorage()->
|
||||||
|
@ -306,16 +309,25 @@ PartitionPage::updateFromCurrentDevice()
|
||||||
|
|
||||||
PartitionModel* model = m_core->partitionModelForDevice( device );
|
PartitionModel* model = m_core->partitionModelForDevice( device );
|
||||||
m_ui->partitionBarsView->setModel( model );
|
m_ui->partitionBarsView->setModel( model );
|
||||||
|
m_ui->partitionLabelsView->setModel( model );
|
||||||
m_ui->partitionTreeView->setModel( model );
|
m_ui->partitionTreeView->setModel( model );
|
||||||
m_ui->partitionTreeView->expandAll();
|
m_ui->partitionTreeView->expandAll();
|
||||||
|
|
||||||
// Make both views use the same selection model.
|
// Make all views use the same selection model.
|
||||||
if ( m_ui->partitionBarsView->selectionModel() !=
|
if ( m_ui->partitionBarsView->selectionModel() !=
|
||||||
m_ui->partitionTreeView->selectionModel() )
|
m_ui->partitionTreeView->selectionModel() ||
|
||||||
|
m_ui->partitionBarsView->selectionModel() !=
|
||||||
|
m_ui->partitionLabelsView->selectionModel() )
|
||||||
{
|
{
|
||||||
|
// Tree view
|
||||||
QItemSelectionModel* selectionModel = m_ui->partitionTreeView->selectionModel();
|
QItemSelectionModel* selectionModel = m_ui->partitionTreeView->selectionModel();
|
||||||
m_ui->partitionTreeView->setSelectionModel( m_ui->partitionBarsView->selectionModel() );
|
m_ui->partitionTreeView->setSelectionModel( m_ui->partitionBarsView->selectionModel() );
|
||||||
selectionModel->deleteLater();
|
selectionModel->deleteLater();
|
||||||
|
|
||||||
|
// Labels view
|
||||||
|
selectionModel = m_ui->partitionLabelsView->selectionModel();
|
||||||
|
m_ui->partitionLabelsView->setSelectionModel( m_ui->partitionBarsView->selectionModel() );
|
||||||
|
selectionModel->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is necessary because even with the same selection model it might happen that
|
// This is necessary because even with the same selection model it might happen that
|
||||||
|
@ -327,6 +339,7 @@ PartitionPage::updateFromCurrentDevice()
|
||||||
QModelIndex selectedIndex = m_ui->partitionBarsView->selectionModel()->currentIndex();
|
QModelIndex selectedIndex = m_ui->partitionBarsView->selectionModel()->currentIndex();
|
||||||
selectedIndex = selectedIndex.sibling( selectedIndex.row(), 0 );
|
selectedIndex = selectedIndex.sibling( selectedIndex.row(), 0 );
|
||||||
m_ui->partitionBarsView->setCurrentIndex( selectedIndex );
|
m_ui->partitionBarsView->setCurrentIndex( selectedIndex );
|
||||||
|
m_ui->partitionLabelsView->setCurrentIndex( selectedIndex );
|
||||||
}, Qt::UniqueConnection );
|
}, Qt::UniqueConnection );
|
||||||
|
|
||||||
// Must be done here because we need to have a model set to define
|
// Must be done here because we need to have a model set to define
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue