Use new Labels view.
This commit is contained in:
parent
eed8d3b83b
commit
1ad6c7e8ac
@ -26,6 +26,7 @@
|
|||||||
#include "core/PartitionIterator.h"
|
#include "core/PartitionIterator.h"
|
||||||
#include "gui/PartitionSplitterWidget.h"
|
#include "gui/PartitionSplitterWidget.h"
|
||||||
#include "gui/PartitionBarsView.h"
|
#include "gui/PartitionBarsView.h"
|
||||||
|
#include "gui/PartitionLabelsView.h"
|
||||||
|
|
||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
#include "GlobalStorage.h"
|
#include "GlobalStorage.h"
|
||||||
@ -65,8 +66,9 @@ AlongsidePage::AlongsidePage( QWidget* parent )
|
|||||||
partitionsComboLayout->addStretch();
|
partitionsComboLayout->addStretch();
|
||||||
|
|
||||||
m_previewWidget = new PartitionBarsView;
|
m_previewWidget = new PartitionBarsView;
|
||||||
m_previewWidget->setLabelsVisible( true );
|
m_previewLabels = new PartitionLabelsView;
|
||||||
mainLayout->addWidget( m_previewWidget );
|
mainLayout->addWidget( m_previewWidget );
|
||||||
|
mainLayout->addWidget( m_previewLabels );
|
||||||
|
|
||||||
QLabel* allocateSpaceLabel = new QLabel();
|
QLabel* allocateSpaceLabel = new QLabel();
|
||||||
mainLayout->addWidget( allocateSpaceLabel );
|
mainLayout->addWidget( allocateSpaceLabel );
|
||||||
@ -194,6 +196,7 @@ AlongsidePage::onPartitionSelected( int comboBoxIndex )
|
|||||||
partitionModelBefore->setParent( m_previewWidget );
|
partitionModelBefore->setParent( m_previewWidget );
|
||||||
|
|
||||||
m_previewWidget->setModel( partitionModelBefore );
|
m_previewWidget->setModel( partitionModelBefore );
|
||||||
|
m_previewLabels->setModel( partitionModelBefore );
|
||||||
m_splitterWidget->init( allPartitionItems );
|
m_splitterWidget->init( allPartitionItems );
|
||||||
|
|
||||||
m_splitterWidget->setSplitPartition( candidate->partitionPath(),
|
m_splitterWidget->setSplitPartition( candidate->partitionPath(),
|
||||||
|
@ -29,6 +29,7 @@ class PartitionCoreModule;
|
|||||||
class PartitionSplitterWidget;
|
class PartitionSplitterWidget;
|
||||||
class Partition;
|
class Partition;
|
||||||
class PartitionBarsView;
|
class PartitionBarsView;
|
||||||
|
class PartitionLabelsView;
|
||||||
class Device;
|
class Device;
|
||||||
|
|
||||||
class AlongsidePage : public QWidget
|
class AlongsidePage : public QWidget
|
||||||
@ -55,6 +56,7 @@ private:
|
|||||||
QComboBox* m_partitionsComboBox;
|
QComboBox* m_partitionsComboBox;
|
||||||
PartitionSplitterWidget* m_splitterWidget;
|
PartitionSplitterWidget* m_splitterWidget;
|
||||||
PartitionBarsView* m_previewWidget;
|
PartitionBarsView* m_previewWidget;
|
||||||
|
PartitionLabelsView* m_previewLabels;
|
||||||
QLabel* m_sizeLabel;
|
QLabel* m_sizeLabel;
|
||||||
|
|
||||||
QLabel* m_efiLabel;
|
QLabel* m_efiLabel;
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "PrettyRadioButton.h"
|
#include "PrettyRadioButton.h"
|
||||||
#include "ExpandableRadioButton.h"
|
#include "ExpandableRadioButton.h"
|
||||||
#include "PartitionBarsView.h"
|
#include "PartitionBarsView.h"
|
||||||
|
#include "PartitionLabelsView.h"
|
||||||
#include "DeviceInfoWidget.h"
|
#include "DeviceInfoWidget.h"
|
||||||
|
|
||||||
#include "utils/CalamaresUtilsGui.h"
|
#include "utils/CalamaresUtilsGui.h"
|
||||||
@ -479,10 +480,11 @@ ChoicePage::updateDeviceStatePreview( Device* currentDevice )
|
|||||||
|
|
||||||
QVBoxLayout* layout = new QVBoxLayout;
|
QVBoxLayout* layout = new QVBoxLayout;
|
||||||
m_previewBeforeFrame->setLayout( layout );
|
m_previewBeforeFrame->setLayout( layout );
|
||||||
layout->setMargin( 0 );
|
CalamaresUtils::unmarginLayout( layout );
|
||||||
|
layout->setSpacing( 6 );
|
||||||
|
|
||||||
PartitionBarsView* preview = new PartitionBarsView( m_previewBeforeFrame );
|
PartitionBarsView* preview = new PartitionBarsView( m_previewBeforeFrame );
|
||||||
preview->setLabelsVisible( true );
|
PartitionLabelsView* previewLabels = new PartitionLabelsView( m_previewBeforeFrame );
|
||||||
|
|
||||||
Device* deviceBefore = m_core->createImmutableDeviceCopy( currentDevice );
|
Device* deviceBefore = m_core->createImmutableDeviceCopy( currentDevice );
|
||||||
|
|
||||||
@ -495,7 +497,9 @@ ChoicePage::updateDeviceStatePreview( Device* currentDevice )
|
|||||||
model->setParent( preview );
|
model->setParent( preview );
|
||||||
|
|
||||||
preview->setModel( model );
|
preview->setModel( model );
|
||||||
|
previewLabels->setModel( model );
|
||||||
layout->addWidget( preview );
|
layout->addWidget( preview );
|
||||||
|
layout->addWidget( previewLabels );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -518,7 +522,8 @@ ChoicePage::updateActionChoicePreview( Device* currentDevice, ChoicePage::Choice
|
|||||||
|
|
||||||
QVBoxLayout* layout = new QVBoxLayout;
|
QVBoxLayout* layout = new QVBoxLayout;
|
||||||
m_previewAfterFrame->setLayout( layout );
|
m_previewAfterFrame->setLayout( layout );
|
||||||
layout->setMargin( 0 );
|
CalamaresUtils::unmarginLayout( layout );
|
||||||
|
layout->setSpacing( 6 );
|
||||||
|
|
||||||
switch ( choice )
|
switch ( choice )
|
||||||
{
|
{
|
||||||
@ -531,7 +536,7 @@ ChoicePage::updateActionChoicePreview( Device* currentDevice, ChoicePage::Choice
|
|||||||
case Replace:
|
case Replace:
|
||||||
{
|
{
|
||||||
PartitionBarsView* preview = new PartitionBarsView( m_previewAfterFrame );
|
PartitionBarsView* preview = new PartitionBarsView( m_previewAfterFrame );
|
||||||
preview->setLabelsVisible( true );
|
PartitionLabelsView* previewLabels = new PartitionLabelsView( m_previewAfterFrame );
|
||||||
|
|
||||||
PartitionModel* model = new PartitionModel( preview );
|
PartitionModel* model = new PartitionModel( preview );
|
||||||
model->init( currentDevice );
|
model->init( currentDevice );
|
||||||
@ -540,7 +545,9 @@ ChoicePage::updateActionChoicePreview( Device* currentDevice, ChoicePage::Choice
|
|||||||
// see qDeleteAll above.
|
// see qDeleteAll above.
|
||||||
model->setParent( preview );
|
model->setParent( preview );
|
||||||
preview->setModel( model );
|
preview->setModel( model );
|
||||||
|
previewLabels->setModel( model );
|
||||||
layout->addWidget( preview );
|
layout->addWidget( preview );
|
||||||
|
layout->addWidget( previewLabels );
|
||||||
|
|
||||||
m_previewAfterFrame->show();
|
m_previewAfterFrame->show();
|
||||||
break;
|
break;
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "gui/AlongsidePage.h"
|
#include "gui/AlongsidePage.h"
|
||||||
#include "gui/PartitionPage.h"
|
#include "gui/PartitionPage.h"
|
||||||
#include "gui/PartitionBarsView.h"
|
#include "gui/PartitionBarsView.h"
|
||||||
|
#include "gui/PartitionLabelsView.h"
|
||||||
|
|
||||||
#include "CalamaresVersion.h"
|
#include "CalamaresVersion.h"
|
||||||
#include "utils/CalamaresUtilsGui.h"
|
#include "utils/CalamaresUtilsGui.h"
|
||||||
@ -210,18 +211,32 @@ PartitionViewStep::createSummaryWidget() const
|
|||||||
formLayout->addRow( diskInfoLabel );
|
formLayout->addRow( diskInfoLabel );
|
||||||
|
|
||||||
PartitionBarsView* preview;
|
PartitionBarsView* preview;
|
||||||
|
PartitionLabelsView* previewLabels;
|
||||||
|
QVBoxLayout* field;
|
||||||
|
|
||||||
preview = new PartitionBarsView;
|
preview = new PartitionBarsView;
|
||||||
preview->setLabelsVisible( true );
|
previewLabels = new PartitionLabelsView;
|
||||||
preview->setModel( info.partitionModelBefore );
|
preview->setModel( info.partitionModelBefore );
|
||||||
|
previewLabels->setModel( info.partitionModelBefore );
|
||||||
info.partitionModelBefore->setParent( widget );
|
info.partitionModelBefore->setParent( widget );
|
||||||
formLayout->addRow( tr( "Before:" ), preview );
|
field = new QVBoxLayout;
|
||||||
|
CalamaresUtils::unmarginLayout( field );
|
||||||
|
field->setSpacing( 6 );
|
||||||
|
field->addWidget( preview );
|
||||||
|
field->addWidget( previewLabels );
|
||||||
|
formLayout->addRow( tr( "Current state:" ), field );
|
||||||
|
|
||||||
preview = new PartitionBarsView;
|
preview = new PartitionBarsView;
|
||||||
preview->setLabelsVisible( true );
|
previewLabels = new PartitionLabelsView;
|
||||||
preview->setModel( info.partitionModelAfter );
|
preview->setModel( info.partitionModelAfter );
|
||||||
|
previewLabels->setModel( info.partitionModelAfter );
|
||||||
info.partitionModelAfter->setParent( widget );
|
info.partitionModelAfter->setParent( widget );
|
||||||
formLayout->addRow( tr( "After:" ), preview );
|
field = new QVBoxLayout;
|
||||||
|
CalamaresUtils::unmarginLayout( field );
|
||||||
|
field->setSpacing( 6 );
|
||||||
|
field->addWidget( preview );
|
||||||
|
field->addWidget( previewLabels );
|
||||||
|
formLayout->addRow( tr( "Your changes:" ), field );
|
||||||
}
|
}
|
||||||
QStringList jobsLines;
|
QStringList jobsLines;
|
||||||
foreach ( const Calamares::job_ptr& job, jobs() )
|
foreach ( const Calamares::job_ptr& job, jobs() )
|
||||||
|
Loading…
Reference in New Issue
Block a user