Files
metabuilder/frontends/qt6/qmllib/MetaBuilder/CSmtpServerForm.qml
johndoe6345789 786f91ec64 Add QML Material lib, demo email UI, and QML refactor
Add a large set of QML components (qml/Material, qml/MetaBuilder, qml/dbal) and a QmlComponents symlink for local development; migrate many frontends/qt6 files into qml/qt6. Replace the email client bootloader with a self-contained demo UI using FakeMUI primitives (MailboxLayout, ThreadList, EmailHeader, ComposeWindow), demo data, handlers, and new folder-navigation styles in globals.css. Update several QML component APIs to new signal/handler names (e.g. selectAllChanged→selectAllToggled, pageChanged→pageRequested, *Changed→*Edited) to standardize events. Add find_config_files() to frontends/qt6/generate_cmake.py to include config JS/JSON in QML/files and resources. Also add /frontends/qt6/_build to .gitignore.
2026-03-19 10:18:09 +00:00

111 lines
3.1 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)
}
ColumnLayout {
Layout.fillWidth: true
spacing: 4
CText { variant: "caption"; text: "Encryption" }
RowLayout {
Layout.fillWidth: true
spacing: 8
Repeater {
model: root.encryptionOptions
delegate: CButton {
text: modelData
variant: root.encryptionIndex === index ? "primary" : "ghost"
size: "sm"
onClicked: root.encryptionEdited(index)
}
}
}
}
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"
}
}
}
}