qml: qedaemon doesn't need wallet path and name properties, pass them via the signal
This commit is contained in:
@@ -345,9 +345,9 @@ ApplicationWindow
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: Daemon
|
target: Daemon
|
||||||
function onWalletRequiresPassword() {
|
function onWalletRequiresPassword(name, path) {
|
||||||
console.log('wallet requires password')
|
console.log('wallet requires password')
|
||||||
var dialog = openWalletDialog.createObject(app, { path: Daemon.path })
|
var dialog = openWalletDialog.createObject(app, { path: path, name: name })
|
||||||
dialog.open()
|
dialog.open()
|
||||||
}
|
}
|
||||||
function onWalletOpenError(error) {
|
function onWalletOpenError(error) {
|
||||||
@@ -445,6 +445,7 @@ ApplicationWindow
|
|||||||
property bool _lockDialogShown: false
|
property bool _lockDialogShown: false
|
||||||
|
|
||||||
onActiveChanged: {
|
onActiveChanged: {
|
||||||
|
console.log('app active = ' + active)
|
||||||
if (!active) {
|
if (!active) {
|
||||||
// deactivated
|
// deactivated
|
||||||
_lastActive = Date.now()
|
_lastActive = Date.now()
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ class QEDaemon(AuthMixin, QObject):
|
|||||||
_new_wallet_wizard = None
|
_new_wallet_wizard = None
|
||||||
_server_connect_wizard = None
|
_server_connect_wizard = None
|
||||||
_path = None
|
_path = None
|
||||||
|
_name = None
|
||||||
_use_single_password = False
|
_use_single_password = False
|
||||||
_password = None
|
_password = None
|
||||||
|
|
||||||
@@ -123,7 +124,7 @@ class QEDaemon(AuthMixin, QObject):
|
|||||||
serverConnectWizardChanged = pyqtSignal()
|
serverConnectWizardChanged = pyqtSignal()
|
||||||
|
|
||||||
walletLoaded = pyqtSignal()
|
walletLoaded = pyqtSignal()
|
||||||
walletRequiresPassword = pyqtSignal()
|
walletRequiresPassword = pyqtSignal([str,str], arguments=['name','path'])
|
||||||
walletOpenError = pyqtSignal([str], arguments=["error"])
|
walletOpenError = pyqtSignal([str], arguments=["error"])
|
||||||
walletDeleteError = pyqtSignal([str,str], arguments=['code', 'message'])
|
walletDeleteError = pyqtSignal([str,str], arguments=['code', 'message'])
|
||||||
|
|
||||||
@@ -137,7 +138,7 @@ class QEDaemon(AuthMixin, QObject):
|
|||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def passwordValidityCheck(self):
|
def passwordValidityCheck(self):
|
||||||
if not self._walletdb._validPassword:
|
if not self._walletdb._validPassword:
|
||||||
self.walletRequiresPassword.emit()
|
self.walletRequiresPassword.emit(self._name, self._path)
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
@pyqtSlot(str)
|
@pyqtSlot(str)
|
||||||
@@ -153,6 +154,8 @@ class QEDaemon(AuthMixin, QObject):
|
|||||||
return
|
return
|
||||||
|
|
||||||
self._path = standardize_path(self._path)
|
self._path = standardize_path(self._path)
|
||||||
|
self._name = os.path.basename(self._path)
|
||||||
|
|
||||||
self._logger.debug('load wallet ' + str(self._path))
|
self._logger.debug('load wallet ' + str(self._path))
|
||||||
|
|
||||||
if not password:
|
if not password:
|
||||||
@@ -230,10 +233,6 @@ class QEDaemon(AuthMixin, QObject):
|
|||||||
|
|
||||||
self.availableWallets.remove_wallet(path)
|
self.availableWallets.remove_wallet(path)
|
||||||
|
|
||||||
@pyqtProperty('QString')
|
|
||||||
def path(self):
|
|
||||||
return self._path
|
|
||||||
|
|
||||||
@pyqtProperty(QEWallet, notify=walletLoaded)
|
@pyqtProperty(QEWallet, notify=walletLoaded)
|
||||||
def currentWallet(self):
|
def currentWallet(self):
|
||||||
return self._current_wallet
|
return self._current_wallet
|
||||||
|
|||||||
Reference in New Issue
Block a user