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