2023-03-31 12:07:33 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
2023-06-23 06:17:04 +00:00
|
|
|
import AppLayouts.Communities.controls 1.0
|
2023-03-31 12:07:33 +00:00
|
|
|
|
|
|
|
import Models 1.0
|
|
|
|
import Storybook 1.0
|
|
|
|
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
|
|
|
|
Logs { id: logs }
|
|
|
|
|
|
|
|
Pane {
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
|
|
|
|
AddressesModel {
|
|
|
|
id: addresses
|
|
|
|
}
|
|
|
|
|
|
|
|
ListModel {
|
|
|
|
id: members
|
|
|
|
|
|
|
|
property int counter: 0
|
|
|
|
|
|
|
|
function addMember() {
|
|
|
|
const i = counter++
|
|
|
|
const key = `pub_key_${i}`
|
|
|
|
|
|
|
|
append({
|
|
|
|
alias: "",
|
|
|
|
colorId: "1",
|
|
|
|
displayName: `contact ${i}`,
|
|
|
|
ensName: "",
|
|
|
|
icon: "",
|
|
|
|
isContact: true,
|
|
|
|
localNickname: "",
|
|
|
|
onlineStatus: 1,
|
|
|
|
pubKey: key,
|
2024-10-29 12:54:11 +00:00
|
|
|
compressedPubKey: "compressed_" + key,
|
2023-03-31 12:07:33 +00:00
|
|
|
isVerified: true,
|
|
|
|
isUntrustworthy: false
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
for (let i = 0; i < 4; i++)
|
|
|
|
addMember()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-29 12:54:11 +00:00
|
|
|
AirdropRecipientsSelector {
|
|
|
|
id: selector
|
2023-03-31 12:07:33 +00:00
|
|
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
2024-10-29 12:54:11 +00:00
|
|
|
addressesModel: addresses
|
|
|
|
loadingAddresses: timer.running
|
|
|
|
membersModel: members
|
|
|
|
showAddressesInputWhenEmpty:
|
|
|
|
showAddressesInputWhenEmptyCheckBox.checked
|
2023-03-31 12:07:33 +00:00
|
|
|
|
2024-10-29 12:54:11 +00:00
|
|
|
infiniteMaxNumberOfRecipients:
|
|
|
|
infiniteMaxNumberOfRecipientsCheckBox.checked
|
2023-04-25 20:19:33 +00:00
|
|
|
|
2024-10-29 12:54:11 +00:00
|
|
|
maxNumberOfRecipients: maxNumberOfRecipientsSpinBox.value
|
2023-04-25 20:19:33 +00:00
|
|
|
|
2024-10-29 12:54:11 +00:00
|
|
|
onAddAddressesRequested: timer.start()
|
|
|
|
onRemoveAddressRequested: addresses.remove(index)
|
|
|
|
onRemoveMemberRequested: members.remove(index)
|
2023-03-31 12:07:33 +00:00
|
|
|
|
2024-10-29 12:54:11 +00:00
|
|
|
Timer {
|
|
|
|
id: timer
|
2023-03-31 12:07:33 +00:00
|
|
|
|
2024-10-29 12:54:11 +00:00
|
|
|
interval: 1000
|
2023-03-31 12:07:33 +00:00
|
|
|
|
2024-10-29 12:54:11 +00:00
|
|
|
onTriggered: {
|
|
|
|
addresses.addAddressesFromString(
|
|
|
|
selector.addressesInputText)
|
|
|
|
selector.clearAddressesInput()
|
|
|
|
selector.positionAddressesListAtEnd()
|
2023-03-31 12:07:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
SplitView.minimumHeight: 100
|
|
|
|
logsView.logText: logs.logText
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Button {
|
|
|
|
text: "Clear addresses list"
|
|
|
|
onClicked: addresses.clear()
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
text: "Clear members list"
|
|
|
|
onClicked: members.clear()
|
|
|
|
}
|
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: showAddressesInputWhenEmptyCheckBox
|
|
|
|
|
|
|
|
text: "Show addresses input when empty"
|
|
|
|
}
|
2023-04-25 20:19:33 +00:00
|
|
|
|
|
|
|
CheckBox {
|
2023-04-25 21:24:04 +00:00
|
|
|
id: infiniteMaxNumberOfRecipientsCheckBox
|
2023-04-25 20:19:33 +00:00
|
|
|
|
|
|
|
text: "Infinite number of expected recipients"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Label {
|
|
|
|
text: "Expected number of recipients:"
|
|
|
|
}
|
|
|
|
|
|
|
|
SpinBox {
|
2023-04-25 21:24:04 +00:00
|
|
|
id: maxNumberOfRecipientsSpinBox
|
2023-04-25 20:19:33 +00:00
|
|
|
|
|
|
|
value: 2
|
|
|
|
from: 1
|
|
|
|
to: 100
|
|
|
|
}
|
2023-03-31 12:07:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
text: "Add member"
|
|
|
|
onClicked: {
|
|
|
|
members.addMember()
|
|
|
|
loader.item.positionMembersListAtEnd()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MenuSeparator {}
|
|
|
|
|
|
|
|
TextEdit {
|
|
|
|
readOnly: true
|
|
|
|
selectByMouse: true
|
|
|
|
text: "valid address: 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc4"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-31 12:21:14 +00:00
|
|
|
|
|
|
|
// category: Components
|
2023-10-03 11:56:30 +00:00
|
|
|
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=22628-494998
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=22628-495258
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=22647-497754
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=28045-533663
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=28045-533912
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=22628-495493
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=22628-495928
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=22628-496145
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=22642-496092
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=22647-498080
|