Skip to content

Commit

Permalink
Fix #4919
Browse files Browse the repository at this point in the history
  • Loading branch information
uglide committed Nov 19, 2020
1 parent 9d3063e commit 8dff467
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
8 changes: 8 additions & 0 deletions src/qml/LogView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ FastTextView {

model: ListModel {}

function dumpText() {
var allStrings = "";
for (var ind=0; ind < root.model.count; ind++) {
allStrings += root.model.get(ind)["msg"] + "\n"
}
return allStrings
}

color: sysPalette.base
border.color: sysPalette.shadow
border.width: 1
Expand Down
22 changes: 14 additions & 8 deletions src/qml/common/FastTextView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Rectangle {
listView.positionViewAtEnd()
}

function dumpText() {
var allStrings = "";
for (var id in root.model) {
allStrings += root.model[id] + "\n"
}
return allStrings
}

ScrollView {
anchors.fill: parent
anchors.margins: 10
Expand All @@ -22,8 +30,11 @@ Rectangle {
id: listView
width: root.width - 20

delegate: BetterLabel {
delegate: TextEdit {
color: sysPalette.text
width: listView.width
readOnly: true
selectByMouse: true
text: {
if (root.showLineNumbers) {
return (index+1) + ". " + modelData
Expand Down Expand Up @@ -56,13 +67,8 @@ Rectangle {
icon.source: "qrc:/images/copy.svg"
icon.color: "transparent"

onTriggered: {
var allStrings = "";
for (var id in affectedKeysListView.model) {
allStrings += affectedKeysListView.model[id] + "\n"
}
qmlUtils.copyToClipboard(allStrings)
allStrings = ""
onTriggered: {
qmlUtils.copyToClipboard(root.dumpText())
}
}
}
Expand Down

0 comments on commit 8dff467

Please sign in to comment.