restore from master public key
This commit is contained in:
parent
1a8428647f
commit
b30bac13e5
|
@ -157,27 +157,34 @@ class InstallWizard(QDialog):
|
||||||
if self.layout(): QWidget().setLayout(self.layout())
|
if self.layout(): QWidget().setLayout(self.layout())
|
||||||
|
|
||||||
vbox = QVBoxLayout(self)
|
vbox = QVBoxLayout(self)
|
||||||
msg = _("Please enter your master public key.")
|
|
||||||
|
|
||||||
label=QLabel(msg)
|
vbox.addWidget(QLabel(_("Please enter your master public key.")))
|
||||||
label.setWordWrap(True)
|
|
||||||
vbox.addWidget(label)
|
|
||||||
|
|
||||||
mpk_e = QTextEdit()
|
|
||||||
mpk_e.setMaximumHeight(100)
|
|
||||||
vbox.addWidget(mpk_e)
|
|
||||||
|
|
||||||
grid = QGridLayout()
|
grid = QGridLayout()
|
||||||
grid.setSpacing(8)
|
grid.setSpacing(8)
|
||||||
|
|
||||||
|
label = QLabel(_("Key"))
|
||||||
|
grid.addWidget(label, 0, 0)
|
||||||
|
mpk_e = QTextEdit()
|
||||||
|
mpk_e.setMaximumHeight(100)
|
||||||
|
grid.addWidget(mpk_e, 0, 1)
|
||||||
|
|
||||||
|
label = QLabel(_("Chain"))
|
||||||
|
grid.addWidget(label, 1, 0)
|
||||||
|
chain_e = QTextEdit()
|
||||||
|
chain_e.setMaximumHeight(100)
|
||||||
|
grid.addWidget(chain_e, 1, 1)
|
||||||
|
|
||||||
vbox.addLayout(grid)
|
vbox.addLayout(grid)
|
||||||
|
|
||||||
vbox.addStretch(1)
|
vbox.addStretch(1)
|
||||||
vbox.addLayout(ok_cancel_buttons(self, _('Next')))
|
vbox.addLayout(ok_cancel_buttons(self, _('Next')))
|
||||||
|
|
||||||
if not self.exec_(): return
|
if not self.exec_(): return None, None
|
||||||
|
|
||||||
mpk = str(mpk_e.toPlainText())
|
mpk = str(mpk_e.toPlainText()).strip()
|
||||||
return mpk
|
chain = str(chain_e.toPlainText()).strip()
|
||||||
|
return mpk, chain
|
||||||
|
|
||||||
|
|
||||||
def network_dialog(self):
|
def network_dialog(self):
|
||||||
|
@ -280,18 +287,11 @@ class InstallWizard(QDialog):
|
||||||
|
|
||||||
elif action == 'watching':
|
elif action == 'watching':
|
||||||
# ask for seed and gap.
|
# ask for seed and gap.
|
||||||
mpk = self.mpk_dialog()
|
K, chain = self.mpk_dialog()
|
||||||
if not mpk:
|
if not K:
|
||||||
return
|
return
|
||||||
wallet.seed = ''
|
wallet.seed = ''
|
||||||
|
wallet.create_watching_only_wallet(chain,K)
|
||||||
print eval(mpk)
|
|
||||||
try:
|
|
||||||
c0, K0 = eval(mpk)
|
|
||||||
except:
|
|
||||||
QMessageBox.warning(None, _('Error'), _('error'), _('OK'))
|
|
||||||
return
|
|
||||||
wallet.create_watching_only_wallet(c0,K0)
|
|
||||||
|
|
||||||
|
|
||||||
else: raise
|
else: raise
|
||||||
|
|
|
@ -1450,12 +1450,13 @@ class ElectrumWindow(QMainWindow):
|
||||||
|
|
||||||
main_layout = QGridLayout()
|
main_layout = QGridLayout()
|
||||||
|
|
||||||
main_layout.addWidget(QLabel(_('chain')), 1, 0)
|
main_layout.addWidget(QLabel(_('Key')), 1, 0)
|
||||||
main_layout.addWidget(chain_text, 1, 1)
|
main_layout.addWidget(mpk_text, 1, 1)
|
||||||
main_layout.addWidget(chain_qrw, 1, 2)
|
main_layout.addWidget(mpk_qrw, 1, 2)
|
||||||
main_layout.addWidget(QLabel(_('public key')), 2, 0)
|
|
||||||
main_layout.addWidget(mpk_text, 2, 1)
|
main_layout.addWidget(QLabel(_('Chain')), 2, 0)
|
||||||
main_layout.addWidget(mpk_qrw, 2, 2)
|
main_layout.addWidget(chain_text, 2, 1)
|
||||||
|
main_layout.addWidget(chain_qrw, 2, 2)
|
||||||
|
|
||||||
def update(key):
|
def update(key):
|
||||||
c, K, cK = self.wallet.master_public_keys[str(key)]
|
c, K, cK = self.wallet.master_public_keys[str(key)]
|
||||||
|
|
Loading…
Reference in New Issue