Skip to content
Snippets Groups Projects
Commit 1ad6c7e8 authored by Teo Mrnjavac's avatar Teo Mrnjavac
Browse files

Use new Labels view.

parent eed8d3b8
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,7 @@
#include "core/PartitionIterator.h"
#include "gui/PartitionSplitterWidget.h"
#include "gui/PartitionBarsView.h"
#include "gui/PartitionLabelsView.h"
#include "JobQueue.h"
#include "GlobalStorage.h"
......@@ -65,8 +66,9 @@ AlongsidePage::AlongsidePage( QWidget* parent )
partitionsComboLayout->addStretch();
m_previewWidget = new PartitionBarsView;
m_previewWidget->setLabelsVisible( true );
m_previewLabels = new PartitionLabelsView;
mainLayout->addWidget( m_previewWidget );
mainLayout->addWidget( m_previewLabels );
QLabel* allocateSpaceLabel = new QLabel();
mainLayout->addWidget( allocateSpaceLabel );
......@@ -194,6 +196,7 @@ AlongsidePage::onPartitionSelected( int comboBoxIndex )
partitionModelBefore->setParent( m_previewWidget );
m_previewWidget->setModel( partitionModelBefore );
m_previewLabels->setModel( partitionModelBefore );
m_splitterWidget->init( allPartitionItems );
m_splitterWidget->setSplitPartition( candidate->partitionPath(),
......
......@@ -29,6 +29,7 @@ class PartitionCoreModule;
class PartitionSplitterWidget;
class Partition;
class PartitionBarsView;
class PartitionLabelsView;
class Device;
class AlongsidePage : public QWidget
......@@ -55,6 +56,7 @@ private:
QComboBox* m_partitionsComboBox;
PartitionSplitterWidget* m_splitterWidget;
PartitionBarsView* m_previewWidget;
PartitionLabelsView* m_previewLabels;
QLabel* m_sizeLabel;
QLabel* m_efiLabel;
......
......@@ -29,6 +29,7 @@
#include "PrettyRadioButton.h"
#include "ExpandableRadioButton.h"
#include "PartitionBarsView.h"
#include "PartitionLabelsView.h"
#include "DeviceInfoWidget.h"
#include "utils/CalamaresUtilsGui.h"
......@@ -479,10 +480,11 @@ ChoicePage::updateDeviceStatePreview( Device* currentDevice )
QVBoxLayout* layout = new QVBoxLayout;
m_previewBeforeFrame->setLayout( layout );
layout->setMargin( 0 );
CalamaresUtils::unmarginLayout( layout );
layout->setSpacing( 6 );
PartitionBarsView* preview = new PartitionBarsView( m_previewBeforeFrame );
preview->setLabelsVisible( true );
PartitionLabelsView* previewLabels = new PartitionLabelsView( m_previewBeforeFrame );
Device* deviceBefore = m_core->createImmutableDeviceCopy( currentDevice );
......@@ -495,7 +497,9 @@ ChoicePage::updateDeviceStatePreview( Device* currentDevice )
model->setParent( preview );
preview->setModel( model );
previewLabels->setModel( model );
layout->addWidget( preview );
layout->addWidget( previewLabels );
}
......@@ -518,7 +522,8 @@ ChoicePage::updateActionChoicePreview( Device* currentDevice, ChoicePage::Choice
QVBoxLayout* layout = new QVBoxLayout;
m_previewAfterFrame->setLayout( layout );
layout->setMargin( 0 );
CalamaresUtils::unmarginLayout( layout );
layout->setSpacing( 6 );
switch ( choice )
{
......@@ -531,7 +536,7 @@ ChoicePage::updateActionChoicePreview( Device* currentDevice, ChoicePage::Choice
case Replace:
{
PartitionBarsView* preview = new PartitionBarsView( m_previewAfterFrame );
preview->setLabelsVisible( true );
PartitionLabelsView* previewLabels = new PartitionLabelsView( m_previewAfterFrame );
PartitionModel* model = new PartitionModel( preview );
model->init( currentDevice );
......@@ -540,7 +545,9 @@ ChoicePage::updateActionChoicePreview( Device* currentDevice, ChoicePage::Choice
// see qDeleteAll above.
model->setParent( preview );
preview->setModel( model );
previewLabels->setModel( model );
layout->addWidget( preview );
layout->addWidget( previewLabels );
m_previewAfterFrame->show();
break;
......
......@@ -29,6 +29,7 @@
#include "gui/AlongsidePage.h"
#include "gui/PartitionPage.h"
#include "gui/PartitionBarsView.h"
#include "gui/PartitionLabelsView.h"
#include "CalamaresVersion.h"
#include "utils/CalamaresUtilsGui.h"
......@@ -210,18 +211,32 @@ PartitionViewStep::createSummaryWidget() const
formLayout->addRow( diskInfoLabel );
PartitionBarsView* preview;
PartitionLabelsView* previewLabels;
QVBoxLayout* field;
preview = new PartitionBarsView;
preview->setLabelsVisible( true );
previewLabels = new PartitionLabelsView;
preview->setModel( info.partitionModelBefore );
previewLabels->setModel( info.partitionModelBefore );
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->setLabelsVisible( true );
previewLabels = new PartitionLabelsView;
preview->setModel( info.partitionModelAfter );
previewLabels->setModel( info.partitionModelAfter );
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;
foreach ( const Calamares::job_ptr& job, jobs() )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment