KMessageBox::error(parentWidget(),i18n("There was an error with the downloaded resource tarball file. Possible causes are damaged archive or invalid directory structure in the archive."),i18n("Resource Installation Error"));
errorString="<br>- "+i18n("The validation failed for unknown reason.");
valid=false;
}else
{
KeyStructkey=Security::ref()->signatureKey();
if(!(result&Security::MD5_OK))
{
errorString="<br>- "+i18n("The MD5SUM check failed, the archive might be broken.");
valid=false;
}
if(result&Security::SIGNED_BAD)
{
errorString+="<br>- "+i18n("The signature is bad, the archive might be broken or altered.");
valid=false;
}
if(result&Security::SIGNED_OK)
{
if(result&Security::TRUSTED)
{
kdDebug()<<"Signed and trusted "<<endl;
}else
{
errorString+="<br>- "+i18n("The signature is valid, but untrusted.");
valid=false;
}
}
if(result&Security::UNKNOWN)
{
errorString+="<br>- "+i18n("The signature is unknown.");
valid=false;
}else
{
signatureStr=i18n("The resource was signed with key <i>0x%1</i>, belonging to <i>%2 <%3></i>.").arg(key.id.right(8)).arg(key.name).arg(key.mail);
}
}
if(!valid)
{
signatureStr.prepend("<br>");
if(KMessageBox::warningContinueCancel(parentWidget(),i18n("<qt>There is a problem with the resource file you have downloaded. The errors are :<b>%1</b><br>%2<br><br>Installation of the resource is <b>not recommended</b>.<br><br>Do you want to proceed with the installation?</qt>").arg(errorString).arg(signatureStr),i18n("Problematic Resource File"))==KMessageBox::Continue)
valid=true;
}else
KMessageBox::information(parentWidget(),i18n("<qt>%1<br><br>Press OK to install it.</qt>").arg(signatureStr),i18n("Valid Resource"),"Show Valid Signature Information");
KMessageBox::error(parentWidget(),i18n("The signing failed for unknown reason."));
}else
{
if(result&Security::BAD_PASSPHRASE)
{
if(KMessageBox::warningContinueCancel(parentWidget(),i18n("There are no keys usable for signing or you did not entered the correct passphrase.\nProceed without signing the resource?"))==KMessageBox::Cancel)