2023-08-02 15:32:36 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
|
|
|
import Qt.labs.settings 1.0
|
2023-02-17 11:57:41 +00:00
|
|
|
|
2023-06-23 06:17:04 +00:00
|
|
|
import AppLayouts.Communities.panels 1.0
|
2023-02-17 11:57:41 +00:00
|
|
|
import AppLayouts.Chat.stores 1.0
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2023-07-18 17:34:57 +00:00
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
2023-02-17 11:57:41 +00:00
|
|
|
import Storybook 1.0
|
|
|
|
import Models 1.0
|
2023-08-04 16:41:21 +00:00
|
|
|
import utils 1.0
|
2023-02-17 11:57:41 +00:00
|
|
|
|
|
|
|
SplitView {
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
|
|
|
|
Logs { id: logs }
|
|
|
|
|
2023-03-29 10:53:29 +00:00
|
|
|
ListModel {
|
|
|
|
id: emptyModel
|
|
|
|
}
|
|
|
|
|
2023-05-31 08:23:05 +00:00
|
|
|
Button {
|
|
|
|
text: "Back"
|
|
|
|
onClicked: panel.navigateBack()
|
|
|
|
}
|
2023-06-28 19:30:01 +00:00
|
|
|
|
|
|
|
Timer {
|
2023-09-01 09:27:44 +00:00
|
|
|
id: timer
|
|
|
|
function delay(delayTime, cb) {
|
|
|
|
timer.interval = delayTime;
|
|
|
|
timer.repeat = false;
|
|
|
|
timer.triggered.connect(cb);
|
|
|
|
timer.start();
|
2023-06-28 19:30:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-17 11:57:41 +00:00
|
|
|
Rectangle {
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
2023-08-04 16:41:21 +00:00
|
|
|
color: Theme.palette.statusAppLayout.rightPanelBackgroundColor
|
2023-02-17 11:57:41 +00:00
|
|
|
|
2023-06-26 11:48:45 +00:00
|
|
|
MintTokensSettingsPanel {
|
2023-05-31 08:23:05 +00:00
|
|
|
id: panel
|
|
|
|
|
2023-09-01 09:27:44 +00:00
|
|
|
readonly property var singleTransactionFee: {
|
|
|
|
"ethCurrency": {
|
|
|
|
"objectName":"",
|
|
|
|
"amount":0.000007900500349933282,
|
|
|
|
"symbol":"ETH",
|
|
|
|
"displayDecimals":4,
|
|
|
|
"stripTrailingZeroes":false
|
|
|
|
},
|
|
|
|
"fiatCurrency": {
|
|
|
|
"objectName":"",
|
|
|
|
"amount":0.012852533720433712,
|
|
|
|
"symbol":"USD",
|
|
|
|
"displayDecimals":2,
|
|
|
|
"stripTrailingZeroes":false
|
|
|
|
},
|
|
|
|
"errorCode":0
|
|
|
|
}
|
|
|
|
|
2023-06-27 21:05:33 +00:00
|
|
|
MintedTokensModel {
|
|
|
|
id: mintedTokensModel
|
|
|
|
}
|
|
|
|
|
2023-07-18 17:34:57 +00:00
|
|
|
SortFilterProxyModel {
|
|
|
|
id: privilegedTokensModel
|
|
|
|
|
|
|
|
sourceModel: mintedTokensModel
|
|
|
|
|
2023-08-04 16:41:21 +00:00
|
|
|
filters: [
|
|
|
|
ExpressionFilter {
|
|
|
|
readonly property int ownerLevel: Constants.TokenPrivilegesLevel.Owner
|
|
|
|
readonly property int tMasterLevel: Constants.TokenPrivilegesLevel.TMaster
|
|
|
|
|
|
|
|
expression: {
|
|
|
|
return ((model.privilegesLevel === ownerLevel) ||
|
|
|
|
(model.privilegesLevel === tMasterLevel))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2023-07-18 17:34:57 +00:00
|
|
|
}
|
|
|
|
|
2023-02-17 11:57:41 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
anchors.topMargin: 50
|
2023-07-18 17:34:57 +00:00
|
|
|
|
|
|
|
// General:
|
2023-07-10 14:12:25 +00:00
|
|
|
communityLogo: ModelsData.collectibles.doodles
|
|
|
|
communityColor: "#FFC4E9"
|
2023-07-18 17:34:57 +00:00
|
|
|
communityName: "Doodles" // It cannot be changed since owner token and tMaster token in tokenModel used are related to the `Doodles` community
|
2023-08-30 07:20:28 +00:00
|
|
|
communityId: ""
|
2023-07-18 17:34:57 +00:00
|
|
|
|
|
|
|
// Profile type:
|
|
|
|
isAdmin: adminChecked.checked
|
|
|
|
isOwner: ownerChecked.checked
|
2023-07-10 14:12:25 +00:00
|
|
|
isTokenMasterOwner: masterTokenOwnerChecked.checked
|
2023-07-18 17:34:57 +00:00
|
|
|
|
|
|
|
// Owner and TMaster related props:
|
|
|
|
isOwnerTokenDeployed: deployCheck.checked
|
|
|
|
isTMasterTokenDeployed: deployCheck.checked
|
2023-08-01 10:31:50 +00:00
|
|
|
anyPrivilegedTokenFailed: failedCheck.checked
|
2023-07-18 17:34:57 +00:00
|
|
|
|
|
|
|
// Models:
|
|
|
|
tokensModel: editorModelChecked.checked ? emptyModel :
|
|
|
|
privilegedModelChecked.checked ? privilegedTokensModel : mintedTokensModel
|
2024-03-13 17:38:16 +00:00
|
|
|
flatNetworks: SortFilterProxyModel {
|
|
|
|
sourceModel: NetworksModel.flatNetworks
|
|
|
|
filters: ValueFilter { roleName: "isTest"; value: false }
|
|
|
|
}
|
2023-03-17 15:09:27 +00:00
|
|
|
accounts: WalletAccountsModel {}
|
2023-11-22 13:50:07 +00:00
|
|
|
referenceAssetsBySymbolModel: ListModel {
|
2023-07-04 13:21:15 +00:00
|
|
|
ListElement {
|
2023-11-22 13:50:07 +00:00
|
|
|
name: "eth"
|
|
|
|
symbol: "ETH"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
name: "dai"
|
|
|
|
symbol: "DAI"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
name: "snt"
|
|
|
|
symbol: "SNT"
|
2023-07-04 13:21:15 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-18 17:34:57 +00:00
|
|
|
|
2023-03-13 10:52:00 +00:00
|
|
|
onMintCollectible: logs.logEvent("CommunityMintTokensSettingsPanel::mintCollectible")
|
2023-05-30 15:18:45 +00:00
|
|
|
onMintAsset: logs.logEvent("CommunityMintTokensSettingsPanel::mintAssets")
|
2023-06-29 16:02:27 +00:00
|
|
|
onDeleteToken: logs.logEvent("CommunityMintTokensSettingsPanel::deleteToken: " + tokenKey)
|
2023-09-01 09:27:44 +00:00
|
|
|
onRegisterDeployFeesSubscriber: timer.delay(2000, () => feeSubscriber.feesResponse = panel.singleTransactionFee)
|
|
|
|
onRegisterSelfDestructFeesSubscriber: timer.delay(2000, () => feeSubscriber.feesResponse = panel.singleTransactionFee)
|
|
|
|
onRegisterBurnTokenFeesSubscriber: timer.delay(2000, () => feeSubscriber.feesResponse = panel.singleTransactionFee)
|
2023-03-29 10:53:29 +00:00
|
|
|
}
|
2023-02-17 11:57:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
id: logsAndControlsPanel
|
|
|
|
|
|
|
|
SplitView.minimumHeight: 100
|
2023-07-18 17:34:57 +00:00
|
|
|
SplitView.preferredHeight: 300
|
2023-02-17 11:57:41 +00:00
|
|
|
|
|
|
|
logsView.logText: logs.logText
|
2023-03-29 10:53:29 +00:00
|
|
|
|
2023-06-28 19:30:01 +00:00
|
|
|
ColumnLayout {
|
2023-07-06 12:33:27 +00:00
|
|
|
CheckBox {
|
|
|
|
id: ownerChecked
|
|
|
|
checked: true
|
|
|
|
|
2023-07-12 14:06:07 +00:00
|
|
|
text: "Is Owner? [Owner will be able to create an OWNER and TOKEN MASTER token]"
|
2023-07-06 12:33:27 +00:00
|
|
|
}
|
|
|
|
|
2023-07-10 14:12:25 +00:00
|
|
|
CheckBox {
|
|
|
|
id: masterTokenOwnerChecked
|
|
|
|
checked: true
|
|
|
|
|
2023-07-12 14:06:07 +00:00
|
|
|
text: "Is TMaster token owner? [TMaster token owner will be able to mint / airdrop tokens once the TMaster is already created]"
|
2023-07-10 14:12:25 +00:00
|
|
|
}
|
|
|
|
|
2023-07-06 12:33:27 +00:00
|
|
|
CheckBox {
|
|
|
|
id: adminChecked
|
|
|
|
checked: true
|
|
|
|
|
2023-07-12 14:06:07 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2023-07-18 17:34:57 +00:00
|
|
|
RowLayout {
|
|
|
|
RadioButton {
|
|
|
|
id: editorModelChecked
|
|
|
|
|
|
|
|
checked: true
|
2023-03-29 10:53:29 +00:00
|
|
|
|
2023-07-18 17:34:57 +00:00
|
|
|
text: "No tokens minted yet"
|
|
|
|
}
|
|
|
|
RadioButton {
|
|
|
|
id: privilegedModelChecked
|
|
|
|
|
|
|
|
text: "Owner token and TMaster token only"
|
2023-08-01 10:31:50 +00:00
|
|
|
|
2023-07-18 17:34:57 +00:00
|
|
|
}
|
|
|
|
RadioButton {
|
|
|
|
id: completeModelChecked
|
|
|
|
|
|
|
|
text: "Minted tokens list"
|
|
|
|
}
|
2023-03-29 10:53:29 +00:00
|
|
|
}
|
2023-06-28 19:30:01 +00:00
|
|
|
|
|
|
|
RowLayout {
|
2023-07-18 17:34:57 +00:00
|
|
|
|
|
|
|
RadioButton {
|
2023-06-28 19:30:01 +00:00
|
|
|
text: "Set all to 'In progress'"
|
|
|
|
|
|
|
|
onClicked: mintedTokensModel.changeAllMintingStates(1)
|
2023-03-29 10:53:29 +00:00
|
|
|
}
|
|
|
|
|
2023-07-18 17:34:57 +00:00
|
|
|
RadioButton {
|
2023-08-01 10:31:50 +00:00
|
|
|
id: failedCheck
|
|
|
|
|
2023-06-28 19:30:01 +00:00
|
|
|
text: "Set all to 'Error'"
|
2023-08-01 10:31:50 +00:00
|
|
|
checked: true
|
2023-03-29 10:53:29 +00:00
|
|
|
|
2023-06-28 19:30:01 +00:00
|
|
|
onClicked: mintedTokensModel.changeAllMintingStates(0)
|
2023-03-29 10:53:29 +00:00
|
|
|
}
|
2023-07-18 17:34:57 +00:00
|
|
|
|
|
|
|
RadioButton {
|
|
|
|
id: deployCheck
|
|
|
|
|
|
|
|
text: "Set all to 'Deployed'"
|
|
|
|
|
|
|
|
onClicked: mintedTokensModel.changeAllMintingStates(2)
|
|
|
|
}
|
2023-03-29 10:53:29 +00:00
|
|
|
}
|
|
|
|
}
|
2023-02-17 11:57:41 +00:00
|
|
|
}
|
2023-08-02 15:32:36 +00:00
|
|
|
|
|
|
|
Settings {
|
|
|
|
property alias editorModelChecked: editorModelChecked.checked
|
|
|
|
property alias privilegedModelChecked: privilegedModelChecked.checked
|
|
|
|
property alias completeModelChecked: completeModelChecked.checked
|
|
|
|
}
|
2023-02-17 11:57:41 +00:00
|
|
|
}
|
2023-07-31 12:21:14 +00:00
|
|
|
|
|
|
|
// category: Panels
|
2023-10-03 11:56:30 +00:00
|
|
|
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=22721%3A498587&t=v2Krj5iZQaSTK7Om-1
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2934%3A480877&t=v2Krj5iZQaSTK7Om-1
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=22721%3A498811&t=v2Krj5iZQaSTK7Om-1
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2934%3A480927&t=v2Krj5iZQaSTK7Om-1
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?type=design&node-id=29566-689073&t=mAtmLENvQyRJqDGQ-0
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?type=design&node-id=29437-599353&t=mAtmLENvQyRJqDGQ-0
|