warn if user tries to overwrite an existing partition with another or an image

file

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1128576
This commit is contained in:
Volker Lanz 2010-05-19 17:11:15 +00:00
parent 6d939c372d
commit 2b1f937917
1 changed files with 14 additions and 0 deletions

View File

@ -669,6 +669,20 @@ bool PartitionManagerWidget::showInsertDialog(Partition& insertedPartition, qint
if (result != KDialog::Accepted)
return false;
}
else if (KMessageBox::warningContinueCancel(this,
i18nc("@info", "<para><warning>You are about to lose all data on partition "
"<filename>%1</filename>.</warning></para>"
"<para>Overwriting one partition with another (or with an image file) will "
"destroy all data on this target partition.</para>"
"<para>If you continue now and apply the resulting operation in the main "
"window, all data currently stored on <filename>%1</filename> will "
"unrecoverably be overwritten.</para>",
selectedPartition()->deviceNode()),
i18nc("@title:window", "Really Overwrite Existing Partition?"),
KGuiItem(i18nc("@action:button", "Overwrite Partition"), "arrow-right"),
KStandardGuiItem::cancel(),
"reallyOverwriteExistingPartition") == KMessageBox::Cancel)
return false;
if (insertedPartition.length() < sourceLength)
{