2022-10-20 15:12:38 +00:00
|
|
|
|
import QtQuick 2.14
|
|
|
|
|
import QtQuick.Controls 2.14
|
2022-10-24 10:58:00 +00:00
|
|
|
|
import QtQuick.Layouts 1.14
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
import shared.views 1.0
|
2023-10-23 11:36:33 +00:00
|
|
|
|
import shared.stores 1.0
|
2023-02-07 14:21:32 +00:00
|
|
|
|
import mainui 1.0
|
|
|
|
|
|
|
|
|
|
import StatusQ 0.1
|
2024-02-27 17:11:03 +00:00
|
|
|
|
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
2024-02-07 14:56:45 +00:00
|
|
|
|
|
|
|
|
|
import AppLayouts.Wallet.stores 1.0
|
2023-02-28 15:00:10 +00:00
|
|
|
|
|
|
|
|
|
import Storybook 1.0
|
|
|
|
|
import Models 1.0
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
|
id: root
|
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
|
property bool globalUtilsReady: false
|
|
|
|
|
property bool mainModuleReady: false
|
|
|
|
|
|
|
|
|
|
// globalUtilsInst mock
|
2022-10-20 15:12:38 +00:00
|
|
|
|
QtObject {
|
2022-10-24 10:58:00 +00:00
|
|
|
|
function getEmojiHashAsJson(publicKey) {
|
|
|
|
|
return JSON.stringify(["👨🏻🍼", "🏃🏿♂️", "🌇", "🤶🏿", "🏮","🤷🏻♂️", "🤦🏻", "📣", "🤎", "👷🏽", "😺", "🥞", "🔃", "🧝🏽♂️"])
|
|
|
|
|
}
|
|
|
|
|
function getColorId(publicKey) { return colorId.value }
|
|
|
|
|
|
|
|
|
|
function getCompressedPk(publicKey) { return "zx3sh" + publicKey }
|
|
|
|
|
|
2024-02-13 14:10:07 +00:00
|
|
|
|
function getColorHashAsJson(publicKey, skipEnsVerification=false) {
|
2024-02-26 18:54:05 +00:00
|
|
|
|
if (skipEnsVerification)
|
|
|
|
|
return
|
2022-11-08 11:37:25 +00:00
|
|
|
|
return JSON.stringify([{colorId: 0, segmentLength: 1},
|
|
|
|
|
{colorId: 19, segmentLength: 2}])
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function isCompressedPubKey(publicKey) { return true }
|
2022-10-24 10:58:00 +00:00
|
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
|
function addTimestampToURL(url) {
|
|
|
|
|
return url
|
|
|
|
|
}
|
2024-02-12 17:05:15 +00:00
|
|
|
|
|
|
|
|
|
function copyImageToClipboardByUrl(data) {
|
|
|
|
|
logs.logEvent("Utils::copyImageToClipboardByUrl", ["data"], arguments)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function downloadImageByUrl(url, path) {
|
|
|
|
|
logs.logEvent("Utils::downloadImageByUrl", ["url", "path"], arguments)
|
|
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
|
|
2024-03-11 23:15:19 +00:00
|
|
|
|
function isAlias(name) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-20 15:12:38 +00:00
|
|
|
|
Component.onCompleted: {
|
2022-10-24 10:58:00 +00:00
|
|
|
|
Utils.globalUtilsInst = this
|
|
|
|
|
root.globalUtilsReady = true
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
Component.onDestruction: {
|
|
|
|
|
root.globalUtilsReady = false
|
|
|
|
|
Utils.globalUtilsInst = {}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
}
|
2022-10-24 10:58:00 +00:00
|
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
|
// mainModuleInst mock
|
|
|
|
|
QtObject {
|
2024-02-13 14:10:07 +00:00
|
|
|
|
function isEnsVerified(publicKey) {
|
|
|
|
|
return ensVerified.checked
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-09 15:52:28 +00:00
|
|
|
|
function getContactDetailsAsJson(publicKey, getVerificationRequest=true, getOnlineStatus=false, includeDetails=false) {
|
2024-02-07 14:56:45 +00:00
|
|
|
|
return JSON.stringify({ displayName: displayName.text,
|
|
|
|
|
optionalName: "",
|
2022-10-24 10:58:00 +00:00
|
|
|
|
displayIcon: "",
|
|
|
|
|
publicKey: publicKey,
|
|
|
|
|
name: name.text,
|
|
|
|
|
ensVerified: ensVerified.checked,
|
|
|
|
|
alias: "Mock Alias Triplet",
|
|
|
|
|
lastUpdated: Date.now(),
|
|
|
|
|
lastUpdatedLocally: Date.now(),
|
2023-02-28 15:00:10 +00:00
|
|
|
|
localNickname: localNickname.text,
|
2022-10-24 10:58:00 +00:00
|
|
|
|
thumbnailImage: "",
|
|
|
|
|
largeImage: userImage.checked ? Style.png("status-logo") : "",
|
2024-02-16 11:56:29 +00:00
|
|
|
|
isContact: ctrlIsContact.checked,
|
|
|
|
|
isBlocked: ctrlIsBlocked.checked,
|
2022-10-24 10:58:00 +00:00
|
|
|
|
isSyncing: false,
|
2024-02-16 11:56:29 +00:00
|
|
|
|
trustStatus: ctrlTrustStatus.currentValue,
|
2024-02-26 18:54:05 +00:00
|
|
|
|
verificationStatus: ctrlVerificationStatus.currentValue,
|
|
|
|
|
incomingVerificationStatus: ctrlIncomingVerificationStatus.currentValue,
|
2024-02-07 14:56:45 +00:00
|
|
|
|
contactRequestState: ctrlContactRequestState.currentValue,
|
2022-10-24 10:58:00 +00:00
|
|
|
|
bio: bio.text,
|
2024-02-09 15:52:28 +00:00
|
|
|
|
onlineStatus: ctrlOnlineStatus.currentValue
|
2022-10-24 10:58:00 +00:00
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
Utils.mainModuleInst = this
|
2022-11-08 08:36:08 +00:00
|
|
|
|
root.mainModuleReady = true
|
2022-10-24 10:58:00 +00:00
|
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
Component.onDestruction: {
|
2022-10-24 10:58:00 +00:00
|
|
|
|
root.mainModuleReady = false
|
|
|
|
|
Utils.mainModuleInst = {}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-26 18:54:05 +00:00
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
Global.userProfile = {
|
|
|
|
|
name: "Anna",
|
|
|
|
|
pubKey: "Oxdeadbeef",
|
|
|
|
|
icon: ModelsData.collectibles.cryptoPunks
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-15 09:25:40 +00:00
|
|
|
|
ListModel {
|
|
|
|
|
id: linksModel
|
|
|
|
|
ListElement {
|
|
|
|
|
text: "__github"
|
|
|
|
|
url: "https://github.com/caybro"
|
2024-02-27 17:11:03 +00:00
|
|
|
|
showcaseVisibility: Constants.ShowcaseVisibility.Everyone
|
2024-02-15 09:25:40 +00:00
|
|
|
|
}
|
|
|
|
|
ListElement {
|
|
|
|
|
text: "__twitter"
|
|
|
|
|
url: "https://twitter.com/caybro"
|
2024-02-27 17:11:03 +00:00
|
|
|
|
showcaseVisibility: Constants.ShowcaseVisibility.Everyone
|
2024-02-15 09:25:40 +00:00
|
|
|
|
}
|
|
|
|
|
ListElement {
|
|
|
|
|
text: "__personal_site"
|
|
|
|
|
url: "https://status.im"
|
2024-02-27 17:11:03 +00:00
|
|
|
|
showcaseVisibility: Constants.ShowcaseVisibility.Everyone
|
2024-02-15 09:25:40 +00:00
|
|
|
|
}
|
|
|
|
|
ListElement {
|
|
|
|
|
text: "__youtube"
|
|
|
|
|
url: "https://www.youtube.com/@LukasTinkl"
|
2024-02-27 17:11:03 +00:00
|
|
|
|
showcaseVisibility: Constants.ShowcaseVisibility.Everyone
|
2024-02-15 09:25:40 +00:00
|
|
|
|
}
|
|
|
|
|
ListElement {
|
|
|
|
|
text: "__telegram"
|
|
|
|
|
url: "https://t.me/ltinkl"
|
2024-02-27 17:11:03 +00:00
|
|
|
|
showcaseVisibility: Constants.ShowcaseVisibility.Everyone
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ManageCollectiblesModel {
|
|
|
|
|
id: manageCollectiblesModel
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
for (let i = 0; i < this.count; i++) {
|
|
|
|
|
setProperty(i, "showcaseVisibility", Constants.ShowcaseVisibility.Everyone)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WalletAccountsModel {
|
|
|
|
|
id: walletAccountsModel
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
for (let i = 0; i < this.count; i++) {
|
|
|
|
|
setProperty(i, "showcaseVisibility", Constants.ShowcaseVisibility.Everyone)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CommunitiesModel {
|
|
|
|
|
id: communitiesModel
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
for (let i = 0; i < this.count; i++) {
|
|
|
|
|
setProperty(i, "showcaseVisibility", Constants.ShowcaseVisibility.Everyone)
|
|
|
|
|
}
|
2024-02-15 09:25:40 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-20 15:12:38 +00:00
|
|
|
|
Logs { id: logs }
|
|
|
|
|
|
2023-02-07 14:21:32 +00:00
|
|
|
|
Popups {
|
|
|
|
|
popupParent: root
|
2023-07-25 13:35:47 +00:00
|
|
|
|
rootStore: QtObject {
|
|
|
|
|
property var contactStore: QtObject {
|
2024-02-26 18:54:05 +00:00
|
|
|
|
property var contactsModule: null
|
|
|
|
|
|
2024-02-14 12:52:54 +00:00
|
|
|
|
function changeContactNickname(publicKey, newNickname, displayName, isEdit) {
|
|
|
|
|
logs.logEvent("rootStore::contactsStore::changeContactNickname", ["publicKey", "newNickname", "displayName", "isEdit"], arguments)
|
|
|
|
|
localNickname.text = newNickname
|
2023-07-25 13:35:47 +00:00
|
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
|
|
|
|
|
|
function blockContact(publicKey) {
|
2024-02-16 11:56:29 +00:00
|
|
|
|
logs.logEvent("rootStore::contactStore::blockContact", ["publicKey"], arguments)
|
|
|
|
|
ctrlIsBlocked.checked = true
|
2024-02-07 14:56:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function unblockContact(publicKey) {
|
2024-02-16 11:56:29 +00:00
|
|
|
|
logs.logEvent("rootStore::contactStore::unblockContact", ["publicKey"], arguments)
|
|
|
|
|
ctrlIsBlocked.checked = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function sendContactRequest(publicKey, message) {
|
|
|
|
|
logs.logEvent("rootStore::contactStore::sendContactRequest", ["publicKey", "message"], arguments)
|
|
|
|
|
ctrlContactRequestState.currentIndex = ctrlContactRequestState.indexOfValue(Constants.ContactRequestState.Sent)
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-29 21:01:33 +00:00
|
|
|
|
function acceptContactRequest(publicKey, contactRequestId) {
|
|
|
|
|
logs.logEvent("rootStore::contactStore::acceptContactRequest", ["publicKey, contactRequestId"], arguments)
|
|
|
|
|
ctrlContactRequestState.currentIndex = ctrlContactRequestState.indexOfValue(Constants.ContactRequestState.Mutual)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getLatestContactRequestForContactAsJson(pubKey) {
|
|
|
|
|
logs.logEvent("rootStore::contactStore::getLatestContactRequestForContactAsJson", ["pubKey"], arguments)
|
|
|
|
|
return {
|
|
|
|
|
id: "123456789",
|
|
|
|
|
from: pubKey,
|
|
|
|
|
clock: Date.now(),
|
|
|
|
|
text: "Hey Jo, it’s Alex here, we met at devcon last week!",
|
|
|
|
|
contactRequestState: Constants.ContactRequestState.Received
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-16 11:56:29 +00:00
|
|
|
|
function sendVerificationRequest(publicKey, challenge) {
|
|
|
|
|
logs.logEvent("rootStore::contactStore::sendVerificationRequest", ["publicKey", "challenge"], arguments)
|
2024-02-26 18:54:05 +00:00
|
|
|
|
ctrlVerificationStatus.currentIndex = ctrlVerificationStatus.indexOfValue(Constants.verificationStatus.verifying)
|
2024-02-07 14:56:45 +00:00
|
|
|
|
}
|
2024-02-16 17:34:09 +00:00
|
|
|
|
|
|
|
|
|
function markUntrustworthy(publicKey) {
|
|
|
|
|
logs.logEvent("rootStore::contactStore::markUntrustworthy", ["publicKey"], arguments)
|
|
|
|
|
ctrlTrustStatus.currentIndex = ctrlTrustStatus.indexOfValue(Constants.trustStatus.untrustworthy)
|
2024-02-26 18:54:05 +00:00
|
|
|
|
ctrlVerificationStatus.currentIndex = ctrlVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
ctrlIncomingVerificationStatus.currentIndex = ctrlIncomingVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function markAsTrusted(publicKey) {
|
|
|
|
|
logs.logEvent("rootStore::contactStore::markAsTrusted", ["publicKey"], arguments)
|
|
|
|
|
ctrlTrustStatus.currentIndex = ctrlTrustStatus.indexOfValue(Constants.trustStatus.trusted)
|
|
|
|
|
ctrlVerificationStatus.currentIndex = ctrlVerificationStatus.indexOfValue(Constants.verificationStatus.trusted)
|
|
|
|
|
ctrlIncomingVerificationStatus.currentIndex = ctrlIncomingVerificationStatus.indexOfValue(Constants.verificationStatus.trusted)
|
2024-02-16 17:34:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function removeContact(publicKey) {
|
|
|
|
|
logs.logEvent("rootStore::contactStore::removeContact", ["publicKey"], arguments)
|
|
|
|
|
ctrlContactRequestState.currentIndex = ctrlContactRequestState.indexOfValue(Constants.ContactRequestState.None)
|
2024-02-26 18:54:05 +00:00
|
|
|
|
ctrlIsContact.checked = false
|
2024-02-16 17:34:09 +00:00
|
|
|
|
}
|
2024-02-26 09:39:08 +00:00
|
|
|
|
|
|
|
|
|
function verifiedTrusted(publicKey) {
|
|
|
|
|
logs.logEvent("rootStore::contactStore::verifiedTrusted", ["publicKey"], arguments)
|
|
|
|
|
ctrlTrustStatus.currentIndex = ctrlTrustStatus.indexOfValue(Constants.trustStatus.trusted)
|
2024-02-26 18:54:05 +00:00
|
|
|
|
ctrlVerificationStatus.currentIndex = ctrlVerificationStatus.indexOfValue(Constants.verificationStatus.trusted)
|
|
|
|
|
ctrlIncomingVerificationStatus.currentIndex = ctrlIncomingVerificationStatus.indexOfValue(Constants.verificationStatus.trusted)
|
2024-02-26 09:39:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function removeTrustStatus(publicKey) {
|
|
|
|
|
logs.logEvent("rootStore::contactStore::removeTrustStatus", ["publicKey"], arguments)
|
|
|
|
|
ctrlTrustStatus.currentIndex = ctrlTrustStatus.indexOfValue(Constants.trustStatus.unknown)
|
2024-02-26 18:54:05 +00:00
|
|
|
|
ctrlVerificationStatus.currentIndex = ctrlVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
ctrlIncomingVerificationStatus.currentIndex = ctrlIncomingVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-18 16:09:27 +00:00
|
|
|
|
function removeTrustVerificationStatus(publicKey) {
|
|
|
|
|
logs.logEvent("rootStore::contactStore::removeTrustVerificationStatus", ["publicKey"], arguments)
|
|
|
|
|
ctrlTrustStatus.currentIndex = ctrlTrustStatus.indexOfValue(Constants.trustStatus.unknown)
|
|
|
|
|
ctrlVerificationStatus.currentIndex = ctrlVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
ctrlIncomingVerificationStatus.currentIndex = ctrlIncomingVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-26 18:54:05 +00:00
|
|
|
|
function cancelVerificationRequest(pubKey) {
|
|
|
|
|
logs.logEvent("rootStore::contactStore::cancelVerificationRequest", ["pubKey"], arguments)
|
|
|
|
|
ctrlVerificationStatus.currentIndex = ctrlVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
ctrlIncomingVerificationStatus.currentIndex = ctrlIncomingVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function declineVerificationRequest(pubKey) {
|
|
|
|
|
logs.logEvent("rootStore::contactStore::declineVerificationRequest", ["pubKey"], arguments)
|
|
|
|
|
ctrlVerificationStatus.currentIndex = ctrlVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
ctrlIncomingVerificationStatus.currentIndex = ctrlIncomingVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function acceptVerificationRequest(pubKey, response) {
|
|
|
|
|
logs.logEvent("rootStore::contactStore::acceptVerificationRequest", ["pubKey"], arguments)
|
|
|
|
|
ctrlVerificationStatus.currentIndex = ctrlVerificationStatus.indexOfValue(Constants.verificationStatus.verifying)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function verifiedUntrustworthy(pubKey) {
|
|
|
|
|
logs.logEvent("rootStore::contactStore::verifiedUntrustworthy", ["pubKey"], arguments)
|
|
|
|
|
ctrlVerificationStatus.currentIndex = ctrlVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
ctrlIncomingVerificationStatus.currentIndex = ctrlIncomingVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
ctrlTrustStatus.currentIndex = ctrlTrustStatus.indexOfValue(Constants.trustStatus.untrustworthy)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getSentVerificationDetailsAsJson(pubKey) {
|
|
|
|
|
return {
|
|
|
|
|
requestStatus: ctrlVerificationStatus.currentValue,
|
|
|
|
|
challenge: "The real Alex would know this 100%! What’s my favourite colour?",
|
|
|
|
|
response: ctrlIncomingVerificationStatus.currentValue === Constants.verificationStatus.verified ? "Yellow!" : "",
|
|
|
|
|
displayName: ProfileUtils.displayName(localNickname.text, name.text, displayName.text),
|
|
|
|
|
icon: Style.png("status-logo"),
|
|
|
|
|
requestedAt: Date.now() - 86400000,
|
|
|
|
|
repliedAt: Date.now()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getVerificationDetailsFromAsJson(pubKey) {
|
|
|
|
|
return {
|
|
|
|
|
from: "0xdeadbeef",
|
|
|
|
|
challenge: "The real Alex would know this 100%! What’s my favourite colour?",
|
|
|
|
|
response: "",
|
|
|
|
|
requestedAt: Date.now() - 86400000,
|
|
|
|
|
}
|
2024-02-26 09:39:08 +00:00
|
|
|
|
}
|
2023-07-25 13:35:47 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-10-23 11:36:33 +00:00
|
|
|
|
communityTokensStore: CommunityTokensStore {}
|
2023-02-07 14:21:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
|
WalletAssetsStore {
|
|
|
|
|
id: assetsStore
|
|
|
|
|
assetsWithFilteredBalances: groupedAccountsAssetsModel
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-20 15:12:38 +00:00
|
|
|
|
SplitView {
|
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
|
|
|
|
|
|
ScrollView {
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: parent.height
|
|
|
|
|
clip: true
|
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
|
Loader {
|
|
|
|
|
active: root.globalUtilsReady && root.mainModuleReady
|
|
|
|
|
width: parent.availableWidth
|
|
|
|
|
height: parent.availableHeight
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
|
sourceComponent: ProfileDialogView {
|
|
|
|
|
implicitWidth: 640
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
|
readOnly: ctrlReadOnly.checked
|
2024-05-29 08:33:36 +00:00
|
|
|
|
idVerificationFlowsEnabled: true // enabled in SB
|
2022-10-24 10:58:00 +00:00
|
|
|
|
publicKey: switchOwnProfile.checked ? "0xdeadbeef" : "0xrandomguy"
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
2023-02-28 15:00:10 +00:00
|
|
|
|
onCloseRequested: logs.logEvent("closeRequested()")
|
|
|
|
|
|
2024-03-29 11:43:49 +00:00
|
|
|
|
sendToAccountEnabled: true
|
|
|
|
|
|
2024-02-27 17:11:03 +00:00
|
|
|
|
showcaseCommunitiesModel: communitiesModel
|
|
|
|
|
showcaseAccountsModel: walletAccountsModel
|
|
|
|
|
showcaseCollectiblesModel: manageCollectiblesModel
|
2024-02-15 09:25:40 +00:00
|
|
|
|
showcaseSocialLinksModel: linksModel
|
2024-03-29 11:43:49 +00:00
|
|
|
|
// TODO: showcaseAssetsModel
|
|
|
|
|
|
2024-02-15 09:25:40 +00:00
|
|
|
|
assetsModel: AssetsModel {}
|
|
|
|
|
collectiblesModel: CollectiblesModel {}
|
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
|
profileStore: QtObject {
|
|
|
|
|
readonly property string pubkey: "0xdeadbeef"
|
|
|
|
|
readonly property string ensName: name.text
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
|
function getQrCodeSource() {
|
2024-02-07 14:56:45 +00:00
|
|
|
|
return "https://upload.wikimedia.org/wikipedia/commons/4/41/QR_Code_Example.svg"
|
2022-10-24 10:58:00 +00:00
|
|
|
|
}
|
|
|
|
|
function copyToClipboard(text) {
|
|
|
|
|
logs.logEvent("profileStore::copyToClipboard", ["text"], arguments)
|
|
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
|
contactsStore: QtObject {
|
|
|
|
|
readonly property string myPublicKey: "0xdeadbeef"
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
|
function joinPrivateChat(publicKey) {
|
|
|
|
|
logs.logEvent("contactsStore::joinPrivateChat", ["publicKey"], arguments)
|
|
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
|
function markUntrustworthy(publicKey) {
|
|
|
|
|
logs.logEvent("contactsStore::markUntrustworthy", ["publicKey"], arguments)
|
2024-02-16 11:56:29 +00:00
|
|
|
|
ctrlTrustStatus.currentIndex = ctrlTrustStatus.indexOfValue(Constants.trustStatus.untrustworthy)
|
2022-10-24 10:58:00 +00:00
|
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
|
function removeContact(publicKey) {
|
|
|
|
|
logs.logEvent("contactsStore::removeContact", ["publicKey"], arguments)
|
2024-02-20 17:19:36 +00:00
|
|
|
|
ctrlContactRequestState.currentIndex = ctrlContactRequestState.indexOfValue(Constants.ContactRequestState.None)
|
2024-02-26 18:54:05 +00:00
|
|
|
|
ctrlIsContact.checked = false
|
2022-10-24 10:58:00 +00:00
|
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
2023-04-03 16:27:56 +00:00
|
|
|
|
function acceptContactRequest(publicKey, contactRequestId) {
|
|
|
|
|
logs.logEvent("contactsStore::acceptContactRequest", ["publicKey, contactRequestId"], arguments)
|
2024-02-20 17:19:36 +00:00
|
|
|
|
ctrlContactRequestState.currentIndex = ctrlContactRequestState.indexOfValue(Constants.ContactRequestState.Mutual)
|
2022-10-24 10:58:00 +00:00
|
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
2023-04-03 16:27:56 +00:00
|
|
|
|
function dismissContactRequest(publicKey, contactRequestId) {
|
|
|
|
|
logs.logEvent("contactsStore::dismissContactRequest", ["publicKey, contactRequestId"], arguments)
|
2024-02-20 17:19:36 +00:00
|
|
|
|
ctrlContactRequestState.currentIndex = ctrlContactRequestState.indexOfValue(Constants.ContactRequestState.Dismissed)
|
2022-10-24 10:58:00 +00:00
|
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
|
function removeTrustStatus(publicKey) {
|
|
|
|
|
logs.logEvent("contactsStore::removeTrustStatus", ["publicKey"], arguments)
|
2024-02-16 17:34:09 +00:00
|
|
|
|
ctrlTrustStatus.currentIndex = ctrlTrustStatus.indexOfValue(Constants.trustStatus.unknown)
|
2022-10-24 10:58:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-04-18 16:09:27 +00:00
|
|
|
|
function removeTrustVerificationStatus(publicKey) {
|
|
|
|
|
logs.logEvent("contactsStore::removeTrustVerificationStatus", ["publicKey"], arguments)
|
|
|
|
|
ctrlTrustStatus.currentIndex = ctrlTrustStatus.indexOfValue(Constants.trustStatus.unknown)
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
|
function verifiedUntrustworthy(publicKey) {
|
|
|
|
|
logs.logEvent("contactsStore::verifiedUntrustworthy", ["publicKey"], arguments)
|
|
|
|
|
}
|
2023-07-25 13:35:47 +00:00
|
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
|
function verifiedTrusted(publicKey) {
|
|
|
|
|
logs.logEvent("contactsStore::verifiedTrusted", ["publicKey"], arguments)
|
2024-02-26 09:39:08 +00:00
|
|
|
|
ctrlTrustStatus.currentIndex = ctrlTrustStatus.indexOfValue(Constants.trustStatus.trusted)
|
2023-07-25 13:35:47 +00:00
|
|
|
|
}
|
2023-02-28 15:00:10 +00:00
|
|
|
|
|
2024-02-26 18:54:05 +00:00
|
|
|
|
function cancelVerificationRequest(pubKey) {
|
|
|
|
|
logs.logEvent("contactsStore::cancelVerificationRequest", ["pubKey"], arguments)
|
|
|
|
|
ctrlVerificationStatus.currentIndex = ctrlVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
ctrlIncomingVerificationStatus.currentIndex = ctrlIncomingVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
|
function getLinkToProfile(publicKey) {
|
|
|
|
|
return Constants.userLinkPrefix + publicKey
|
2023-02-28 15:00:10 +00:00
|
|
|
|
}
|
2024-02-14 12:52:54 +00:00
|
|
|
|
|
|
|
|
|
function changeContactNickname(publicKey, newNickname, displayName, isEdit) {
|
|
|
|
|
logs.logEvent("contactsStore::changeContactNickname", ["publicKey", "newNickname", "displayName", "isEdit"], arguments)
|
|
|
|
|
localNickname.text = newNickname
|
|
|
|
|
}
|
2023-02-28 15:00:10 +00:00
|
|
|
|
|
2024-03-29 11:43:49 +00:00
|
|
|
|
function requestProfileShowcase(publicKey) {
|
|
|
|
|
logs.logEvent("contactsStore::requestProfileShowcase", ["publicKey"], arguments)
|
2023-02-28 15:00:10 +00:00
|
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
|
SplitView.minimumHeight: 100
|
2022-10-24 10:58:00 +00:00
|
|
|
|
SplitView.preferredHeight: 350
|
2022-10-20 15:12:38 +00:00
|
|
|
|
|
|
|
|
|
logsView.logText: logs.logText
|
|
|
|
|
|
2022-10-24 10:58:00 +00:00
|
|
|
|
ColumnLayout {
|
|
|
|
|
width: parent.width
|
|
|
|
|
RowLayout {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Switch {
|
|
|
|
|
id: switchOwnProfile
|
|
|
|
|
text: "Own profile"
|
|
|
|
|
checked: false
|
|
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
|
Switch {
|
|
|
|
|
id: ctrlReadOnly
|
|
|
|
|
text: "Readonly (preview)"
|
|
|
|
|
visible: switchOwnProfile.checked
|
|
|
|
|
checked: false
|
|
|
|
|
}
|
2022-10-24 10:58:00 +00:00
|
|
|
|
}
|
|
|
|
|
RowLayout {
|
|
|
|
|
Layout.fillWidth: true
|
2023-02-28 15:00:10 +00:00
|
|
|
|
Label { text: "localNickname:" }
|
|
|
|
|
TextField {
|
|
|
|
|
id: localNickname
|
2024-02-26 18:54:05 +00:00
|
|
|
|
text: "Alex"
|
2023-02-28 15:00:10 +00:00
|
|
|
|
placeholderText: "Local Nickname"
|
|
|
|
|
}
|
2022-10-24 10:58:00 +00:00
|
|
|
|
Label { text: "displayName:" }
|
|
|
|
|
TextField {
|
|
|
|
|
id: displayName
|
2024-02-14 12:52:54 +00:00
|
|
|
|
text: "Alex Pella"
|
2022-10-24 10:58:00 +00:00
|
|
|
|
placeholderText: "Display Name"
|
|
|
|
|
}
|
2024-02-26 18:54:05 +00:00
|
|
|
|
CheckBox {
|
|
|
|
|
id: ensVerified
|
|
|
|
|
checked: true
|
|
|
|
|
text: "ensVerified"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Label { text: "name:" }
|
|
|
|
|
TextField {
|
|
|
|
|
id: name
|
|
|
|
|
enabled: ensVerified.checked
|
2024-05-13 08:05:53 +00:00
|
|
|
|
text: ensVerified.checked ? "8⃣6⃣.eth" : ""
|
2024-02-26 18:54:05 +00:00
|
|
|
|
placeholderText: "ENS name"
|
|
|
|
|
}
|
2022-10-24 10:58:00 +00:00
|
|
|
|
}
|
|
|
|
|
RowLayout {
|
|
|
|
|
CheckBox {
|
|
|
|
|
id: userImage
|
|
|
|
|
text: "User image"
|
|
|
|
|
checked: true
|
|
|
|
|
}
|
|
|
|
|
Label {
|
|
|
|
|
font.italic: true
|
|
|
|
|
text: "or"
|
|
|
|
|
}
|
|
|
|
|
Label {
|
|
|
|
|
enabled: !userImage.checked
|
|
|
|
|
text: "colorId"
|
|
|
|
|
}
|
|
|
|
|
SpinBox {
|
|
|
|
|
id: colorId
|
|
|
|
|
enabled: !userImage.checked
|
|
|
|
|
from: 0
|
|
|
|
|
to: 11 // Theme.palette.userCustomizationColors.length
|
|
|
|
|
}
|
2024-02-26 18:54:05 +00:00
|
|
|
|
Label { text: "onlineStatus" }
|
|
|
|
|
ComboBox {
|
|
|
|
|
id: ctrlOnlineStatus
|
|
|
|
|
textRole: "text"
|
|
|
|
|
valueRole: "value"
|
|
|
|
|
model: [
|
|
|
|
|
{ value: Constants.onlineStatus.unknown, text: "unknown" },
|
|
|
|
|
{ value: Constants.onlineStatus.inactive, text: "inactive" },
|
|
|
|
|
{ value: Constants.onlineStatus.online, text: "online" }
|
|
|
|
|
]
|
2022-10-24 10:58:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
RowLayout {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
enabled: !switchOwnProfile.checked
|
|
|
|
|
CheckBox {
|
2024-02-16 11:56:29 +00:00
|
|
|
|
id: ctrlIsContact
|
2024-02-07 14:56:45 +00:00
|
|
|
|
enabled: true
|
|
|
|
|
checked: ctrlContactRequestState.currentValue === Constants.ContactRequestState.Mutual
|
2022-10-24 10:58:00 +00:00
|
|
|
|
text: "isContact"
|
|
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
|
ComboBox {
|
|
|
|
|
id: ctrlContactRequestState
|
|
|
|
|
textRole: "text"
|
|
|
|
|
valueRole: "value"
|
|
|
|
|
model: [
|
|
|
|
|
{ value: Constants.ContactRequestState.None, text: "None" },
|
|
|
|
|
{ value: Constants.ContactRequestState.Mutual, text: "Mutual" },
|
|
|
|
|
{ value: Constants.ContactRequestState.Sent, text: "Sent" },
|
|
|
|
|
{ value: Constants.ContactRequestState.Received, text: "Received" },
|
|
|
|
|
{ value: Constants.ContactRequestState.Dismissed, text: "Dismissed" }
|
|
|
|
|
]
|
2022-10-24 10:58:00 +00:00
|
|
|
|
}
|
2024-02-26 18:54:05 +00:00
|
|
|
|
Label { text: "trustStatus:" }
|
|
|
|
|
ComboBox {
|
|
|
|
|
id: ctrlTrustStatus
|
|
|
|
|
textRole: "text"
|
|
|
|
|
valueRole: "value"
|
|
|
|
|
model: [
|
|
|
|
|
{ value: Constants.trustStatus.unknown, text: "unknown" },
|
|
|
|
|
{ value: Constants.trustStatus.trusted, text: "trusted" },
|
|
|
|
|
{ value: Constants.trustStatus.untrustworthy, text: "untrustworthy" }
|
|
|
|
|
]
|
|
|
|
|
}
|
2022-10-24 10:58:00 +00:00
|
|
|
|
CheckBox {
|
2024-02-16 11:56:29 +00:00
|
|
|
|
id: ctrlIsBlocked
|
2022-10-24 10:58:00 +00:00
|
|
|
|
text: "isBlocked"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
RowLayout {
|
|
|
|
|
Layout.fillWidth: true
|
2024-02-26 18:54:05 +00:00
|
|
|
|
|
|
|
|
|
Label { text: "incomingVerificationStatus:" }
|
2022-10-24 10:58:00 +00:00
|
|
|
|
ComboBox {
|
2024-02-26 18:54:05 +00:00
|
|
|
|
id: ctrlIncomingVerificationStatus
|
|
|
|
|
enabled: ctrlIsContact.checked && !switchOwnProfile.checked
|
2022-10-24 10:58:00 +00:00
|
|
|
|
textRole: "text"
|
|
|
|
|
valueRole: "value"
|
|
|
|
|
model: [
|
2024-02-26 18:54:05 +00:00
|
|
|
|
{ value: Constants.verificationStatus.unverified, text: "unverified" },
|
|
|
|
|
{ value: Constants.verificationStatus.verifying, text: "verifying" },
|
|
|
|
|
{ value: Constants.verificationStatus.verified, text: "verified" },
|
|
|
|
|
{ value: Constants.verificationStatus.declined, text: "declined" },
|
|
|
|
|
{ value: Constants.verificationStatus.canceled, text: "canceled" },
|
|
|
|
|
{ value: Constants.verificationStatus.trusted, text: "trusted" },
|
|
|
|
|
{ value: Constants.verificationStatus.untrustworthy, text: "untrustworthy" }
|
2022-10-24 10:58:00 +00:00
|
|
|
|
]
|
|
|
|
|
}
|
2024-02-26 18:54:05 +00:00
|
|
|
|
Label { text: "verificationStatus:" }
|
2024-02-09 15:52:28 +00:00
|
|
|
|
ComboBox {
|
2024-02-26 18:54:05 +00:00
|
|
|
|
id: ctrlVerificationStatus
|
|
|
|
|
enabled: ctrlIsContact.checked && !switchOwnProfile.checked
|
2024-02-09 15:52:28 +00:00
|
|
|
|
textRole: "text"
|
|
|
|
|
valueRole: "value"
|
|
|
|
|
model: [
|
2024-02-26 18:54:05 +00:00
|
|
|
|
{ value: Constants.verificationStatus.unverified, text: "unverified" },
|
|
|
|
|
{ value: Constants.verificationStatus.verifying, text: "verifying" },
|
|
|
|
|
{ value: Constants.verificationStatus.verified, text: "verified" },
|
|
|
|
|
{ value: Constants.verificationStatus.declined, text: "declined" },
|
|
|
|
|
{ value: Constants.verificationStatus.canceled, text: "canceled" },
|
|
|
|
|
{ value: Constants.verificationStatus.trusted, text: "trusted" },
|
|
|
|
|
{ value: Constants.verificationStatus.untrustworthy, text: "untrustworthy" }
|
2024-02-09 15:52:28 +00:00
|
|
|
|
]
|
|
|
|
|
}
|
2024-02-26 18:54:05 +00:00
|
|
|
|
Button {
|
|
|
|
|
text: "Send ID request"
|
|
|
|
|
onClicked: {
|
|
|
|
|
ctrlIsContact.checked = true
|
|
|
|
|
ctrlIncomingVerificationStatus.currentIndex = ctrlIncomingVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
ctrlVerificationStatus.currentIndex = ctrlVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Button {
|
|
|
|
|
text: "Reply to ID request"
|
|
|
|
|
onClicked: {
|
|
|
|
|
ctrlIsContact.checked = true
|
|
|
|
|
ctrlIncomingVerificationStatus.currentIndex = ctrlIncomingVerificationStatus.indexOfValue(Constants.verificationStatus.verifying)
|
|
|
|
|
ctrlVerificationStatus.currentIndex = ctrlVerificationStatus.indexOfValue(Constants.verificationStatus.unverified)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Button {
|
|
|
|
|
text: "Pending ID request"
|
|
|
|
|
onClicked: {
|
|
|
|
|
ctrlIsContact.checked = true
|
|
|
|
|
ctrlIncomingVerificationStatus.currentIndex = ctrlIncomingVerificationStatus.indexOfValue(Constants.verificationStatus.verifying)
|
|
|
|
|
ctrlVerificationStatus.currentIndex = ctrlVerificationStatus.indexOfValue(Constants.verificationStatus.verifying)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Button {
|
|
|
|
|
text: "Review ID reply"
|
|
|
|
|
onClicked: {
|
|
|
|
|
ctrlIsContact.checked = true
|
|
|
|
|
ctrlIncomingVerificationStatus.currentIndex = ctrlIncomingVerificationStatus.indexOfValue(Constants.verificationStatus.verified)
|
|
|
|
|
ctrlVerificationStatus.currentIndex = ctrlVerificationStatus.indexOfValue(Constants.verificationStatus.verifying)
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-10-24 10:58:00 +00:00
|
|
|
|
}
|
|
|
|
|
RowLayout {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Label { text: "Bio:" }
|
|
|
|
|
TextField {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
id: bio
|
2023-02-28 15:00:10 +00:00
|
|
|
|
selectByMouse: true
|
2024-04-18 22:02:13 +00:00
|
|
|
|
text: "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Hi, I am Alex. I'm an indie developer who mainly works on web products.
|
|
|
|
|
|
|
|
|
|
|
2023-02-07 14:21:32 +00:00
|
|
|
|
|
|
|
|
|
I worked for several different companies and created a couple of my own products from scratch. Currently building Telescope and Prepacked.
|
|
|
|
|
|
2024-04-18 22:02:13 +00:00
|
|
|
|
Say hi, or find me on Twitter, GitHub, or Mastodon.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"
|
2022-10-24 10:58:00 +00:00
|
|
|
|
}
|
2022-10-20 15:12:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-07-31 12:21:14 +00:00
|
|
|
|
|
|
|
|
|
// category: Views
|
2023-10-03 11:56:30 +00:00
|
|
|
|
|
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=733%3A12552
|
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=682%3A15078
|
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=682%3A17655
|
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=682%3A17087
|
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=4%3A23525
|
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=4%3A23932
|
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=4%3A23932&t=h8DUW6Eysawqe5u0-0
|
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=724%3A15511&t=h8DUW6Eysawqe5u0-0
|
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=6%3A16845&t=h8DUW6Eysawqe5u0-0
|
|
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?node-id=4%3A25437&t=h8DUW6Eysawqe5u0-0
|