summaryrefslogtreecommitdiff
path: root/src/networkaccessmanager.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-04-05 18:13:13 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-04-05 18:13:13 +0200
commit245509053d7fd6427b8d7170ab088917b7fe70f0 (patch)
treeead7cc8fd6ff6869c7f3b6ec4debdc8369a07f77 /src/networkaccessmanager.cpp
parentpedantic (diff)
downloadrekonq-245509053d7fd6427b8d7170ab088917b7fe70f0.tar.xz
Ported Authentication Ui to Kdialog shining.. ;)
Diffstat (limited to 'src/networkaccessmanager.cpp')
-rw-r--r--src/networkaccessmanager.cpp44
1 files changed, 23 insertions, 21 deletions
diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp
index 3c15bcf5..028dfabb 100644
--- a/src/networkaccessmanager.cpp
+++ b/src/networkaccessmanager.cpp
@@ -31,7 +31,7 @@
#include "rekonq.h"
// Ui Includes
-#include "ui_passworddialog.h"
+#include "ui_password.h"
#include "ui_proxy.h"
// KDE Includes
@@ -104,24 +104,25 @@ void NetworkAccessManager::authenticationRequired(QNetworkReply *reply, QAuthent
{
MainWindow *mainWindow = Application::instance()->mainWindow();
- QDialog dialog(mainWindow);
- dialog.setWindowFlags(Qt::Sheet);
+ KDialog dialog(mainWindow,Qt::Sheet);
- Ui::PasswordDialog passwordDialog;
- passwordDialog.setupUi(&dialog);
+ Ui::passwordWidget passwordWidget;
+ passwordWidget.setupUi(&dialog);
- passwordDialog.iconLabel->setText(QString());
- passwordDialog.iconLabel->setPixmap(mainWindow->style()->standardIcon(QStyle::SP_MessageBoxQuestion, 0, mainWindow).pixmap(32, 32));
+ dialog.setButtons( KDialog::Ok | KDialog::Cancel );
+
+ passwordWidget.iconLabel->setText(QString());
+ passwordWidget.iconLabel->setPixmap(mainWindow->style()->standardIcon(QStyle::SP_MessageBoxQuestion, 0, mainWindow).pixmap(32, 32));
QString introMessage = i18n("<qt>Enter username and password for ") +
Qt::escape(reply->url().toString()) + i18n(" at ") + Qt::escape(reply->url().toString()) + "</qt>";
- passwordDialog.introLabel->setText(introMessage);
- passwordDialog.introLabel->setWordWrap(true);
+ passwordWidget.introLabel->setText(introMessage);
+ passwordWidget.introLabel->setWordWrap(true);
if (dialog.exec() == QDialog::Accepted)
{
- auth->setUser(passwordDialog.userNameLineEdit->text());
- auth->setPassword(passwordDialog.passwordLineEdit->text());
+ auth->setUser(passwordWidget.userNameLineEdit->text());
+ auth->setPassword(passwordWidget.passwordLineEdit->text());
}
}
@@ -129,23 +130,24 @@ void NetworkAccessManager::proxyAuthenticationRequired(const QNetworkProxy &prox
{
MainWindow *mainWindow = Application::instance()->mainWindow();
- QDialog dialog(mainWindow);
- dialog.setWindowFlags(Qt::Sheet);
+ KDialog dialog(mainWindow, Qt::Sheet);
+
+ Ui::proxyWidget proxyWdg;
+ proxyWdg.setupUi(&dialog);
- Ui::ProxyDialog proxyDialog;
- proxyDialog.setupUi(&dialog);
+ dialog.setButtons( KDialog::Ok | KDialog::Cancel );
- proxyDialog.iconLabel->setText(QString());
- proxyDialog.iconLabel->setPixmap(mainWindow->style()->standardIcon(QStyle::SP_MessageBoxQuestion, 0, mainWindow).pixmap(32, 32));
+ proxyWdg.iconLabel->setText(QString());
+ proxyWdg.iconLabel->setPixmap(mainWindow->style()->standardIcon(QStyle::SP_MessageBoxQuestion, 0, mainWindow).pixmap(32, 32));
QString introMessage = i18n("<qt>Connect to proxy ") + Qt::escape(proxy.hostName()) + i18n(" using:</qt>");
- proxyDialog.introLabel->setText(introMessage);
- proxyDialog.introLabel->setWordWrap(true);
+ proxyWdg.introLabel->setText(introMessage);
+ proxyWdg.introLabel->setWordWrap(true);
if (dialog.exec() == QDialog::Accepted)
{
- auth->setUser(proxyDialog.userNameLineEdit->text());
- auth->setPassword(proxyDialog.passwordLineEdit->text());
+ auth->setUser(proxyWdg.userNameLineEdit->text());
+ auth->setPassword(proxyWdg.passwordLineEdit->text());
}
}