qml: refactor all custom QRScan component wrappers to ScanDialog
(except SendDialog, which has a Paste button and slightly different behavior)
This commit is contained in:
@@ -79,9 +79,10 @@ WizardComponent {
|
||||
icon.source: '../../../icons/share.png'
|
||||
icon.color: 'transparent'
|
||||
onClicked: {
|
||||
var dialog = app.genericShareDialog.createObject(app,
|
||||
{ title: qsTr('Master public key'), text: multisigMasterPubkey }
|
||||
)
|
||||
var dialog = app.genericShareDialog.createObject(app, {
|
||||
title: qsTr('Master public key'),
|
||||
text: multisigMasterPubkey
|
||||
})
|
||||
dialog.open()
|
||||
}
|
||||
}
|
||||
@@ -141,14 +142,19 @@ WizardComponent {
|
||||
icon.width: constants.iconSizeMedium
|
||||
scale: 1.2
|
||||
onClicked: {
|
||||
var scan = qrscan.createObject(root)
|
||||
scan.onFound.connect(function() {
|
||||
if (verifyMasterKey(scan.scanData))
|
||||
masterkey_ta.text = scan.scanData
|
||||
var dialog = app.scanDialog.createObject(app, {
|
||||
hint: cosigner
|
||||
? qsTr('Scan a cosigner master public key')
|
||||
: qsTr('Scan a master key')
|
||||
})
|
||||
dialog.onFound.connect(function() {
|
||||
if (verifyMasterKey(dialog.scanData))
|
||||
masterkey_ta.text = dialog.scanData
|
||||
else
|
||||
masterkey_ta.text = ''
|
||||
scan.destroy()
|
||||
dialog.close()
|
||||
})
|
||||
dialog.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,25 +172,6 @@ WizardComponent {
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: qrscan
|
||||
QRScan {
|
||||
width: root.width
|
||||
height: root.height
|
||||
|
||||
ToolButton {
|
||||
icon.source: '../../../icons/closebutton.png'
|
||||
icon.height: constants.iconSizeMedium
|
||||
icon.width: constants.iconSizeMedium
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
onClicked: {
|
||||
parent.destroy()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Bitcoin {
|
||||
id: bitcoin
|
||||
onValidationMessageChanged: validationtext.text = validationMessage
|
||||
|
||||
@@ -62,40 +62,28 @@ WizardComponent {
|
||||
icon.width: constants.iconSizeMedium
|
||||
scale: 1.2
|
||||
onClicked: {
|
||||
var scan = qrscan.createObject(root)
|
||||
scan.onFound.connect(function() {
|
||||
if (verify(scan.scanData)) {
|
||||
var dialog = app.scanDialog.createObject(app, {
|
||||
hint: bitcoin.isAddressList(import_ta.text)
|
||||
? qsTr('Scan another address')
|
||||
: bitcoin.isPrivateKeyList(import_ta.text)
|
||||
? qsTr('Scan another private key')
|
||||
: qsTr('Scan a private key or an address')
|
||||
})
|
||||
dialog.onFound.connect(function() {
|
||||
if (verify(dialog.scanData)) {
|
||||
if (import_ta.text != '')
|
||||
import_ta.text = import_ta.text + ',\n'
|
||||
import_ta.text = import_ta.text + scan.scanData
|
||||
import_ta.text = import_ta.text + dialog.scanData
|
||||
}
|
||||
scan.destroy()
|
||||
dialog.close()
|
||||
})
|
||||
dialog.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: qrscan
|
||||
QRScan {
|
||||
width: root.width
|
||||
height: root.height
|
||||
|
||||
ToolButton {
|
||||
icon.source: '../../../icons/closebutton.png'
|
||||
icon.height: constants.iconSizeMedium
|
||||
icon.width: constants.iconSizeMedium
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
onClicked: {
|
||||
parent.destroy()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Bitcoin {
|
||||
id: bitcoin
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user