2023-05-04 10:29:01 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
2023-03-15 17:14:31 +00:00
|
|
|
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2023-06-23 06:17:04 +00:00
|
|
|
import AppLayouts.Communities.panels 1.0
|
|
|
|
import AppLayouts.Communities.controls 1.0
|
2023-05-04 10:29:01 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
2023-03-15 17:14:31 +00:00
|
|
|
import Storybook 1.0
|
|
|
|
import Models 1.0
|
|
|
|
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
|
2023-05-04 10:29:01 +00:00
|
|
|
property bool globalUtilsReady: false
|
|
|
|
property bool mainModuleReady: false
|
|
|
|
|
2023-03-15 17:14:31 +00:00
|
|
|
Logs { id: logs }
|
|
|
|
|
2023-05-04 10:29:01 +00:00
|
|
|
QtObject {
|
|
|
|
function isCompressedPubKey(publicKey) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
function getCompressedPk(publicKey) {
|
|
|
|
return "compressed_" + publicKey
|
|
|
|
}
|
|
|
|
|
|
|
|
function getColorId(publicKey) {
|
|
|
|
return Math.floor(Math.random() * 10)
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
Utils.globalUtilsInst = this
|
|
|
|
globalUtilsReady = true
|
|
|
|
|
|
|
|
}
|
|
|
|
Component.onDestruction: {
|
|
|
|
globalUtilsReady = false
|
|
|
|
Utils.globalUtilsInst = {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
function getContactDetailsAsJson() {
|
|
|
|
return JSON.stringify({ ensVerified: true })
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
mainModuleReady = true
|
|
|
|
Utils.mainModuleInst = this
|
|
|
|
}
|
|
|
|
Component.onDestruction: {
|
|
|
|
mainModuleReady = false
|
|
|
|
Utils.mainModuleInst = {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-06 12:33:27 +00:00
|
|
|
MintedTokensModel {
|
|
|
|
id: mintedTokensModel
|
|
|
|
}
|
|
|
|
|
|
|
|
ListModel {
|
|
|
|
id: emptyModel
|
|
|
|
}
|
|
|
|
|
2023-06-30 09:00:04 +00:00
|
|
|
Button {
|
|
|
|
text: "Back"
|
|
|
|
onClicked: loader.item.navigateBack()
|
|
|
|
}
|
|
|
|
|
2023-03-15 17:14:31 +00:00
|
|
|
Rectangle {
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
color: Theme.palette.statusAppLayout.rightPanelBackgroundColor
|
|
|
|
|
2023-05-04 10:29:01 +00:00
|
|
|
Loader {
|
2023-06-30 09:00:04 +00:00
|
|
|
id: loader
|
|
|
|
|
2023-03-15 17:14:31 +00:00
|
|
|
anchors.fill: parent
|
2023-05-04 10:29:01 +00:00
|
|
|
active: globalUtilsReady && mainModuleReady
|
|
|
|
|
2023-06-26 11:48:45 +00:00
|
|
|
sourceComponent: AirdropsSettingsPanel {
|
|
|
|
id: airdropsSettingsPanel
|
2023-06-30 09:00:04 +00:00
|
|
|
|
2023-05-04 10:29:01 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
anchors.topMargin: 50
|
2023-07-18 17:34:57 +00:00
|
|
|
|
|
|
|
// User profile
|
2023-07-06 12:33:27 +00:00
|
|
|
isOwner: ownerChecked.checked
|
2023-07-13 15:51:53 +00:00
|
|
|
isTokenMasterOwner: masterTokenOwnerChecked.checked
|
|
|
|
isAdmin: adminChecked.checked
|
2023-07-18 17:34:57 +00:00
|
|
|
|
|
|
|
// Owner and TMaster related props:
|
|
|
|
isOwnerTokenDeployed: deployCheck.checked
|
|
|
|
isTMasterTokenDeployed: deployCheck.checked
|
|
|
|
|
|
|
|
// Models
|
2023-05-04 10:29:01 +00:00
|
|
|
assetsModel: AssetsModel {}
|
|
|
|
collectiblesModel: ListModel {}
|
|
|
|
|
|
|
|
CollectiblesModel {
|
|
|
|
id: collectiblesModel
|
|
|
|
}
|
|
|
|
|
|
|
|
SortFilterProxyModel {
|
|
|
|
id: collectiblesModelWithSupply
|
|
|
|
|
|
|
|
sourceModel: collectiblesModel
|
|
|
|
|
|
|
|
proxyRoles: [
|
|
|
|
ExpressionRole {
|
|
|
|
name: "supply"
|
|
|
|
expression: ((model.index + 1) * 115).toString()
|
|
|
|
},
|
2023-08-10 12:23:59 +00:00
|
|
|
ExpressionRole {
|
|
|
|
name: "multiplierIndex"
|
|
|
|
expression: 0
|
|
|
|
},
|
2023-05-04 10:29:01 +00:00
|
|
|
ExpressionRole {
|
|
|
|
name: "infiniteSupply"
|
|
|
|
expression: !(model.index % 4)
|
|
|
|
},
|
|
|
|
ExpressionRole {
|
|
|
|
name: "chainName"
|
|
|
|
expression: model.index ? "Optimism" : "Arbitrum"
|
|
|
|
},
|
|
|
|
ExpressionRole {
|
|
|
|
|
|
|
|
readonly property string icon1: "network/Network=Optimism"
|
|
|
|
readonly property string icon2: "network/Network=Arbitrum"
|
|
|
|
|
|
|
|
name: "chainIcon"
|
|
|
|
expression: model.index ? icon1 : icon2
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
filters: ValueFilter {
|
|
|
|
roleName: "category"
|
|
|
|
value: TokenCategories.Category.Community
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
2023-06-26 11:48:45 +00:00
|
|
|
Qt.callLater(() => airdropsSettingsPanel.collectiblesModel = this)
|
2023-05-04 10:29:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-14 07:19:45 +00:00
|
|
|
AssetsModel {
|
|
|
|
id: assetsModel
|
|
|
|
}
|
|
|
|
|
|
|
|
SortFilterProxyModel {
|
|
|
|
id: assetsModelWithSupply
|
|
|
|
|
|
|
|
sourceModel: assetsModel
|
|
|
|
|
|
|
|
proxyRoles: [
|
|
|
|
ExpressionRole {
|
|
|
|
name: "supply"
|
2023-08-10 12:23:59 +00:00
|
|
|
expression: ((model.index + 1) * 584).toString()
|
|
|
|
+ "0".repeat(18)
|
|
|
|
},
|
|
|
|
ExpressionRole {
|
|
|
|
name: "multiplierIndex"
|
|
|
|
expression: 18
|
2023-06-14 07:19:45 +00:00
|
|
|
},
|
|
|
|
ExpressionRole {
|
|
|
|
name: "infiniteSupply"
|
|
|
|
expression: !(model.index % 4)
|
|
|
|
},
|
|
|
|
ExpressionRole {
|
|
|
|
name: "chainName"
|
|
|
|
expression: model.index ? "Ethereum Mainnet" : "Goerli"
|
|
|
|
},
|
2024-03-05 14:12:03 +00:00
|
|
|
ExpressionRole {
|
|
|
|
name: "decimals"
|
|
|
|
expression: decimalsText.text
|
|
|
|
},
|
2023-06-14 07:19:45 +00:00
|
|
|
ExpressionRole {
|
|
|
|
|
|
|
|
readonly property string icon1: "network/Network=Ethereum"
|
|
|
|
readonly property string icon2: "network/Network=Testnet"
|
|
|
|
|
|
|
|
name: "chainIcon"
|
|
|
|
expression: model.index ? icon1 : icon2
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
filters: ValueFilter {
|
|
|
|
roleName: "category"
|
|
|
|
value: TokenCategories.Category.Community
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
2023-06-26 11:48:45 +00:00
|
|
|
Qt.callLater(() => airdropsSettingsPanel.assetsModel = this)
|
2023-06-14 07:19:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 10:29:01 +00:00
|
|
|
membersModel: UsersModel {}
|
2023-03-15 17:14:31 +00:00
|
|
|
|
2023-06-26 11:48:45 +00:00
|
|
|
communityDetails: QtObject {
|
|
|
|
readonly property string name: "Socks"
|
|
|
|
readonly property string id: "SOCKS"
|
|
|
|
readonly property string image: ModelsData.icons.socks
|
|
|
|
readonly property string color: "red"
|
|
|
|
readonly property bool owner: true
|
|
|
|
}
|
2023-08-15 11:18:17 +00:00
|
|
|
accountsModel: WalletAccountsModel {}
|
2023-06-26 11:48:45 +00:00
|
|
|
|
|
|
|
onAirdropClicked: logs.logEvent("AirdropsSettingsPanel::onAirdropClicked")
|
2023-05-04 10:29:01 +00:00
|
|
|
}
|
2023-03-15 17:14:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
id: logsAndControlsPanel
|
|
|
|
|
|
|
|
SplitView.minimumHeight: 100
|
2023-07-13 15:51:53 +00:00
|
|
|
SplitView.preferredHeight: 250
|
2023-03-15 17:14:31 +00:00
|
|
|
|
|
|
|
logsView.logText: logs.logText
|
2023-07-06 12:33:27 +00:00
|
|
|
|
|
|
|
Column {
|
|
|
|
CheckBox {
|
|
|
|
id: ownerChecked
|
|
|
|
checked: true
|
|
|
|
|
2023-07-13 15:51:53 +00:00
|
|
|
text: "Is Owner? [Owner will be able to create an OWNER and TOKEN MASTER token]"
|
|
|
|
}
|
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: masterTokenOwnerChecked
|
|
|
|
checked: true
|
|
|
|
|
|
|
|
text: "Is TMaster token owner? [TMaster token owner will be able to mint / airdrop tokens once the TMaster is already created]"
|
|
|
|
}
|
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: adminChecked
|
|
|
|
checked: true
|
|
|
|
|
|
|
|
text: "Is admin? [Admis will be able to see token views, but NOT manage them, like creating new artwork or asset]"
|
2023-07-06 12:33:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CheckBox {
|
2023-07-18 17:34:57 +00:00
|
|
|
id: deployCheck
|
|
|
|
checked: false
|
2023-07-06 12:33:27 +00:00
|
|
|
|
2023-07-18 17:34:57 +00:00
|
|
|
text: "Owner and TMaster tokens deployed"
|
2023-07-06 12:33:27 +00:00
|
|
|
}
|
2024-03-05 14:12:03 +00:00
|
|
|
|
|
|
|
Row {
|
|
|
|
Label {
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
text: "Assets Decimals"
|
|
|
|
}
|
|
|
|
|
|
|
|
TextField {
|
|
|
|
id: decimalsText
|
|
|
|
text: "2"
|
|
|
|
width: 50
|
|
|
|
}
|
|
|
|
}
|
2023-07-06 12:33:27 +00:00
|
|
|
}
|
2023-03-15 17:14:31 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-31 12:21:14 +00:00
|
|
|
|
|
|
|
// category: Panels
|