5import QtQuick.Controls as QQC2
9import org.kde.kirigami as Kirigami
10import org.kde.kirigamiaddons.formcard 1.0 as FormCard
11import org.kde.kidentitymanagement 1.0
16 required property var identity
17 property alias toAddEmailText: toAddEmail.text
19 function isNotEmptyStr(str) {
20 return str.trim().length > 0;
26 title:
i18n(
"Identity")
32 label:
i18nc(
"@label:textbox",
"Identity Name")
33 text: root.identity.identityName
34 onTextChanged: root.identity.identityName = text
38 Layout.fillWidth:
true
40 text: root.identity.fullName
41 onTextChanged: root.identity.fullName = text
47 text: root.identity.primaryEmailAddress
48 onTextChanged: root.identity.primaryEmailAddress = text
49 inputMethodHints:
Qt.ImhEmailCharactersOnly
54 title:
i18n(
"E-mail aliases")
59 id: emailAliasesRepeater
61 property var emailAliases: root.identity.emailAliases
65 delegate:
FormCard.AbstractFormDelegate {
68 Layout.fillWidth:
true
70 contentItem: RowLayout {
73 Layout.fillWidth:
true
75 inputMethodHints:
Qt.ImhEmailCharactersOnly
77 let emailAliases = emailAliasesRepeater.emailAliases;
78 emailAliases[model.index] = text;
79 identity.emailAliases = emailAliases;
80 emailAliasesRepeater.emailAliases = emailAliases;
85 icon.name:
"list-remove"
86 implicitWidth: implicitHeight
88 text:
i18n(
"Remove email alias")
91 let emailAliases = emailAliasesRepeater.emailAliases;
92 emailAliases = Array.from(emailAliases).filter(email => email !== modelData);
93 identity.emailAliases = emailAliases;
94 emailAliasesRepeater.emailAliases = emailAliases;
102 Layout.fillWidth:
true
104 contentItem: RowLayout {
107 Layout.fillWidth:
true
108 placeholderText:
i18n(
"user@example.org")
109 inputMethodHints:
Qt.ImhEmailCharactersOnly
113 icon.name:
"list-add"
114 implicitWidth: implicitHeight
115 enabled: isNotEmptyStr(toAddEmail.text)
117 text:
i18n(
"Add email alias")
120 let emailAliases = emailAliasesRepeater.emailAliases;
121 emailAliases.push(toAddEmail.text);
122 identity.emailAliases = emailAliasesRepeater.emailAliases;
123 emailAliasesRepeater.emailAliases = emailAliases;
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
QString label(StandardShortcut id)