2024-11-07 10:45:47 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
import Qt.labs.settings 1.1
|
|
|
|
|
|
|
|
import shared.views.chat 1.0
|
|
|
|
import utils 1.0
|
2024-09-06 15:55:44 +00:00
|
|
|
|
|
|
|
import Storybook 1.0
|
|
|
|
import Models 1.0
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
Logs { id: logs }
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
Item {
|
2024-09-06 15:55:44 +00:00
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
2024-11-07 10:45:47 +00:00
|
|
|
|
|
|
|
ProfileContextMenu {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
visible: true
|
|
|
|
closePolicy: Popup.NoAutoClose
|
|
|
|
userIcon: useIconCheckBox.checked ? ModelsData.icons.cryptPunks : ""
|
|
|
|
|
|
|
|
compressedPubKey: "zQ3shQBu4PRDX17veeYYhSczbTjgi44iTXxcMNvQLeyQsBDF4"
|
|
|
|
displayName: displayNameTextField.text
|
|
|
|
hideDisabledItems: hideDisabledCheckBox.checked
|
|
|
|
profileType: profileTypeSelector.currentValue
|
|
|
|
trustStatus: trustStatusSelector.currentValue
|
|
|
|
contactType: contactTypeSelector.currentValue
|
|
|
|
ensVerified: ensVerifiedCheckBox.checked
|
|
|
|
onlineStatus: onlineStatusSelector.currentValue
|
|
|
|
hasLocalNickname: hasLocalNicknameCheckBox.checked
|
|
|
|
chatType: chatTypeSelector.currentValue
|
|
|
|
isAdmin: isAdminCheckBox.checked
|
|
|
|
|
|
|
|
colorHash: [
|
|
|
|
{ segmentLength: 3, colorId: 11 },
|
|
|
|
{ segmentLength: 5, colorId: 9 },
|
|
|
|
{ segmentLength: 1, colorId: 26 },
|
|
|
|
{ segmentLength: 2, colorId: 19 },
|
|
|
|
{ segmentLength: 5, colorId: 17 }
|
|
|
|
]
|
|
|
|
|
|
|
|
colorId: colorIdSpinBox.value
|
|
|
|
|
|
|
|
onOpenProfileClicked: logs.logEvent("Open profile clicked")
|
|
|
|
onCreateOneToOneChat: logs.logEvent("Create one-to-one chat clicked")
|
|
|
|
onReviewContactRequest: logs.logEvent("Review contact request")
|
|
|
|
onSendContactRequest: logs.logEvent("Send contact request")
|
|
|
|
onEditNickname: logs.logEvent("Edit nickname")
|
|
|
|
onRemoveNickname: logs.logEvent("Remove nickname")
|
|
|
|
onUnblockContact: logs.logEvent("Unblock contact")
|
|
|
|
onMarkAsUntrusted: logs.logEvent("Mark as untrusted")
|
|
|
|
onRemoveTrustStatus: logs.logEvent("Remove trust status")
|
|
|
|
onRemoveContact: logs.logEvent("Remove contact")
|
|
|
|
onBlockContact: logs.logEvent("Block contact")
|
|
|
|
onRemoveFromGroup: logs.logEvent("Remove from group")
|
|
|
|
|
|
|
|
onClosed: open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
id: logsAndControlsPanel
|
|
|
|
|
|
|
|
SplitView.minimumWidth: 250
|
|
|
|
SplitView.preferredWidth: 280
|
|
|
|
|
|
|
|
logsView.logText: logs.logText
|
|
|
|
|
|
|
|
controls: ScrollView {
|
|
|
|
anchors.fill: parent
|
2024-09-06 15:55:44 +00:00
|
|
|
clip: true
|
|
|
|
|
|
|
|
ColumnLayout {
|
2024-11-07 10:45:47 +00:00
|
|
|
id: columnLayout
|
|
|
|
|
|
|
|
spacing: 8
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "Display name:"
|
2024-09-06 15:55:44 +00:00
|
|
|
}
|
2024-11-07 10:45:47 +00:00
|
|
|
|
|
|
|
TextField {
|
|
|
|
id: displayNameTextField
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
placeholderText: "Display name"
|
|
|
|
text: "Display name"
|
2024-09-06 15:55:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
ColumnLayout {
|
|
|
|
Label {
|
|
|
|
text: "Color id:"
|
2024-09-06 15:55:44 +00:00
|
|
|
}
|
2024-11-07 10:45:47 +00:00
|
|
|
|
|
|
|
SpinBox {
|
|
|
|
id: colorIdSpinBox
|
|
|
|
|
|
|
|
from: 0
|
|
|
|
to: 10
|
2024-09-06 15:55:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
ColumnLayout {
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "Profile type:"
|
2024-09-06 15:55:44 +00:00
|
|
|
}
|
2024-11-07 10:45:47 +00:00
|
|
|
|
|
|
|
ComboBox {
|
|
|
|
id: profileTypeSelector
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
textRole: "text"
|
|
|
|
valueRole: "value"
|
|
|
|
model: [
|
|
|
|
{ text: "Regular", value: Constants.profileType.regular },
|
|
|
|
{ text: "Self", value: Constants.profileType.self },
|
|
|
|
{ text: "Blocked", value: Constants.profileType.blocked },
|
|
|
|
{ text: "Bridged", value: Constants.profileType.bridged }
|
|
|
|
]
|
2024-09-06 15:55:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
ColumnLayout {
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "Trust status:"
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
ComboBox {
|
|
|
|
id: trustStatusSelector
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
Layout.fillWidth: true
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
textRole: "text"
|
|
|
|
valueRole: "value"
|
|
|
|
model: [
|
|
|
|
{ text: "Unknown", value: Constants.trustStatus.unknown },
|
|
|
|
{ text: "Trusted", value: Constants.trustStatus.trusted },
|
|
|
|
{ text: "Untrusted", value: Constants.trustStatus.untrustworthy }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
ColumnLayout {
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "Contact type:"
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
ComboBox {
|
|
|
|
id: contactTypeSelector
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
Layout.fillWidth: true
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
textRole: "text"
|
|
|
|
valueRole: "value"
|
|
|
|
model: [
|
|
|
|
{ text: "Non Contact", value: Constants.contactType.nonContact },
|
|
|
|
{ text: "Contact", value: Constants.contactType.contact },
|
|
|
|
{ text: "Contact Request Received", value: Constants.contactType.contactRequestReceived },
|
|
|
|
{ text: "Contact Request Sent", value: Constants.contactType.contactRequestSent }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
ColumnLayout {
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "Online status:"
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
ComboBox {
|
|
|
|
id: onlineStatusSelector
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
Layout.fillWidth: true
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
textRole: "text"
|
|
|
|
valueRole: "value"
|
|
|
|
model: [
|
|
|
|
{ text: "Online", value: Constants.onlineStatus.online },
|
|
|
|
{ text: "Unknown", value: Constants.onlineStatus.unknown },
|
|
|
|
{ text: "Inactive", value: Constants.onlineStatus.inactive }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
ColumnLayout {
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "Chat type:"
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
ComboBox {
|
|
|
|
id: chatTypeSelector
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
textRole: "text"
|
|
|
|
valueRole: "value"
|
|
|
|
model: [
|
|
|
|
{ text: "Unknown", value: Constants.chatType.unknown },
|
|
|
|
{ text: "Category", value: Constants.chatType.category },
|
|
|
|
{ text: "One-to-One", value: Constants.chatType.oneToOne },
|
|
|
|
{ text: "Public Chat", value: Constants.chatType.publicChat },
|
|
|
|
{ text: "Private Group Chat", value: Constants.chatType.privateGroupChat },
|
|
|
|
{ text: "Profile", value: Constants.chatType.profile },
|
|
|
|
{ text: "Community Chat", value: Constants.chatType.communityChat }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
MenuSeparator {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
ColumnLayout {
|
|
|
|
CheckBox {
|
|
|
|
id: useIconCheckBox
|
|
|
|
text: "Use icon"
|
|
|
|
checked: true
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
CheckBox {
|
|
|
|
id: ensVerifiedCheckBox
|
|
|
|
text: "ENS Verified"
|
|
|
|
checked: false
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
CheckBox {
|
|
|
|
id: hasLocalNicknameCheckBox
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
text: "Has Local Nickname"
|
|
|
|
checked: false
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
CheckBox {
|
|
|
|
id: isAdminCheckBox
|
|
|
|
text: "Is Admin"
|
|
|
|
checked: false
|
|
|
|
}
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
MenuSeparator {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
CheckBox {
|
|
|
|
id: hideDisabledCheckBox
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
text: "Hide disabled entries (debug)"
|
|
|
|
checked: true
|
|
|
|
}
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
}
|
|
|
|
}
|
2024-11-07 10:45:47 +00:00
|
|
|
|
|
|
|
Settings {
|
|
|
|
property alias profileTypeIndex: profileTypeSelector.currentIndex
|
|
|
|
property alias trustStatusIndex: trustStatusSelector.currentIndex
|
|
|
|
property alias contactTypeIndex: contactTypeSelector.currentIndex
|
|
|
|
property alias onlineStatusIndex: onlineStatusSelector.currentIndex
|
|
|
|
property alias chatTypeIndex: chatTypeSelector.currentIndex
|
|
|
|
|
|
|
|
property alias useIcon: useIconCheckBox.checked
|
|
|
|
property alias ensVerified: ensVerifiedCheckBox.checked
|
|
|
|
property alias hasLocalNickname: hasLocalNicknameCheckBox.checked
|
|
|
|
property alias isAdmin: isAdminCheckBox.checked
|
|
|
|
property alias hideDisabled: hideDisabledCheckBox.checked
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
}
|
|
|
|
|
2024-11-07 10:45:47 +00:00
|
|
|
// category: Views
|
|
|
|
// status: good
|
2024-11-04 21:47:59 +00:00
|
|
|
// https://www.figma.com/design/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=7898-265693&node-type=canvas&m=dev
|