Skip to content
Snippets Groups Projects
Commit 481269b2 authored by littletux89@gmail.com's avatar littletux89@gmail.com
Browse files

[+] Added code.

parent 8a2fee9b
No related branches found
No related tags found
1 merge request!11Cellframe clone
......@@ -18,11 +18,21 @@ QObject *Factory::createStructure()
token1->setBalance(5.5);
token1->setNetwork("Kelvin-testnet");
token1->setEmission(464645646546);
DapWalletToken * token3 = new DapWalletToken("NEW", wallet);
token3->setBalance(5);
token3->setNetwork("Kelvin-testnet");
token3->setEmission(45465566987846);
DapWalletToken * token2 = new DapWalletToken("CELL", wallet);
token2->setBalance(100);
token2->setNetwork("Private");
token2->setEmission(121212121);
DapWalletToken * token4 = new DapWalletToken("CRU", wallet);
token4->setBalance(1000);
token4->setNetwork("Private");
token4->setEmission(121212121);
wallet->addToken(token1);
wallet->addToken(token2);
wallet->addToken(token3);
wallet->addToken(token4);
return wallet;
}
import QtQuick 2.4
import "qrc:/"
import "../../"
DapDashboardTabForm
......@@ -23,6 +24,8 @@ DapDashboardTabForm
dapDashboardScreen.dapListViewWallets.model = modelWallets.get(dapDashboardTopPanel.dapComboboxWallet.currentIndex).networks
}
ListModel
{
id: modelWallets
......@@ -40,12 +43,18 @@ DapDashboardTabForm
}
}
// When you click on the button for creating a new payment, open the form to fill in the payment data
dapDashboardScreen.dapButtonNewPayment.onClicked:
{
if(dapDashboardRightPanel.currentItem !== currentRightPanel)
{
currentRightPanel = dapDashboardRightPanel.push(Qt.resolvedUrl(newPaymentMain));
currentRightPanel = dapDashboardRightPanel.push({item:Qt.resolvedUrl(newPaymentMain),
properties: {dapCmboBoxToken: modelWallets.get(dapDashboardTopPanel.dapComboboxWallet.currentIndex).networks}});
dapDashboardTopPanel.dapComboboxNetwork = mT
// console.log(dapDashboardTopPanel.dapComboboxWallet.currentIndex)
// console.log(modelWallets.get(dapDashboardTopPanel.dapComboboxWallet.currentIndex).networks)
}
}
}
......@@ -32,8 +32,10 @@ DapDashboardTopPanelForm
modelWallets.get(i).networks.append({"name": objectsArray[i].Networks[n],
"address": objectsArray[i].findAddress(objectsArray[i].Networks[n]),
"tokens": []})
// console.log(Object.keys(objectsArray[i].Tokens).length)
for (var t = 0; t < Object.keys(objectsArray[i].Tokens).length; ++t)
{
console.log(objectsArray[i].Tokens[t].Network + " === " + objectsArray[i].Networks[n])
if(objectsArray[i].Tokens[t].Network === objectsArray[i].Networks[n])
{
modelWallets.get(i).networks.get(n).tokens.append({"name": objectsArray[i].Tokens[t].Name,
......
......@@ -7,6 +7,7 @@ DapAbstractTopPanel
{
property alias dapAddWalletButton: addWalletButton
property alias dapComboboxWallet: comboboxWallet
property alias dapComboboxNetwork: comboboxWalletNetwork.model
anchors.fill: parent
// Static text "Wallet"
......@@ -71,12 +72,75 @@ DapAbstractTopPanel
}
}
Rectangle
{
id: frameComboBoxNetwork
anchors.left: frameComboBoxWallet.right
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 30 * pt
width: 148 * pt
color: "transparent"
ListModel
{
id: mT
ListElement
{
name: "Pr"
val: 1
}
ListElement
{
name: "Kl"
val: 2
}
}
DapComboBox
{
id: comboboxWalletNetwork
model: mT
textRole: "name"
mainLineText: "all wallets"
indicatorImageNormal: "qrc:/res/icons/ic_arrow_drop_down.png"
indicatorImageActive: "qrc:/res/icons/ic_arrow_drop_up.png"
sidePaddingNormal: 0 * pt
sidePaddingActive: 16 * pt
normalColorText: "#070023"
hilightColorText: "#FFFFFF"
normalColorTopText: "#FFFFFF"
hilightColorTopText: "#070023"
hilightColor: "#330F54"
normalTopColor: "#070023"
widthPopupComboBoxNormal: 148 * pt
widthPopupComboBoxActive: 180 * pt
heightComboBoxNormal: 24 * pt
heightComboBoxActive: 44 * pt
bottomIntervalListElement: 8 * pt
topEffect: false
x: popup.visible ? sidePaddingActive * (-1) : sidePaddingNormal
normalColor: "#FFFFFF"
hilightTopColor: normalColor
paddingTopItemDelegate: 8 * pt
heightListElement: 32 * pt
intervalListElement: 10 * pt
indicatorWidth: 24 * pt
indicatorHeight: indicatorWidth
indicatorLeftInterval: 8 * pt
colorTopNormalDropShadow: "#00000000"
colorDropShadow: "#40ABABAB"
fontComboBox.pixelSize: 14 * pt
fontComboBox.family: "Roboto"
}
}
// Static wallet balance text "Wallet balance"
Label
{
id: headerWalletBalance
text: qsTr("Wallet balance")
anchors.left: frameComboBoxWallet.right
anchors.left: frameComboBoxNetwork.right
anchors.leftMargin: 70 * pt
anchors.verticalCenter: parent.verticalCenter
font.family: DapMainApplicationWindow.dapFontRobotoRegular.name
......
......@@ -11,7 +11,7 @@ DapAbstractRightPanel
/// @param dapTextInputAmountPayment Input field for transfer amount.
property alias dapTextInputAmountPayment: textInputAmountPayment
/// @param dapCmboBoxToken Token combobox.
property alias dapCmboBoxToken: comboBoxToken
property alias dapCmboBoxToken: comboBoxToken.model
/// @param dapTextInputRecipientWalletAddress Recipient wallet address input field.
property alias dapTextInputRecipientWalletAddress: textInputRecipientWalletAddress
......@@ -75,29 +75,6 @@ DapAbstractRightPanel
}
}
ListModel
{
id: tokenModel
ListElement
{
signatureName: "Kelvin"
}
ListElement
{
signatureName: "Token 1"
}
ListElement
{
signatureName: "Token 2"
}
ListElement
{
signatureName: "NewGold"
}
}
Rectangle
{
id: frameSenderWalletAddress
......@@ -119,11 +96,11 @@ DapAbstractRightPanel
anchors.topMargin: 20 * pt
anchors.leftMargin: 16 * pt
anchors.rightMargin: 16 * pt
height: comboBoxToken.height
height: 100
DapComboBox
{
id: comboBoxToken
model: tokenModel
textRole: "name"
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment