some little refactor, deleting assets
This commit is contained in:
parent
7a116bfdf2
commit
5c4bd18cdc
21 changed files with 139 additions and 36 deletions
|
@ -4,16 +4,21 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import magpie
|
||||
|
||||
Item {
|
||||
id: line
|
||||
required property string title
|
||||
required property string icon
|
||||
required property color color
|
||||
required property string balance
|
||||
required property int assetId
|
||||
|
||||
signal error (err:string)
|
||||
|
||||
Row {
|
||||
readonly property int iconSize: height
|
||||
readonly property int freespace: width - iconSize - spacing * children.length - 1
|
||||
readonly property int freespace: width - deleteButton.width - iconSize - spacing * children.length - 1
|
||||
|
||||
anchors.fill: parent
|
||||
spacing: 5
|
||||
|
@ -49,5 +54,16 @@ Item {
|
|||
verticalAlignment: Text.AlignVCenter
|
||||
color: palette.text
|
||||
}
|
||||
|
||||
Button {
|
||||
id: deleteButton
|
||||
text: qsTr("Delete")
|
||||
flat: true
|
||||
height: parent.height
|
||||
onClicked: API.deleteAsset(line.assetId, function(err) {
|
||||
if (err)
|
||||
Magpie.displayError("Error deleting asset " + line.title + ": " + err);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue