PartitionPreview is now PartitionBarsView.
This commit is contained in:
parent
3beebf4137
commit
b65fe87503
@ -37,7 +37,7 @@ calamares_add_plugin( partition
|
|||||||
gui/AlongsidePage.cpp
|
gui/AlongsidePage.cpp
|
||||||
gui/DeviceInfoWidget.cpp
|
gui/DeviceInfoWidget.cpp
|
||||||
gui/PartitionPage.cpp
|
gui/PartitionPage.cpp
|
||||||
gui/PartitionPreview.cpp
|
gui/PartitionBarsView.cpp
|
||||||
gui/PartitionSizeController.cpp
|
gui/PartitionSizeController.cpp
|
||||||
gui/PartitionSplitterWidget.cpp
|
gui/PartitionSplitterWidget.cpp
|
||||||
gui/PartitionViewStep.cpp
|
gui/PartitionViewStep.cpp
|
||||||
|
@ -98,7 +98,7 @@ this:
|
|||||||
- Use os-prober to find out the installed OS. This information could then be
|
- Use os-prober to find out the installed OS. This information could then be
|
||||||
used in PartitionModel and in the partition views.
|
used in PartitionModel and in the partition views.
|
||||||
|
|
||||||
- PartitionPreview
|
- PartitionBarsView
|
||||||
- Show used space
|
- Show used space
|
||||||
- Highlight selected partition
|
- Highlight selected partition
|
||||||
- Make the partitions clickable
|
- Make the partitions clickable
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "core/PartitionInfo.h"
|
#include "core/PartitionInfo.h"
|
||||||
#include "core/PartitionIterator.h"
|
#include "core/PartitionIterator.h"
|
||||||
#include "gui/PartitionSplitterWidget.h"
|
#include "gui/PartitionSplitterWidget.h"
|
||||||
#include "gui/PartitionPreview.h"
|
#include "gui/PartitionBarsView.h"
|
||||||
|
|
||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
#include "GlobalStorage.h"
|
#include "GlobalStorage.h"
|
||||||
@ -64,7 +64,7 @@ AlongsidePage::AlongsidePage( QWidget* parent )
|
|||||||
|
|
||||||
partitionsComboLayout->addStretch();
|
partitionsComboLayout->addStretch();
|
||||||
|
|
||||||
m_previewWidget = new PartitionPreview;
|
m_previewWidget = new PartitionBarsView;
|
||||||
m_previewWidget->setLabelsVisible( true );
|
m_previewWidget->setLabelsVisible( true );
|
||||||
mainLayout->addWidget( m_previewWidget );
|
mainLayout->addWidget( m_previewWidget );
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ class QLabel;
|
|||||||
class PartitionCoreModule;
|
class PartitionCoreModule;
|
||||||
class PartitionSplitterWidget;
|
class PartitionSplitterWidget;
|
||||||
class Partition;
|
class Partition;
|
||||||
class PartitionPreview;
|
class PartitionBarsView;
|
||||||
class Device;
|
class Device;
|
||||||
|
|
||||||
class AlongsidePage : public QWidget
|
class AlongsidePage : public QWidget
|
||||||
@ -54,7 +54,7 @@ private:
|
|||||||
|
|
||||||
QComboBox* m_partitionsComboBox;
|
QComboBox* m_partitionsComboBox;
|
||||||
PartitionSplitterWidget* m_splitterWidget;
|
PartitionSplitterWidget* m_splitterWidget;
|
||||||
PartitionPreview* m_previewWidget;
|
PartitionBarsView* m_previewWidget;
|
||||||
QLabel* m_sizeLabel;
|
QLabel* m_sizeLabel;
|
||||||
|
|
||||||
QLabel* m_efiLabel;
|
QLabel* m_efiLabel;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include "ReplaceWidget.h"
|
#include "ReplaceWidget.h"
|
||||||
#include "PrettyRadioButton.h"
|
#include "PrettyRadioButton.h"
|
||||||
#include "ExpandableRadioButton.h"
|
#include "ExpandableRadioButton.h"
|
||||||
#include "PartitionPreview.h"
|
#include "PartitionBarsView.h"
|
||||||
#include "DeviceInfoWidget.h"
|
#include "DeviceInfoWidget.h"
|
||||||
|
|
||||||
#include "utils/CalamaresUtilsGui.h"
|
#include "utils/CalamaresUtilsGui.h"
|
||||||
@ -481,7 +481,7 @@ ChoicePage::updateDeviceStatePreview( Device* currentDevice )
|
|||||||
m_previewBeforeFrame->setLayout( layout );
|
m_previewBeforeFrame->setLayout( layout );
|
||||||
layout->setMargin( 0 );
|
layout->setMargin( 0 );
|
||||||
|
|
||||||
PartitionPreview* preview = new PartitionPreview( m_previewBeforeFrame );
|
PartitionBarsView* preview = new PartitionBarsView( m_previewBeforeFrame );
|
||||||
preview->setLabelsVisible( true );
|
preview->setLabelsVisible( true );
|
||||||
|
|
||||||
Device* deviceBefore = m_core->createImmutableDeviceCopy( currentDevice );
|
Device* deviceBefore = m_core->createImmutableDeviceCopy( currentDevice );
|
||||||
@ -530,7 +530,7 @@ ChoicePage::updateActionChoicePreview( Device* currentDevice, ChoicePage::Choice
|
|||||||
case Erase:
|
case Erase:
|
||||||
case Replace:
|
case Replace:
|
||||||
{
|
{
|
||||||
PartitionPreview* preview = new PartitionPreview( m_previewAfterFrame );
|
PartitionBarsView* preview = new PartitionBarsView( m_previewAfterFrame );
|
||||||
preview->setLabelsVisible( true );
|
preview->setLabelsVisible( true );
|
||||||
|
|
||||||
PartitionModel* model = new PartitionModel( preview );
|
PartitionModel* model = new PartitionModel( preview );
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <gui/PartitionPreview.h>
|
#include <gui/PartitionBarsView.h>
|
||||||
|
|
||||||
#include <core/PartitionModel.h>
|
#include <core/PartitionModel.h>
|
||||||
#include <core/ColorUtils.h>
|
#include <core/ColorUtils.h>
|
||||||
@ -49,7 +49,7 @@ buildUnknownDisklabelTexts( Device* dev )
|
|||||||
return texts;
|
return texts;
|
||||||
}
|
}
|
||||||
|
|
||||||
PartitionPreview::PartitionPreview( QWidget* parent )
|
PartitionBarsView::PartitionBarsView( QWidget* parent )
|
||||||
: m_showLabels( false )
|
: m_showLabels( false )
|
||||||
, QAbstractItemView( parent )
|
, QAbstractItemView( parent )
|
||||||
{
|
{
|
||||||
@ -58,20 +58,20 @@ PartitionPreview::PartitionPreview( QWidget* parent )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PartitionPreview::~PartitionPreview()
|
PartitionBarsView::~PartitionBarsView()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QSize
|
QSize
|
||||||
PartitionPreview::minimumSizeHint() const
|
PartitionBarsView::minimumSizeHint() const
|
||||||
{
|
{
|
||||||
return sizeHint();
|
return sizeHint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QSize
|
QSize
|
||||||
PartitionPreview::sizeHint() const
|
PartitionBarsView::sizeHint() const
|
||||||
{
|
{
|
||||||
QAbstractItemModel* modl = model();
|
QAbstractItemModel* modl = model();
|
||||||
if ( m_showLabels && modl )
|
if ( m_showLabels && modl )
|
||||||
@ -84,7 +84,7 @@ PartitionPreview::sizeHint() const
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PartitionPreview::paintEvent( QPaintEvent* event )
|
PartitionBarsView::paintEvent( QPaintEvent* event )
|
||||||
{
|
{
|
||||||
QPainter painter( viewport() );
|
QPainter painter( viewport() );
|
||||||
painter.fillRect( rect(), palette().window() );
|
painter.fillRect( rect(), palette().window() );
|
||||||
@ -144,7 +144,7 @@ drawSection( QPainter* painter, const QRect& rect_, int x, int width, const QMod
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PartitionPreview::drawPartitions( QPainter* painter, const QRect& rect, const QModelIndex& parent )
|
PartitionBarsView::drawPartitions( QPainter* painter, const QRect& rect, const QModelIndex& parent )
|
||||||
{
|
{
|
||||||
PartitionModel* modl = qobject_cast< PartitionModel* >( model() );
|
PartitionModel* modl = qobject_cast< PartitionModel* >( model() );
|
||||||
if ( !modl )
|
if ( !modl )
|
||||||
@ -214,7 +214,7 @@ drawPartitionSquare( QPainter* painter, const QRect& rect, const QBrush& brush )
|
|||||||
|
|
||||||
|
|
||||||
QModelIndexList
|
QModelIndexList
|
||||||
PartitionPreview::getIndexesToDraw( const QModelIndex& parent ) const
|
PartitionBarsView::getIndexesToDraw( const QModelIndex& parent ) const
|
||||||
{
|
{
|
||||||
QModelIndexList list;
|
QModelIndexList list;
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ PartitionPreview::getIndexesToDraw( const QModelIndex& parent ) const
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PartitionPreview::drawLabels( QPainter* painter, const QRect& rect, const QModelIndex& parent )
|
PartitionBarsView::drawLabels( QPainter* painter, const QRect& rect, const QModelIndex& parent )
|
||||||
{
|
{
|
||||||
PartitionModel* modl = qobject_cast< PartitionModel* >( model() );
|
PartitionModel* modl = qobject_cast< PartitionModel* >( model() );
|
||||||
if ( !modl )
|
if ( !modl )
|
||||||
@ -276,7 +276,7 @@ PartitionPreview::drawLabels( QPainter* painter, const QRect& rect, const QModel
|
|||||||
|
|
||||||
|
|
||||||
QSize
|
QSize
|
||||||
PartitionPreview::sizeForAllLabels( int maxLineWidth ) const
|
PartitionBarsView::sizeForAllLabels( int maxLineWidth ) const
|
||||||
{
|
{
|
||||||
PartitionModel* modl = qobject_cast< PartitionModel* >( model() );
|
PartitionModel* modl = qobject_cast< PartitionModel* >( model() );
|
||||||
if ( !modl )
|
if ( !modl )
|
||||||
@ -322,7 +322,7 @@ PartitionPreview::sizeForAllLabels( int maxLineWidth ) const
|
|||||||
|
|
||||||
|
|
||||||
QSize
|
QSize
|
||||||
PartitionPreview::sizeForLabel( const QStringList& text ) const
|
PartitionBarsView::sizeForLabel( const QStringList& text ) const
|
||||||
{
|
{
|
||||||
int vertOffset = 0;
|
int vertOffset = 0;
|
||||||
int width = 0;
|
int width = 0;
|
||||||
@ -339,7 +339,7 @@ PartitionPreview::sizeForLabel( const QStringList& text ) const
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PartitionPreview::drawLabel( QPainter* painter,
|
PartitionBarsView::drawLabel( QPainter* painter,
|
||||||
const QStringList& text,
|
const QStringList& text,
|
||||||
const QColor& color,
|
const QColor& color,
|
||||||
const QPoint& pos )
|
const QPoint& pos )
|
||||||
@ -367,48 +367,48 @@ PartitionPreview::drawLabel( QPainter* painter,
|
|||||||
|
|
||||||
|
|
||||||
QModelIndex
|
QModelIndex
|
||||||
PartitionPreview::indexAt( const QPoint& point ) const
|
PartitionBarsView::indexAt( const QPoint& point ) const
|
||||||
{
|
{
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QRect
|
QRect
|
||||||
PartitionPreview::visualRect( const QModelIndex& index ) const
|
PartitionBarsView::visualRect( const QModelIndex& index ) const
|
||||||
{
|
{
|
||||||
return QRect();
|
return QRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QRegion
|
QRegion
|
||||||
PartitionPreview::visualRegionForSelection( const QItemSelection& selection ) const
|
PartitionBarsView::visualRegionForSelection( const QItemSelection& selection ) const
|
||||||
{
|
{
|
||||||
return QRegion();
|
return QRegion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
PartitionPreview::horizontalOffset() const
|
PartitionBarsView::horizontalOffset() const
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
PartitionPreview::verticalOffset() const
|
PartitionBarsView::verticalOffset() const
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PartitionPreview::scrollTo( const QModelIndex& index, ScrollHint hint )
|
PartitionBarsView::scrollTo( const QModelIndex& index, ScrollHint hint )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PartitionPreview::setLabelsVisible( bool visible )
|
PartitionBarsView::setLabelsVisible( bool visible )
|
||||||
{
|
{
|
||||||
m_showLabels = visible;
|
m_showLabels = visible;
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
@ -417,27 +417,27 @@ PartitionPreview::setLabelsVisible( bool visible )
|
|||||||
|
|
||||||
|
|
||||||
QModelIndex
|
QModelIndex
|
||||||
PartitionPreview::moveCursor( CursorAction cursorAction, Qt::KeyboardModifiers modifiers )
|
PartitionBarsView::moveCursor( CursorAction cursorAction, Qt::KeyboardModifiers modifiers )
|
||||||
{
|
{
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
PartitionPreview::isIndexHidden( const QModelIndex& index ) const
|
PartitionBarsView::isIndexHidden( const QModelIndex& index ) const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PartitionPreview::setSelection( const QRect& rect, QItemSelectionModel::SelectionFlags flags )
|
PartitionBarsView::setSelection( const QRect& rect, QItemSelectionModel::SelectionFlags flags )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PartitionPreview::updateGeometries()
|
PartitionBarsView::updateGeometries()
|
||||||
{
|
{
|
||||||
updateGeometry(); //get a new rect() for redrawing all the labels
|
updateGeometry(); //get a new rect() for redrawing all the labels
|
||||||
}
|
}
|
@ -28,11 +28,11 @@
|
|||||||
* call any PartitionModel-specific methods: it should be usable with other
|
* call any PartitionModel-specific methods: it should be usable with other
|
||||||
* models as long as they provide the same roles PartitionModel provides.
|
* models as long as they provide the same roles PartitionModel provides.
|
||||||
*/
|
*/
|
||||||
class PartitionPreview : public QAbstractItemView
|
class PartitionBarsView : public QAbstractItemView
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit PartitionPreview( QWidget* parent = nullptr );
|
explicit PartitionBarsView( QWidget* parent = nullptr );
|
||||||
~PartitionPreview();
|
~PartitionBarsView();
|
||||||
|
|
||||||
QSize minimumSizeHint() const override;
|
QSize minimumSizeHint() const override;
|
||||||
|
|
@ -266,7 +266,7 @@ PartitionPage::updateFromCurrentDevice()
|
|||||||
disconnect( oldModel, 0, this, 0 );
|
disconnect( oldModel, 0, this, 0 );
|
||||||
|
|
||||||
PartitionModel* model = m_core->partitionModelForDevice( device );
|
PartitionModel* model = m_core->partitionModelForDevice( device );
|
||||||
m_ui->partitionPreview->setModel( model );
|
m_ui->partitionBarsView->setModel( model );
|
||||||
m_ui->partitionTreeView->setModel( model );
|
m_ui->partitionTreeView->setModel( model );
|
||||||
m_ui->partitionTreeView->expandAll();
|
m_ui->partitionTreeView->expandAll();
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="PartitionPreview" name="partitionPreview"/>
|
<widget class="PartitionBarsView" name="partitionBarsView"/>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTreeView" name="partitionTreeView">
|
<widget class="QTreeView" name="partitionTreeView">
|
||||||
@ -175,9 +175,9 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>PartitionPreview</class>
|
<class>PartitionBarsView</class>
|
||||||
<extends>QFrame</extends>
|
<extends>QFrame</extends>
|
||||||
<header location="global">gui/PartitionPreview.h</header>
|
<header location="global">gui/PartitionBarsView.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include "gui/ChoicePage.h"
|
#include "gui/ChoicePage.h"
|
||||||
#include "gui/AlongsidePage.h"
|
#include "gui/AlongsidePage.h"
|
||||||
#include "gui/PartitionPage.h"
|
#include "gui/PartitionPage.h"
|
||||||
#include "gui/PartitionPreview.h"
|
#include "gui/PartitionBarsView.h"
|
||||||
|
|
||||||
#include "CalamaresVersion.h"
|
#include "CalamaresVersion.h"
|
||||||
#include "utils/CalamaresUtilsGui.h"
|
#include "utils/CalamaresUtilsGui.h"
|
||||||
@ -209,15 +209,15 @@ PartitionViewStep::createSummaryWidget() const
|
|||||||
}
|
}
|
||||||
formLayout->addRow( diskInfoLabel );
|
formLayout->addRow( diskInfoLabel );
|
||||||
|
|
||||||
PartitionPreview* preview;
|
PartitionBarsView* preview;
|
||||||
|
|
||||||
preview = new PartitionPreview;
|
preview = new PartitionBarsView;
|
||||||
preview->setLabelsVisible( true );
|
preview->setLabelsVisible( true );
|
||||||
preview->setModel( info.partitionModelBefore );
|
preview->setModel( info.partitionModelBefore );
|
||||||
info.partitionModelBefore->setParent( widget );
|
info.partitionModelBefore->setParent( widget );
|
||||||
formLayout->addRow( tr( "Before:" ), preview );
|
formLayout->addRow( tr( "Before:" ), preview );
|
||||||
|
|
||||||
preview = new PartitionPreview;
|
preview = new PartitionBarsView;
|
||||||
preview->setLabelsVisible( true );
|
preview->setLabelsVisible( true );
|
||||||
preview->setModel( info.partitionModelAfter );
|
preview->setModel( info.partitionModelAfter );
|
||||||
info.partitionModelAfter->setParent( widget );
|
info.partitionModelAfter->setParent( widget );
|
||||||
|
Loading…
Reference in New Issue
Block a user