good morning!!!!

Skip to content
Snippets Groups Projects
Commit 88655439 authored by Jeffrey Wilcke's avatar Jeffrey Wilcke
Browse files

Copy to clipboard hax

parent e12abfd4
Branches
Tags
No related merge requests found
...@@ -73,6 +73,13 @@ Rectangle { ...@@ -73,6 +73,13 @@ Rectangle {
MenuSeparator{} MenuSeparator{}
MenuItem {
text: "Copy"
onTriggered: {
copyToClipboard(blockModel.get(this.row).hash)
}
}
MenuItem { MenuItem {
text: "Dump State" text: "Dump State"
onTriggered: { onTriggered: {
......
...@@ -57,6 +57,47 @@ Rectangle { ...@@ -57,6 +57,47 @@ Rectangle {
TableViewColumn{ role: "address"; title: "address"; width: 300} TableViewColumn{ role: "address"; title: "address"; width: 300}
model: addressModel model: addressModel
itemDelegate: Item {
Text {
anchors {
left: parent.left
right: parent.right
leftMargin: 10
verticalCenter: parent.verticalCenter
}
color: styleData.textColor
elide: styleData.elideMode
text: styleData.value
font.pixelSize: 11
MouseArea {
acceptedButtons: Qt.LeftButton | Qt.RightButton
propagateComposedEvents: true
anchors.fill: parent
onClicked: {
addressView.selection.clear()
addressView.selection.select(styleData.row)
if(mouse.button == Qt.RightButton) {
contextMenu.row = styleData.row;
contextMenu.popup()
}
}
}
}
}
Menu {
id: contextMenu
property var row;
MenuItem {
text: "Copy"
onTriggered: {
copyToClipboard(addressModel.get(this.row).address)
}
}
}
} }
property var logModel: ListModel { property var logModel: ListModel {
......
...@@ -17,6 +17,17 @@ ApplicationWindow { ...@@ -17,6 +17,17 @@ ApplicationWindow {
title: "Ethereal" title: "Ethereal"
TextField {
id: copyElementHax
visible: false
}
function copyToClipboard(text) {
copyElementHax.text = text
copyElementHax.selectAll()
copyElementHax.copy()
}
// Takes care of loading all default plugins // Takes care of loading all default plugins
Component.onCompleted: { Component.onCompleted: {
var historyView = addPlugin("./views/history.qml", {title: "History"}) var historyView = addPlugin("./views/history.qml", {title: "History"})
......
...@@ -482,6 +482,11 @@ func (gui *Gui) update() { ...@@ -482,6 +482,11 @@ func (gui *Gui) update() {
reactor.Subscribe("peerList", peerChan) reactor.Subscribe("peerList", peerChan)
} }
func (gui *Gui) CopyToClipboard(data string) {
//clipboard.WriteAll("test")
fmt.Println("COPY currently BUGGED. Here are the contents:\n", data)
}
func (gui *Gui) setPeerInfo() { func (gui *Gui) setPeerInfo() {
gui.win.Root().Call("setPeers", fmt.Sprintf("%d / %d", gui.eth.PeerCount(), gui.eth.MaxPeers)) gui.win.Root().Call("setPeers", fmt.Sprintf("%d / %d", gui.eth.PeerCount(), gui.eth.MaxPeers))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment