From 9965849765bb113801d2d4c93e07fc259d307f3e Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Tue, 19 Mar 2013 22:01:36 +0100 Subject: Add option to temporarily show proxy password. Change-Id: I9c4394dbe679584a0b0f9b6105714176354adfe6 --- rbutil/rbutilqt/configure.cpp | 27 ++++++++++++++++++--------- rbutil/rbutilqt/configure.h | 1 + rbutil/rbutilqt/configurefrm.ui | 33 ++++++++++++++++++++------------- 3 files changed, 39 insertions(+), 22 deletions(-) diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp index 075a4876b9..3175ba4430 100644 --- a/rbutil/rbutilqt/configure.cpp +++ b/rbutil/rbutilqt/configure.cpp @@ -111,6 +111,7 @@ Config::Config(QWidget *parent,int index) : QDialog(parent) connect(ui.showDisabled, SIGNAL(toggled(bool)), this, SLOT(showDisabled(bool))); connect(ui.mountPoint, SIGNAL(editTextChanged(QString)), this, SLOT(updateMountpoint(QString))); connect(ui.mountPoint, SIGNAL(currentIndexChanged(int)), this, SLOT(updateMountpoint(int))); + connect(ui.checkShowProxyPassword, SIGNAL(toggled(bool)), this, SLOT(showProxyPassword(bool))); // delete this dialog after it finished automatically. connect(this, SIGNAL(finished(int)), this, SLOT(deleteLater())); @@ -309,6 +310,15 @@ void Config::updateCacheInfo(QString path) } +void Config::showProxyPassword(bool show) +{ + if(show) + ui.proxyPass->setEchoMode(QLineEdit::Normal); + else + ui.proxyPass->setEchoMode(QLineEdit::Password); +} + + void Config::showDisabled(bool show) { qDebug() << "[Config] disabled targets shown:" << show; @@ -471,20 +481,19 @@ void Config::updateEncState() void Config::setNoProxy(bool checked) { - bool i = !checked; - ui.proxyPort->setEnabled(i); - ui.proxyHost->setEnabled(i); - ui.proxyUser->setEnabled(i); - ui.proxyPass->setEnabled(i); + ui.proxyPort->setEnabled(!checked); + ui.proxyHost->setEnabled(!checked); + ui.proxyUser->setEnabled(!checked); + ui.proxyPass->setEnabled(!checked); + ui.checkShowProxyPassword->setEnabled(!checked); + ui.checkShowProxyPassword->setChecked(false); + showProxyPassword(false); } void Config::setSystemProxy(bool checked) { - ui.proxyPort->setEnabled(!checked); - ui.proxyHost->setEnabled(!checked); - ui.proxyUser->setEnabled(!checked); - ui.proxyPass->setEnabled(!checked); + setNoProxy(checked); if(checked) { // save values in input box proxy.setScheme("http"); diff --git a/rbutil/rbutilqt/configure.h b/rbutil/rbutilqt/configure.h index ec9aebfa00..dd80f65b31 100644 --- a/rbutil/rbutilqt/configure.h +++ b/rbutil/rbutilqt/configure.h @@ -56,6 +56,7 @@ class Config : public QDialog void changeEvent(QEvent *event); private slots: + void showProxyPassword(bool show); void setNoProxy(bool); void setSystemProxy(bool); void updateLanguage(void); diff --git a/rbutil/rbutilqt/configurefrm.ui b/rbutil/rbutilqt/configurefrm.ui index 491c896907..b0111ac940 100644 --- a/rbutil/rbutilqt/configurefrm.ui +++ b/rbutil/rbutilqt/configurefrm.ui @@ -176,13 +176,6 @@ - - - - true - - - @@ -193,12 +186,6 @@ - - - - - - @@ -226,6 +213,26 @@ + + + + Show + + + + + + + + + + + + + true + + + -- cgit v1.2.3