Browse Source

qml: include dialogs in back button navigation

patch-4
Sander van Grieken 3 years ago
parent
commit
3b9c009e43
  1. 2
      electrum/gui/qml/components/Channels.qml
  2. 2
      electrum/gui/qml/components/CloseChannelDialog.qml
  3. 2
      electrum/gui/qml/components/ConfirmTxDialog.qml
  4. 2
      electrum/gui/qml/components/GenericShareDialog.qml
  5. 2
      electrum/gui/qml/components/InvoiceDialog.qml
  6. 2
      electrum/gui/qml/components/LightningPaymentProgressDialog.qml
  7. 4
      electrum/gui/qml/components/MessageDialog.qml
  8. 2
      electrum/gui/qml/components/PasswordDialog.qml
  9. 4
      electrum/gui/qml/components/Pin.qml
  10. 2
      electrum/gui/qml/components/RequestDialog.qml
  11. 2
      electrum/gui/qml/components/SwapDialog.qml
  12. 17
      electrum/gui/qml/components/controls/ElDialog.qml
  13. 10
      electrum/gui/qml/components/main.qml

2
electrum/gui/qml/components/Channels.qml

@ -157,6 +157,6 @@ Pane {
Component {
id: swapDialog
Swap {}
SwapDialog {}
}
}

2
electrum/gui/qml/components/CloseChannelDialog.qml

@ -7,7 +7,7 @@ import org.electrum 1.0
import "controls"
Dialog {
ElDialog {
id: dialog
width: parent.width
height: parent.height

2
electrum/gui/qml/components/ConfirmTxDialog.qml

@ -7,7 +7,7 @@ import org.electrum 1.0
import "controls"
Dialog {
ElDialog {
id: dialog
required property QtObject finalizer

2
electrum/gui/qml/components/GenericShareDialog.qml

@ -5,7 +5,7 @@ import QtQuick.Controls.Material 2.0
import "controls"
Dialog {
ElDialog {
id: dialog
property string text

2
electrum/gui/qml/components/InvoiceDialog.qml

@ -7,7 +7,7 @@ import org.electrum 1.0
import "controls"
Dialog {
ElDialog {
id: dialog
property Invoice invoice

2
electrum/gui/qml/components/LightningPaymentProgressDialog.qml

@ -7,7 +7,7 @@ import org.electrum 1.0
import "controls"
Dialog {
ElDialog {
id: dialog
required property string invoice_key

4
electrum/gui/qml/components/MessageDialog.qml

@ -3,7 +3,9 @@ import QtQuick.Layouts 1.0
import QtQuick.Controls 2.3
import QtQuick.Controls.Material 2.0
Dialog {
import "controls"
ElDialog {
id: dialog
title: qsTr("Message")

2
electrum/gui/qml/components/PasswordDialog.qml

@ -7,7 +7,7 @@ import org.electrum 1.0
import "controls"
Dialog {
ElDialog {
id: passworddialog
title: qsTr("Enter Password")

4
electrum/gui/qml/components/Pin.qml

@ -7,7 +7,7 @@ import org.electrum 1.0
import "controls"
Dialog {
ElDialog {
id: root
title: qsTr('PIN')
@ -31,6 +31,8 @@ Dialog {
property bool canCancel: true
allowClose: canCancel
property string mode // [check, enter, change]
property string pincode // old one passed in when change, new one passed out

2
electrum/gui/qml/components/RequestDialog.qml

@ -7,7 +7,7 @@ import org.electrum 1.0
import "controls"
Dialog {
ElDialog {
id: dialog
title: qsTr('Payment Request')

2
electrum/gui/qml/components/Swap.qml → electrum/gui/qml/components/SwapDialog.qml

@ -7,7 +7,7 @@ import org.electrum 1.0
import "controls"
Dialog {
ElDialog {
id: root
width: parent.width

17
electrum/gui/qml/components/controls/ElDialog.qml

@ -0,0 +1,17 @@
import QtQuick 2.6
import QtQuick.Layouts 1.0
import QtQuick.Controls 2.3
Dialog {
id: abstractdialog
property bool allowClose: true
onOpenedChanged: {
if (opened) {
app.activeDialog = abstractdialog
} else {
app.activeDialog = null
}
}
}

10
electrum/gui/qml/components/main.qml

@ -27,6 +27,8 @@ ApplicationWindow
property alias stack: mainStackView
property Dialog activeDialog: null
header: ToolBar {
id: toolbar
@ -205,6 +207,14 @@ ApplicationWindow
}
onClosing: {
if (activeDialog) {
console.log('dialog on top')
if (activeDialog.allowClose) {
activeDialog.close()
}
close.accepted = false
return
}
if (stack.depth > 1) {
close.accepted = false
stack.pop()

Loading…
Cancel
Save