Set unresizable partitions as read only.

BUG:310632

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1327840
This commit is contained in:
Andrius Štikonas 2012-12-09 15:54:22 +00:00
parent 90baf68b40
commit 298fcf1772
2 changed files with 10 additions and 10 deletions

View File

@ -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()));

View File

@ -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());
}