import QtQuick import QtQuick.Layouts import qs.Common import qs.Widgets // XMPP's account shape isn't IRC's nick/host/port - it's a single JID // (user@domain, optionally /resource) plus a password, since unlike IRC, // XMPP has no anonymous auth. See actions.h's ChatdXmppAccountOptions for // why this is a separate form/backend path rather than reusing IRC's. ColumnLayout { id: root signal connectRequested(string jid, string password) property string errorText: "" spacing: Theme.spacingXS RowLayout { Layout.fillWidth: true spacing: Theme.spacingXS DankTextField { id: jidField Layout.fillWidth: true placeholderText: "user@example.com" } DankTextField { id: passwordField Layout.preferredWidth: 160 placeholderText: "password" echoMode: TextInput.Password } DankButton { text: "Connect" onClicked: { if (!jidField.text || !passwordField.text) { root.errorText = "JID and password are required."; return; } root.errorText = ""; root.connectRequested(jidField.text, passwordField.text); passwordField.text = ""; } } } StyledText { Layout.fillWidth: true visible: root.errorText !== "" text: root.errorText color: Theme.error wrapMode: Text.WordWrap } }