qml: restore Save button in InvoiceDialog, restore invoice list view, now from menu
This commit is contained in:
@@ -30,13 +30,6 @@ ElDialog {
|
|||||||
height: parent.height
|
height: parent.height
|
||||||
columns: 2
|
columns: 2
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
height: 1
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
color: Material.accentColor
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr('Amount to send')
|
text: qsTr('Amount to send')
|
||||||
color: Material.accentColor
|
color: Material.accentColor
|
||||||
@@ -290,7 +283,7 @@ ElDialog {
|
|||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
spacing: constants.paddingMedium
|
spacing: constants.paddingMedium
|
||||||
|
|
||||||
Button {
|
FlatButton {
|
||||||
text: qsTr('Delete')
|
text: qsTr('Delete')
|
||||||
icon.source: '../../icons/delete.png'
|
icon.source: '../../icons/delete.png'
|
||||||
visible: invoice_key != ''
|
visible: invoice_key != ''
|
||||||
@@ -300,6 +293,17 @@ ElDialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FlatButton {
|
||||||
|
text: qsTr('Save')
|
||||||
|
icon.source: '../../icons/save.png'
|
||||||
|
visible: invoice_key == ''
|
||||||
|
enabled: invoice.canSave
|
||||||
|
onClicked: {
|
||||||
|
invoice.save_invoice()
|
||||||
|
dialog.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FlatButton {
|
FlatButton {
|
||||||
text: qsTr('Pay')
|
text: qsTr('Pay')
|
||||||
icon.source: '../../icons/confirmed.png'
|
icon.source: '../../icons/confirmed.png'
|
||||||
@@ -309,11 +313,6 @@ ElDialog {
|
|||||||
invoice.save_invoice()
|
invoice.save_invoice()
|
||||||
dialog.close()
|
dialog.close()
|
||||||
doPay() // only signal here
|
doPay() // only signal here
|
||||||
// if (invoice.invoiceType == Invoice.OnchainInvoice) {
|
|
||||||
// doPay() // only signal here
|
|
||||||
// } else if (invoice.invoiceType == Invoice.LightningInvoice) {
|
|
||||||
// doPay() // only signal here
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,8 +12,22 @@ Item {
|
|||||||
|
|
||||||
property string title: Daemon.currentWallet ? Daemon.currentWallet.name : ''
|
property string title: Daemon.currentWallet ? Daemon.currentWallet.name : ''
|
||||||
|
|
||||||
|
function openInvoice(key) {
|
||||||
|
var dialog = invoiceDialog.createObject(app, { invoice: invoiceParser, invoice_key: key })
|
||||||
|
dialog.open()
|
||||||
|
return dialog
|
||||||
|
}
|
||||||
|
|
||||||
property QtObject menu: Menu {
|
property QtObject menu: Menu {
|
||||||
id: menu
|
id: menu
|
||||||
|
MenuItem {
|
||||||
|
icon.color: 'transparent'
|
||||||
|
action: Action {
|
||||||
|
text: qsTr('Invoices');
|
||||||
|
onTriggered: menu.openPage(Qt.resolvedUrl('Invoices.qml'))
|
||||||
|
icon.source: '../../icons/tab_receive.png'
|
||||||
|
}
|
||||||
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
icon.color: 'transparent'
|
icon.color: 'transparent'
|
||||||
action: Action {
|
action: Action {
|
||||||
|
|||||||
@@ -118,6 +118,10 @@ ApplicationWindow
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
initialItem: Qt.resolvedUrl('WalletMainView.qml')
|
initialItem: Qt.resolvedUrl('WalletMainView.qml')
|
||||||
|
|
||||||
|
function getRoot() {
|
||||||
|
return mainStackView.get(0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
|
|||||||
Reference in New Issue
Block a user