1
0

qml: add InfoTextArea about PressAndHold

This commit is contained in:
ThomasV
2023-04-02 11:15:28 +02:00
parent 03fbf6c3d8
commit 198ca10cd0
4 changed files with 26 additions and 2 deletions

View File

@@ -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')
}

View File

@@ -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')
}

View File

@@ -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'))
}
}

View File

@@ -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.'),