-
Notifications
You must be signed in to change notification settings - Fork 1
/
AccountPage.qml
88 lines (70 loc) · 2.37 KB
/
AccountPage.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.3
import QtQuick.Controls.Universal 2.3
import "rpc.js" as Rpc
Page {
id: accountPage
property string wallet
property var accs: walletAccounts(wallet)
property alias account: accountsComboBox.currentText
background: Item{}
header: RowLayout {
ToolButton {
icon.name: "document-new"
icon.source: "images/icons/add_account.png"
onClicked: {
var newAcc = Rpc.createNextAccount(wallet);
msg.show(msg.mode_information, qsTr("Account Created"), qsTr("New account has been created;\n%1").arg(newAcc))
accountsComboBox.model = Rpc.walletAccounts(wallet);
}
}
ComboBox {
id: accountsComboBox
Layout.fillWidth: true
editable: false
textRole: "account"
model: Rpc.walletAccounts(wallet);
}
ToolButton {
icon.name: "edit-copy"
icon.source: "images/icons/edit_copy.png"
onClicked: {
proxy.toClipboard(accountsComboBox.currentText);
msg.show(msg.mode_information, qsTr("Address Copied!"), qsTr("Current account address has been copied to clipboard."))
}
}
// ToolButton {
// icon.name: "network-transmit-receive"
// text: qsTr("New Representative")
// onClicked: {
// var repr = Rpc.accountRepresentative(account);
// console.log(repr);
// reprDlg.show(msg.mode_information, qsTr("Representative"),
// qsTr("Please set representative for account\n%1\nCurrent Representative;\n%2").arg(account).arg(repr));
// }
// }
ToolButton {
text: qsTr("Send")
icon.source: "images/icons/send.png"
onClicked: send(account)
}
}
signal send(string acount)
TxsList {
id: txLV
anchors.fill: parent
account: accountPage.account
balance: accountsComboBox.model[accountsComboBox.currentIndex].balance
}
function walletAccounts(w) {
Rpc.walletAccounts(w);
}
MessageBox { id: msg }
InputDialog {
id: reprDlg
onAccepted :{
console.log(value);
}
}
}