prevent the user from pasting a partition on another that is too big for the
source partition's file system svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1128581
This commit is contained in:
parent
2b1f937917
commit
8b912ffb88
|
@ -669,7 +669,22 @@ bool PartitionManagerWidget::showInsertDialog(Partition& insertedPartition, qint
|
||||||
if (result != KDialog::Accepted)
|
if (result != KDialog::Accepted)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (KMessageBox::warningContinueCancel(this,
|
else
|
||||||
|
{
|
||||||
|
if (selectedPartition()->capacity() > insertedPartition.fileSystem().maxCapacity())
|
||||||
|
{
|
||||||
|
KMessageBox::sorry(this, i18nc("@info",
|
||||||
|
"<para>The target partition is bigger than the source allows.</para>"
|
||||||
|
"<para>You are trying to paste a %2 partition onto an existing partition "
|
||||||
|
"that is bigger than %1, the maximum capacity of a %2 file system.</para>",
|
||||||
|
Capacity(insertedPartition.fileSystem().maxCapacity()).toString(Capacity::AppendUnit),
|
||||||
|
insertedPartition.fileSystem().name()
|
||||||
|
),
|
||||||
|
i18nc("@title:window", "Target Partition Too Big"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (KMessageBox::warningContinueCancel(this,
|
||||||
i18nc("@info", "<para><warning>You are about to lose all data on partition "
|
i18nc("@info", "<para><warning>You are about to lose all data on partition "
|
||||||
"<filename>%1</filename>.</warning></para>"
|
"<filename>%1</filename>.</warning></para>"
|
||||||
"<para>Overwriting one partition with another (or with an image file) will "
|
"<para>Overwriting one partition with another (or with an image file) will "
|
||||||
|
@ -683,6 +698,7 @@ bool PartitionManagerWidget::showInsertDialog(Partition& insertedPartition, qint
|
||||||
KStandardGuiItem::cancel(),
|
KStandardGuiItem::cancel(),
|
||||||
"reallyOverwriteExistingPartition") == KMessageBox::Cancel)
|
"reallyOverwriteExistingPartition") == KMessageBox::Cancel)
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (insertedPartition.length() < sourceLength)
|
if (insertedPartition.length() < sourceLength)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue