commit b30bac13e5811bccc9beab97e6184e34812eebb3
parent 1a8428647f7064ff6ea9db3175c05274c9e8c6db
Author: ThomasV <thomasv@gitorious>
Date: Tue, 1 Oct 2013 14:28:43 +0200
restore from master public key
Diffstat:
2 files changed, 27 insertions(+), 26 deletions(-)
diff --git a/gui/qt/installwizard.py b/gui/qt/installwizard.py
@@ -157,27 +157,34 @@ class InstallWizard(QDialog):
if self.layout(): QWidget().setLayout(self.layout())
vbox = QVBoxLayout(self)
- msg = _("Please enter your master public key.")
- label=QLabel(msg)
- label.setWordWrap(True)
- vbox.addWidget(label)
+ vbox.addWidget(QLabel(_("Please enter your master public key.")))
+ grid = QGridLayout()
+ grid.setSpacing(8)
+
+ label = QLabel(_("Key"))
+ grid.addWidget(label, 0, 0)
mpk_e = QTextEdit()
mpk_e.setMaximumHeight(100)
- vbox.addWidget(mpk_e)
+ 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)
- grid = QGridLayout()
- grid.setSpacing(8)
vbox.addLayout(grid)
vbox.addStretch(1)
vbox.addLayout(ok_cancel_buttons(self, _('Next')))
- if not self.exec_(): return
+ if not self.exec_(): return None, None
- mpk = str(mpk_e.toPlainText())
- return mpk
+ mpk = str(mpk_e.toPlainText()).strip()
+ chain = str(chain_e.toPlainText()).strip()
+ return mpk, chain
def network_dialog(self):
@@ -280,18 +287,11 @@ class InstallWizard(QDialog):
elif action == 'watching':
# ask for seed and gap.
- mpk = self.mpk_dialog()
- if not mpk:
+ K, chain = self.mpk_dialog()
+ if not K:
return
wallet.seed = ''
-
- print eval(mpk)
- try:
- c0, K0 = eval(mpk)
- except:
- QMessageBox.warning(None, _('Error'), _('error'), _('OK'))
- return
- wallet.create_watching_only_wallet(c0,K0)
+ wallet.create_watching_only_wallet(chain,K)
else: raise
diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
@@ -1450,12 +1450,13 @@ class ElectrumWindow(QMainWindow):
main_layout = QGridLayout()
- main_layout.addWidget(QLabel(_('chain')), 1, 0)
- main_layout.addWidget(chain_text, 1, 1)
- main_layout.addWidget(chain_qrw, 1, 2)
- main_layout.addWidget(QLabel(_('public key')), 2, 0)
- main_layout.addWidget(mpk_text, 2, 1)
- main_layout.addWidget(mpk_qrw, 2, 2)
+ main_layout.addWidget(QLabel(_('Key')), 1, 0)
+ main_layout.addWidget(mpk_text, 1, 1)
+ main_layout.addWidget(mpk_qrw, 1, 2)
+
+ main_layout.addWidget(QLabel(_('Chain')), 2, 0)
+ main_layout.addWidget(chain_text, 2, 1)
+ main_layout.addWidget(chain_qrw, 2, 2)
def update(key):
c, K, cK = self.wallet.master_public_keys[str(key)]