Skip to content

Commit 8865543

Browse files
committed
Copy to clipboard hax
1 parent e12abfd commit 8865543

File tree

4 files changed

+64
-0
lines changed

4 files changed

+64
-0
lines changed

ethereal/assets/qml/views/chain.qml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ Rectangle {
7373

7474
MenuSeparator{}
7575

76+
MenuItem {
77+
text: "Copy"
78+
onTriggered: {
79+
copyToClipboard(blockModel.get(this.row).hash)
80+
}
81+
}
82+
7683
MenuItem {
7784
text: "Dump State"
7885
onTriggered: {

ethereal/assets/qml/views/info.qml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,47 @@ Rectangle {
5757
TableViewColumn{ role: "address"; title: "address"; width: 300}
5858

5959
model: addressModel
60+
itemDelegate: Item {
61+
Text {
62+
anchors {
63+
left: parent.left
64+
right: parent.right
65+
leftMargin: 10
66+
verticalCenter: parent.verticalCenter
67+
}
68+
color: styleData.textColor
69+
elide: styleData.elideMode
70+
text: styleData.value
71+
font.pixelSize: 11
72+
MouseArea {
73+
acceptedButtons: Qt.LeftButton | Qt.RightButton
74+
propagateComposedEvents: true
75+
anchors.fill: parent
76+
onClicked: {
77+
addressView.selection.clear()
78+
addressView.selection.select(styleData.row)
79+
80+
if(mouse.button == Qt.RightButton) {
81+
contextMenu.row = styleData.row;
82+
contextMenu.popup()
83+
}
84+
}
85+
}
86+
}
87+
88+
}
89+
90+
Menu {
91+
id: contextMenu
92+
property var row;
93+
94+
MenuItem {
95+
text: "Copy"
96+
onTriggered: {
97+
copyToClipboard(addressModel.get(this.row).address)
98+
}
99+
}
100+
}
60101
}
61102

62103
property var logModel: ListModel {

ethereal/assets/qml/wallet.qml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ ApplicationWindow {
1717

1818
title: "Ethereal"
1919

20+
TextField {
21+
id: copyElementHax
22+
visible: false
23+
}
24+
25+
function copyToClipboard(text) {
26+
copyElementHax.text = text
27+
copyElementHax.selectAll()
28+
copyElementHax.copy()
29+
}
30+
2031
// Takes care of loading all default plugins
2132
Component.onCompleted: {
2233
var historyView = addPlugin("./views/history.qml", {title: "History"})

ethereal/gui.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,11 @@ func (gui *Gui) update() {
482482
reactor.Subscribe("peerList", peerChan)
483483
}
484484

485+
func (gui *Gui) CopyToClipboard(data string) {
486+
//clipboard.WriteAll("test")
487+
fmt.Println("COPY currently BUGGED. Here are the contents:\n", data)
488+
}
489+
485490
func (gui *Gui) setPeerInfo() {
486491
gui.win.Root().Call("setPeers", fmt.Sprintf("%d / %d", gui.eth.PeerCount(), gui.eth.MaxPeers))
487492

0 commit comments

Comments
 (0)