import QtQuick import QtQuick.Layouts import qs.Common import qs.Services import qs.Widgets // v1 stopgap for account setup (see the project plan: a real in-UI account // editor calling the same addAccount method is a natural follow-up once // this basic flow is proven, not blocking for the first working version). ColumnLayout { id: root signal connectRequested(string nick, string host, int port, bool ssl) property string errorText: "" spacing: Theme.spacingXS RowLayout { Layout.fillWidth: true spacing: Theme.spacingXS DankTextField { id: nickField Layout.preferredWidth: 120 placeholderText: "nick" } DankTextField { id: hostField Layout.fillWidth: true placeholderText: "host" // A real default, not just placeholder text - placeholders // are hint text shown only while the field is empty, they are // NOT the field's value. Relying on someone reading a // placeholder and assuming it's already filled in is exactly // how "click Connect, nothing happens" happens: the click // handler's empty-field guard below silently no-ops. text: "irc.libera.chat" } DankTextField { id: portField Layout.preferredWidth: 70 placeholderText: "port" text: "6697" } DankButton { text: "Connect" onClicked: { console.log("[dankChat/QuickConnectForm] Connect clicked: nick=", JSON.stringify(nickField.text), "host=", JSON.stringify(hostField.text), "port=", JSON.stringify(portField.text)); if (!nickField.text || !hostField.text) { root.errorText = "Nick and host are required."; return; } root.errorText = ""; const port = parseInt(portField.text || "6697", 10); // Everything else this connection needs (SASL, encoding, // flood control, ...) comes from ChatSettings.qml's // "Connection defaults" - this form only asks for what // someone reasonably wants to set per-connection. const ssl = PluginService.loadPluginData("dankChat", "irc.defaultSsl", true); root.connectRequested(nickField.text, hostField.text, port, ssl); } } } StyledText { Layout.fillWidth: true visible: root.errorText !== "" text: root.errorText color: Theme.error wrapMode: Text.WordWrap } }