|
|
|
@ -9,10 +9,16 @@ import "controls" |
|
|
|
|
|
|
|
|
|
|
|
Pane { |
|
|
|
Pane { |
|
|
|
id: root |
|
|
|
id: root |
|
|
|
property string selected_key |
|
|
|
|
|
|
|
|
|
|
|
padding: 0 |
|
|
|
|
|
|
|
|
|
|
|
ColumnLayout { |
|
|
|
ColumnLayout { |
|
|
|
anchors.fill: parent |
|
|
|
anchors.fill: parent |
|
|
|
|
|
|
|
spacing: 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ColumnLayout { |
|
|
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
|
|
Layout.margins: constants.paddingLarge |
|
|
|
|
|
|
|
|
|
|
|
InfoTextArea { |
|
|
|
InfoTextArea { |
|
|
|
Layout.fillWidth: true |
|
|
|
Layout.fillWidth: true |
|
|
|
@ -37,7 +43,7 @@ Pane { |
|
|
|
id: listview |
|
|
|
id: listview |
|
|
|
anchors.fill: parent |
|
|
|
anchors.fill: parent |
|
|
|
clip: true |
|
|
|
clip: true |
|
|
|
|
|
|
|
currentIndex: -1 |
|
|
|
model: DelegateModel { |
|
|
|
model: DelegateModel { |
|
|
|
id: delegateModel |
|
|
|
id: delegateModel |
|
|
|
model: Daemon.currentWallet.invoiceModel |
|
|
|
model: Daemon.currentWallet.invoiceModel |
|
|
|
@ -47,11 +53,9 @@ Pane { |
|
|
|
dialog.invoiceAmountChanged.connect(function () { |
|
|
|
dialog.invoiceAmountChanged.connect(function () { |
|
|
|
Daemon.currentWallet.invoiceModel.init_model() |
|
|
|
Daemon.currentWallet.invoiceModel.init_model() |
|
|
|
}) |
|
|
|
}) |
|
|
|
selected_key = '' |
|
|
|
listview.currentIndex = -1 |
|
|
|
} |
|
|
|
|
|
|
|
onPressAndHold: { |
|
|
|
|
|
|
|
selected_key = model.key |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
onPressAndHold: listview.currentIndex = index |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -77,6 +81,9 @@ Pane { |
|
|
|
ScrollIndicator.vertical: ScrollIndicator { } |
|
|
|
ScrollIndicator.vertical: ScrollIndicator { } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ButtonContainer { |
|
|
|
ButtonContainer { |
|
|
|
Layout.fillWidth: true |
|
|
|
Layout.fillWidth: true |
|
|
|
FlatButton { |
|
|
|
FlatButton { |
|
|
|
@ -84,10 +91,9 @@ Pane { |
|
|
|
Layout.preferredWidth: 1 |
|
|
|
Layout.preferredWidth: 1 |
|
|
|
text: qsTr('Delete') |
|
|
|
text: qsTr('Delete') |
|
|
|
icon.source: '../../icons/delete.png' |
|
|
|
icon.source: '../../icons/delete.png' |
|
|
|
visible: selected_key != '' |
|
|
|
visible: listview.currentIndex >= 0 |
|
|
|
onClicked: { |
|
|
|
onClicked: { |
|
|
|
Daemon.currentWallet.delete_invoice(selected_key) |
|
|
|
Daemon.currentWallet.delete_invoice(listview.currentItem.getKey()) |
|
|
|
selected_key = '' |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
FlatButton { |
|
|
|
FlatButton { |
|
|
|
@ -95,13 +101,12 @@ Pane { |
|
|
|
Layout.preferredWidth: 1 |
|
|
|
Layout.preferredWidth: 1 |
|
|
|
text: qsTr('View') |
|
|
|
text: qsTr('View') |
|
|
|
icon.source: '../../icons/tab_receive.png' |
|
|
|
icon.source: '../../icons/tab_receive.png' |
|
|
|
visible: selected_key != '' |
|
|
|
visible: listview.currentIndex >= 0 |
|
|
|
onClicked: { |
|
|
|
onClicked: { |
|
|
|
var dialog = app.stack.getRoot().openInvoice(selected_key) |
|
|
|
var dialog = app.stack.getRoot().openInvoice(listview.currentItem.getKey()) |
|
|
|
dialog.invoiceAmountChanged.connect(function () { |
|
|
|
dialog.invoiceAmountChanged.connect(function () { |
|
|
|
Daemon.currentWallet.invoiceModel.init_model() |
|
|
|
Daemon.currentWallet.invoiceModel.init_model() |
|
|
|
}) |
|
|
|
}) |
|
|
|
selected_key = '' |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|