Set unresizable partitions as read only.
BUG:310632 svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1327840
This commit is contained in:
parent
90baf68b40
commit
298fcf1772
|
@ -82,7 +82,7 @@ void PartResizerWidget::init(Device& d, Partition& p, qint64 minFirst, qint64 ma
|
|||
setMaximumLastSector(maxLast);
|
||||
|
||||
setReadOnly(read_only);
|
||||
setMoveAllowed(move_allowed && !read_only);
|
||||
setMoveAllowed(move_allowed);
|
||||
|
||||
setMinimumLength(qMax(partition().sectorsUsed(), partition().minimumSectors()));
|
||||
setMaximumLength(qMin(totalSectors(), partition().maximumSectors()));
|
||||
|
@ -121,13 +121,13 @@ void PartResizerWidget::init(Device& d, Partition& p, qint64 minFirst, qint64 ma
|
|||
{
|
||||
leftHandle().setCursor(Qt::SizeHorCursor);
|
||||
rightHandle().setCursor(Qt::SizeHorCursor);
|
||||
|
||||
if (moveAllowed())
|
||||
partWidget().setCursor(Qt::SizeAllCursor);
|
||||
|
||||
partWidget().setToolTip(QString());
|
||||
}
|
||||
|
||||
if (moveAllowed())
|
||||
partWidget().setCursor(Qt::SizeAllCursor);
|
||||
|
||||
partWidget().setToolTip(QString());
|
||||
|
||||
updatePositions();
|
||||
}
|
||||
|
||||
|
@ -189,9 +189,6 @@ void PartResizerWidget::paintEvent(QPaintEvent*)
|
|||
|
||||
void PartResizerWidget::mousePressEvent(QMouseEvent* event)
|
||||
{
|
||||
if (readOnly())
|
||||
return;
|
||||
|
||||
if (event->button() == Qt::LeftButton)
|
||||
{
|
||||
m_DraggedWidget = static_cast<QWidget*>(childAt(event->pos()));
|
||||
|
|
|
@ -74,7 +74,10 @@ void SizeDialogBase::setupDialog()
|
|||
|
||||
detailsWidget().checkAlign().setChecked(Config::alignDefault());
|
||||
|
||||
dialogWidget().partResizerWidget().init(device(), partition(), minimumFirstSector(), maximumLastSector(), false, canMove());
|
||||
if (canGrow() || canShrink())
|
||||
dialogWidget().partResizerWidget().init(device(), partition(), minimumFirstSector(), maximumLastSector(), false, canMove());
|
||||
else
|
||||
dialogWidget().partResizerWidget().init(device(), partition(), minimumFirstSector(), maximumLastSector(), true, canMove());
|
||||
dialogWidget().partResizerWidget().setAlign(Config::alignDefault());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue