diff options
Diffstat (limited to 'examples/GuiClient/mainDialog.cpp')
| -rw-r--r-- | examples/GuiClient/mainDialog.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/GuiClient/mainDialog.cpp b/examples/GuiClient/mainDialog.cpp index fba4f250..640ab95f 100644 --- a/examples/GuiClient/mainDialog.cpp +++ b/examples/GuiClient/mainDialog.cpp @@ -80,6 +80,11 @@ mainDialog::mainDialog(QWidget *parent): QDialog(parent, Qt::Window), Q_ASSERT(check); check = connect(&m_xmppClient, + SIGNAL(error(QXmppClient::Error)), + this, SLOT(errorClient(QXmppClient::Error))); + Q_ASSERT(check); + + check = connect(&m_xmppClient, SIGNAL(presenceReceived(const QXmppPresence&)), this, SLOT(presenceReceived(const QXmppPresence&))); Q_ASSERT(check); @@ -756,3 +761,33 @@ void mainDialog::action_removeContact(const QString& bareJid) remove.addItem(itemRemove); m_xmppClient.sendPacket(remove); } + +void mainDialog::errorClient(QXmppClient::Error error) +{ + ui->label_throbber->hide(); + + showSignInPage(); + + switch(error) + { + case QXmppClient::SocketError: + showLoginStatus("Socket error"); + break; + case QXmppClient::KeepAliveError: + showLoginStatus("Keep alive error"); + break; + case QXmppClient::XmppStreamError: + switch(m_xmppClient.xmppStreamError()) + { + case QXmppStanza::Error::NotAuthorized: + showLoginStatus("Invalid password"); + break; + default: + showLoginStatus("Stream error"); + break; + } + break; + default: + break; + } +} |
