aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManjeet Dahiya <manjeetdahiya@gmail.com>2010-09-23 13:12:05 +0000
committerManjeet Dahiya <manjeetdahiya@gmail.com>2010-09-23 13:12:05 +0000
commitbe21d89ce38ed6efb567e66a4f4cfef2e538cd57 (patch)
tree088d4fa55a9d273d368179b6b3579ba138a03f62
parent57f0ec04ac5395fd52d59fba14563a8306c067f9 (diff)
downloadqxmpp-be21d89ce38ed6efb567e66a4f4cfef2e538cd57.tar.gz
set password on completion
-rw-r--r--examples/GuiClient/mainDialog.cpp15
-rw-r--r--examples/GuiClient/mainDialog.h1
-rw-r--r--examples/GuiClient/mainDialog.ui4
3 files changed, 17 insertions, 3 deletions
diff --git a/examples/GuiClient/mainDialog.cpp b/examples/GuiClient/mainDialog.cpp
index 896b0993..13fc6fd1 100644
--- a/examples/GuiClient/mainDialog.cpp
+++ b/examples/GuiClient/mainDialog.cpp
@@ -54,9 +54,16 @@ mainDialog::mainDialog(QWidget *parent): QDialog(parent, Qt::Window),
ui->label_throbber->movie()->start();
showSignInPage();
loadAccounts();
- bool check = connect(&m_xmppClient.rosterManager(),
+
+ bool check = connect(ui->lineEdit_userName,
+ SIGNAL(editingFinished()),
+ this, SLOT(userNameLineEdit_editingFinished()));
+ Q_ASSERT(check);
+
+ check = connect(&m_xmppClient.rosterManager(),
SIGNAL(rosterReceived()),
this, SLOT(rosterReceived()));
+ Q_ASSERT(check);
check = connect(&m_xmppClient.rosterManager(),
SIGNAL(rosterChanged(const QString&)),
@@ -519,3 +526,9 @@ void mainDialog::loadAccounts()
completer->setCaseSensitivity(Qt::CaseInsensitive);
ui->lineEdit_userName->setCompleter(completer);
}
+
+void mainDialog::userNameLineEdit_editingFinished()
+{
+ QString passwd = m_accountsCache.getPassword(ui->lineEdit_userName->text());
+ ui->lineEdit_password->setText(passwd);
+}
diff --git a/examples/GuiClient/mainDialog.h b/examples/GuiClient/mainDialog.h
index c9cb073d..dd457fb3 100644
--- a/examples/GuiClient/mainDialog.h
+++ b/examples/GuiClient/mainDialog.h
@@ -78,6 +78,7 @@ private slots:
void updateVCard(const QString& bareJid);
void avatarChanged(const QImage&);
void showProfile(const QString& bareJid);
+ void userNameLineEdit_editingFinished();
private:
void loadAccounts();
diff --git a/examples/GuiClient/mainDialog.ui b/examples/GuiClient/mainDialog.ui
index 4baa3bfc..6269dc42 100644
--- a/examples/GuiClient/mainDialog.ui
+++ b/examples/GuiClient/mainDialog.ui
@@ -136,7 +136,7 @@
<item>
<widget class="QLineEdit" name="lineEdit_userName">
<property name="text">
- <string>qxmpp.test1@gmail.com</string>
+ <string/>
</property>
</widget>
</item>
@@ -150,7 +150,7 @@
<item>
<widget class="QLineEdit" name="lineEdit_password">
<property name="text">
- <string>qxmpp123</string>
+ <string/>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>