1
0
Fork 0
forked from len0rd/rockbox

Add option to temporarily show proxy password.

Change-Id: I9c4394dbe679584a0b0f9b6105714176354adfe6
This commit is contained in:
Dominik Riebeling 2013-03-19 22:01:36 +01:00
parent 0d5883d07a
commit 9965849765
3 changed files with 39 additions and 22 deletions

View file

@ -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");

View file

@ -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);

View file

@ -176,13 +176,6 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="proxyHost">
<property name="frame">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
@ -193,12 +186,6 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="proxyPort"/>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="proxyUser"/>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="proxyPass">
<property name="echoMode">
@ -226,6 +213,26 @@
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QCheckBox" name="checkShowProxyPassword">
<property name="text">
<string>Show</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QLineEdit" name="proxyUser"/>
</item>
<item row="1" column="1" colspan="2">
<widget class="QLineEdit" name="proxyPort"/>
</item>
<item row="0" column="1" colspan="2">
<widget class="QLineEdit" name="proxyHost">
<property name="frame">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>