diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-04-05 18:16:21 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-04-05 18:16:21 +0200 |
commit | ebab00d8ab733e252dc61a794b5cd2d672f0ffd0 (patch) | |
tree | 5b6e8d4612f70e1e514e8f97525c8e6d9dad56c3 /src/networkaccessmanager.cpp | |
parent | tab bar refactoring (diff) | |
parent | Ported Authentication Ui to Kdialog shining.. ;) (diff) | |
download | rekonq-ebab00d8ab733e252dc61a794b5cd2d672f0ffd0.tar.xz |
Merge branch 'KDialogs'
Diffstat (limited to 'src/networkaccessmanager.cpp')
-rw-r--r-- | src/networkaccessmanager.cpp | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp index 26078ed6..1d9f2a78 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 @@ -99,24 +99,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()); } } @@ -124,23 +125,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()); } } |