Browse Source

qml: add InfoTextArea about PressAndHold

master
ThomasV 3 years ago
parent
commit
198ca10cd0
  1. 7
      electrum/gui/qml/components/Invoices.qml
  2. 7
      electrum/gui/qml/components/ReceiveRequests.qml
  3. 2
      electrum/gui/qml/components/WalletMainView.qml
  4. 12
      electrum/gui/qml/qewallet.py

7
electrum/gui/qml/components/Invoices.qml

@ -14,6 +14,13 @@ Pane {
ColumnLayout {
anchors.fill: parent
InfoTextArea {
Layout.fillWidth: true
Layout.bottomMargin: constants.paddingLarge
visible: !Daemon.currentWallet.userKnowsPressAndHold
text: qsTr('To access this list from the main screen, press and hold the Send button')
}
Heading {
text: qsTr('Saved Invoices')
}

7
electrum/gui/qml/components/ReceiveRequests.qml

@ -17,6 +17,13 @@ Pane {
ColumnLayout {
anchors.fill: parent
InfoTextArea {
Layout.fillWidth: true
Layout.bottomMargin: constants.paddingLarge
visible: !Daemon.currentWallet.userKnowsPressAndHold
text: qsTr('To access this list from the main screen, press and hold the Receive button')
}
Heading {
text: qsTr('Pending requests')
}

2
electrum/gui/qml/components/WalletMainView.qml

@ -192,6 +192,7 @@ Item {
dialog.open()
}
onPressAndHold: {
Daemon.currentWallet.userKnowsPressAndHold = true
Daemon.currentWallet.delete_expired_requests()
app.stack.push(Qt.resolvedUrl('ReceiveRequests.qml'))
}
@ -204,6 +205,7 @@ Item {
text: qsTr('Send')
onClicked: openSendDialog()
onPressAndHold: {
Daemon.currentWallet.userKnowsPressAndHold = true
app.stack.push(Qt.resolvedUrl('Invoices.qml'))
}
}

12
electrum/gui/qml/qewallet.py

@ -125,9 +125,18 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
self.register_callbacks()
self.destroyed.connect(lambda: self.on_destroy())
self._user_knows_press_and_hold = False # maybe save in config?
self.synchronizing = not wallet.is_up_to_date()
userKnowsPressAndHoldChanged = pyqtSignal()
@pyqtProperty(bool, notify=userKnowsPressAndHoldChanged)
def userKnowsPressAndHold(self):
return self._user_knows_press_and_hold
@userKnowsPressAndHold.setter
def userKnowsPressAndHold(self, userKnowsPressAndHold):
self._user_knows_press_and_hold = userKnowsPressAndHold
synchronizingChanged = pyqtSignal()
@pyqtProperty(bool, notify=synchronizingChanged)
def synchronizing(self):
@ -629,7 +638,6 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
elif lightning_only:
addr = None
else:
has_lightning = self.wallet.has_lightning()
msg = [
_('No address available.'),
_('All your addresses are used in pending requests.'),

Loading…
Cancel
Save