qml: move user_knowns_press_and_hold to config
This commit is contained in:
@@ -17,7 +17,7 @@ Pane {
|
|||||||
InfoTextArea {
|
InfoTextArea {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.bottomMargin: constants.paddingLarge
|
Layout.bottomMargin: constants.paddingLarge
|
||||||
visible: !Daemon.currentWallet.userKnowsPressAndHold
|
visible: !Config.userKnowsPressAndHold
|
||||||
text: qsTr('To access this list from the main screen, press and hold the Send button')
|
text: qsTr('To access this list from the main screen, press and hold the Send button')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Pane {
|
|||||||
InfoTextArea {
|
InfoTextArea {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.bottomMargin: constants.paddingLarge
|
Layout.bottomMargin: constants.paddingLarge
|
||||||
visible: !Daemon.currentWallet.userKnowsPressAndHold
|
visible: !Config.userKnowsPressAndHold
|
||||||
text: qsTr('To access this list from the main screen, press and hold the Receive button')
|
text: qsTr('To access this list from the main screen, press and hold the Receive button')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ Item {
|
|||||||
dialog.open()
|
dialog.open()
|
||||||
}
|
}
|
||||||
onPressAndHold: {
|
onPressAndHold: {
|
||||||
Daemon.currentWallet.userKnowsPressAndHold = true
|
Config.userKnowsPressAndHold = true
|
||||||
Daemon.currentWallet.delete_expired_requests()
|
Daemon.currentWallet.delete_expired_requests()
|
||||||
app.stack.push(Qt.resolvedUrl('ReceiveRequests.qml'))
|
app.stack.push(Qt.resolvedUrl('ReceiveRequests.qml'))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -199,6 +199,18 @@ class QEConfig(AuthMixin, QObject):
|
|||||||
self.config.set_key('preferred_request_type', preferred_request_type)
|
self.config.set_key('preferred_request_type', preferred_request_type)
|
||||||
self.preferredRequestTypeChanged.emit()
|
self.preferredRequestTypeChanged.emit()
|
||||||
|
|
||||||
|
userKnowsPressAndHoldChanged = pyqtSignal()
|
||||||
|
@pyqtProperty(bool, notify=userKnowsPressAndHoldChanged)
|
||||||
|
def userKnowsPressAndHold(self):
|
||||||
|
return self.config.get('user_knows_press_and_hold', False)
|
||||||
|
|
||||||
|
@userKnowsPressAndHold.setter
|
||||||
|
def userKnowsPressAndHold(self, userKnowsPressAndHold):
|
||||||
|
if userKnowsPressAndHold != self.config.get('user_knows_press_and_hold', False):
|
||||||
|
self.config.set_key('user_knows_press_and_hold', userKnowsPressAndHold)
|
||||||
|
self.userKnowsPressAndHoldChanged.emit()
|
||||||
|
|
||||||
|
|
||||||
@pyqtSlot('qint64', result=str)
|
@pyqtSlot('qint64', result=str)
|
||||||
@pyqtSlot('qint64', bool, result=str)
|
@pyqtSlot('qint64', bool, result=str)
|
||||||
@pyqtSlot(QEAmount, result=str)
|
@pyqtSlot(QEAmount, result=str)
|
||||||
|
|||||||
@@ -125,18 +125,8 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
|
|||||||
|
|
||||||
self.register_callbacks()
|
self.register_callbacks()
|
||||||
self.destroyed.connect(lambda: self.on_destroy())
|
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()
|
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()
|
synchronizingChanged = pyqtSignal()
|
||||||
@pyqtProperty(bool, notify=synchronizingChanged)
|
@pyqtProperty(bool, notify=synchronizingChanged)
|
||||||
def synchronizing(self):
|
def synchronizing(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user