Implement authenticate slot in download dialog

This commit is contained in:
wmayer
2013-05-25 14:02:26 +02:00
parent ff031ec4c6
commit fad26c93a5
2 changed files with 69 additions and 125 deletions

View File

@@ -27,7 +27,9 @@
# include <QHBoxLayout>
#endif
#include <QAuthenticator>
#include "DownloadDialog.h"
#include "ui_DlgAuthorization.h"
using namespace Gui::Dialog;
@@ -202,6 +204,16 @@ void DownloadDialog::updateDataReadProgress(int bytesRead, int totalBytes)
void DownloadDialog::slotAuthenticationRequired(const QString &hostName, quint16, QAuthenticator *authenticator)
{
QDialog dlg;
Ui_DlgAuthorization ui;
ui.setupUi(&dlg);
dlg.adjustSize();
ui.siteDescription->setText(tr("%1 at %2").arg(authenticator->realm()).arg(hostName));
if (dlg.exec() == QDialog::Accepted) {
authenticator->setUser(ui.username->text());
authenticator->setPassword(ui.password->text());
}
}