Maemo: Allow SSH password to be displayed to the user.

Task-number: QTCREATORBUG-1961
Reviewed-by: kh1
This commit is contained in:
ck
2010-07-28 16:12:49 +02:00
parent 16e9d050b8
commit 62e33d0e7a
3 changed files with 45 additions and 9 deletions

View File

@@ -218,6 +218,7 @@ void MaemoSettingsWidget::fillInValues()
m_ui->userLineEdit->setText(currentConfig().server.uname); m_ui->userLineEdit->setText(currentConfig().server.uname);
m_ui->pwdLineEdit->setText(currentConfig().server.pwd); m_ui->pwdLineEdit->setText(currentConfig().server.pwd);
m_ui->keyFileLineEdit->setPath(currentConfig().server.privateKeyFile); m_ui->keyFileLineEdit->setPath(currentConfig().server.privateKeyFile);
m_ui->showPasswordCheckBox->setChecked(false);
const bool isSimulator const bool isSimulator
= currentConfig().type == MaemoDeviceConfig::Simulator; = currentConfig().type == MaemoDeviceConfig::Simulator;
@@ -317,6 +318,12 @@ void MaemoSettingsWidget::keyFileEditingFinished()
currentConfig().server.privateKeyFile = m_ui->keyFileLineEdit->path(); currentConfig().server.privateKeyFile = m_ui->keyFileLineEdit->path();
} }
void MaemoSettingsWidget::showPassword(bool showClearText)
{
m_ui->pwdLineEdit->setEchoMode(showClearText
? QLineEdit::Normal : QLineEdit::Password);
}
void MaemoSettingsWidget::testConfig() void MaemoSettingsWidget::testConfig()
{ {
QDialog *dialog = new MaemoConfigTestDialog(currentConfig(), this); QDialog *dialog = new MaemoConfigTestDialog(currentConfig(), this);

View File

@@ -83,6 +83,7 @@ private slots:
void userNameEditingFinished(); void userNameEditingFinished();
void passwordEditingFinished(); void passwordEditingFinished();
void keyFileEditingFinished(); void keyFileEditingFinished();
void showPassword(bool showClearText);
// For configuration testing. // For configuration testing.
void testConfig(); void testConfig();

View File

@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>596</width> <width>596</width>
<height>352</height> <height>354</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -266,12 +266,23 @@
</widget> </widget>
</item> </item>
<item row="7" column="1"> <item row="7" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLineEdit" name="pwdLineEdit"> <widget class="QLineEdit" name="pwdLineEdit">
<property name="echoMode"> <property name="echoMode">
<enum>QLineEdit::Password</enum> <enum>QLineEdit::Password</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="showPasswordCheckBox">
<property name="text">
<string>Show password</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="8" column="0"> <item row="8" column="0">
<widget class="QLabel" name="keyLabel"> <widget class="QLabel" name="keyLabel">
<property name="text"> <property name="text">
@@ -410,7 +421,7 @@
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>419</x> <x>419</x>
<y>269</y> <y>268</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>422</x> <x>422</x>
@@ -425,8 +436,8 @@
<slot>passwordEditingFinished()</slot> <slot>passwordEditingFinished()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>419</x> <x>291</x>
<y>300</y> <y>299</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>423</x> <x>423</x>
@@ -706,6 +717,22 @@
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection>
<sender>showPasswordCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>MaemoSettingsWidget</receiver>
<slot>showPassword(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>290</y>
</hint>
<hint type="destinationlabel">
<x>3</x>
<y>262</y>
</hint>
</hints>
</connection>
</connections> </connections>
<slots> <slots>
<slot>configNameEditingFinished()</slot> <slot>configNameEditingFinished()</slot>
@@ -725,5 +752,6 @@
<slot>gdbServerPortEditingFinished()</slot> <slot>gdbServerPortEditingFinished()</slot>
<slot>currentConfigChanged(int)</slot> <slot>currentConfigChanged(int)</slot>
<slot>showGenerateSshKeyDialog()</slot> <slot>showGenerateSshKeyDialog()</slot>
<slot>showPassword(bool)</slot>
</slots> </slots>
</ui> </ui>