Files
metabuilder/qml/MetaBuilder/CSmtpServerForm.qml
johndoe6345789 6e394d7846 style(qt6): 80-char margin enforced — 737 violations → 29 remaining
191 files reformatted across views, components, widgets, hybrid, contexts.
New components: CCreateSchemaDialog, CAddFieldDialog, CAdminContentPanel.
JS helpers: connBadgeStatus/Text, adminStats, exampleLabels, onLevelClicked.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 15:48:39 +00:00

98 lines
2.7 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QmlComponents 1.0
CCard {
id: root
Layout.fillWidth: true
Layout.preferredWidth: 1
property string host: ""
property string port: ""
property string username: ""
property string password: ""
property int encryptionIndex: 1
property var encryptionOptions: ["None", "TLS", "SSL"]
property string connectionStatus: "untested"
signal hostEdited(string value)
signal portEdited(string value)
signal usernameEdited(string value)
signal passwordEdited(string value)
signal encryptionEdited(int index)
signal testRequested()
ColumnLayout {
anchors.fill: parent
anchors.margins: 16
spacing: 12
CText { variant: "h4"; text: "SMTP Server" }
CDivider { Layout.fillWidth: true }
CTextField {
Layout.fillWidth: true
label: "Host"
placeholderText: "smtp.example.com"
text: root.host
onTextChanged: root.hostEdited(text)
}
CTextField {
Layout.fillWidth: true
label: "Port"
placeholderText: "587"
text: root.port
onTextChanged: root.portEdited(text)
}
CTextField {
Layout.fillWidth: true
label: "Username"
placeholderText: "user@example.com"
text: root.username
onTextChanged: root.usernameEdited(text)
}
CTextField {
Layout.fillWidth: true
label: "Password"
placeholderText: "Enter password"
echoMode: TextInput.Password
text: root.password
onTextChanged: root.passwordEdited(text)
}
CEncryptionSelector {
options: root.encryptionOptions
selectedIndex: root.encryptionIndex
onSelectionChanged: function(idx) { root.encryptionEdited(idx) }
}
CDivider { Layout.fillWidth: true }
FlexRow {
Layout.fillWidth: true
spacing: 8
CButton {
text: root.connectionStatus === "testing"
? "Testing..." : "Test Connection"
variant: "primary"
size: "sm"
enabled: root.connectionStatus !== "testing"
onClicked: root.testRequested()
}
CStatusBadge {
visible: root.connectionStatus === "success" ||
root.connectionStatus === "failed"
status: root.connectionStatus === "success"
? "success" : "error"
text: root.connectionStatus === "success" ? "OK" : "Fail"
}
}
}
}