|
@ -99,16 +99,6 @@ class InstallWizard(QDialog): |
|
|
seed_e.setMaximumHeight(100) |
|
|
seed_e.setMaximumHeight(100) |
|
|
vbox.addWidget(seed_e) |
|
|
vbox.addWidget(seed_e) |
|
|
|
|
|
|
|
|
if is_restore: |
|
|
|
|
|
grid = QGridLayout() |
|
|
|
|
|
grid.setSpacing(8) |
|
|
|
|
|
gap_e = AmountEdit(None, True) |
|
|
|
|
|
gap_e.setText("5") |
|
|
|
|
|
grid.addWidget(QLabel(_('Gap limit')), 2, 0) |
|
|
|
|
|
grid.addWidget(gap_e, 2, 1) |
|
|
|
|
|
grid.addWidget(HelpButton(_('Keep the default value unless you modified this parameter in your wallet.')), 2, 3) |
|
|
|
|
|
vbox.addLayout(grid) |
|
|
|
|
|
|
|
|
|
|
|
vbox.addLayout(ok_cancel_buttons(d, _('Next'))) |
|
|
vbox.addLayout(ok_cancel_buttons(d, _('Next'))) |
|
|
d.setLayout(vbox) |
|
|
d.setLayout(vbox) |
|
|
|
|
|
|
|
@ -128,15 +118,8 @@ class InstallWizard(QDialog): |
|
|
QMessageBox.warning(None, _('Error'), _('No seed'), _('OK')) |
|
|
QMessageBox.warning(None, _('Error'), _('No seed'), _('OK')) |
|
|
return |
|
|
return |
|
|
|
|
|
|
|
|
if not is_restore: |
|
|
|
|
|
return seed |
|
|
return seed |
|
|
else: |
|
|
|
|
|
try: |
|
|
|
|
|
gap = int(unicode(gap_e.text())) |
|
|
|
|
|
except: |
|
|
|
|
|
QMessageBox.warning(None, _('Error'), 'error', 'OK') |
|
|
|
|
|
return |
|
|
|
|
|
return seed, gap |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def mpk_dialog(self): |
|
|
def mpk_dialog(self): |
|
@ -156,11 +139,6 @@ class InstallWizard(QDialog): |
|
|
|
|
|
|
|
|
grid = QGridLayout() |
|
|
grid = QGridLayout() |
|
|
grid.setSpacing(8) |
|
|
grid.setSpacing(8) |
|
|
gap_e = AmountEdit(None, True) |
|
|
|
|
|
gap_e.setText("5") |
|
|
|
|
|
grid.addWidget(QLabel(_('Gap limit')), 2, 0) |
|
|
|
|
|
grid.addWidget(gap_e, 2, 1) |
|
|
|
|
|
grid.addWidget(HelpButton(_('Keep the default value unless you modified this parameter in your wallet.')), 2, 3) |
|
|
|
|
|
vbox.addLayout(grid) |
|
|
vbox.addLayout(grid) |
|
|
|
|
|
|
|
|
vbox.addLayout(ok_cancel_buttons(d, _('Next'))) |
|
|
vbox.addLayout(ok_cancel_buttons(d, _('Next'))) |
|
@ -169,14 +147,7 @@ class InstallWizard(QDialog): |
|
|
if not d.exec_(): return |
|
|
if not d.exec_(): return |
|
|
|
|
|
|
|
|
mpk = str(mpk_e.toPlainText()) |
|
|
mpk = str(mpk_e.toPlainText()) |
|
|
|
|
|
return mpk |
|
|
try: |
|
|
|
|
|
gap = int(unicode(gap_e.text())) |
|
|
|
|
|
except: |
|
|
|
|
|
QMessageBox.warning(None, _('Error'), 'error', 'OK') |
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
return mpk, gap |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def network_dialog(self): |
|
|
def network_dialog(self): |
|
@ -277,6 +248,10 @@ class InstallWizard(QDialog): |
|
|
if not action: exit() |
|
|
if not action: exit() |
|
|
|
|
|
|
|
|
wallet = Wallet(self.storage) |
|
|
wallet = Wallet(self.storage) |
|
|
|
|
|
gap = self.config.get('gap_limit',5) |
|
|
|
|
|
if gap !=5: |
|
|
|
|
|
wallet.gap_limit = gap |
|
|
|
|
|
wallet.storage.put('gap_limit', gap,True) |
|
|
|
|
|
|
|
|
if action == 'create': |
|
|
if action == 'create': |
|
|
wallet.init_seed(None) |
|
|
wallet.init_seed(None) |
|
@ -291,25 +266,17 @@ class InstallWizard(QDialog): |
|
|
|
|
|
|
|
|
elif action == 'restore': |
|
|
elif action == 'restore': |
|
|
# ask for seed and gap. |
|
|
# ask for seed and gap. |
|
|
sg = self.seed_dialog() |
|
|
seed = self.seed_dialog() |
|
|
if not sg: |
|
|
|
|
|
return |
|
|
|
|
|
seed, gap = sg |
|
|
|
|
|
if not seed: |
|
|
if not seed: |
|
|
return |
|
|
return |
|
|
wallet.gap_limit = gap |
|
|
|
|
|
wallet.init_seed(str(seed)) |
|
|
wallet.init_seed(str(seed)) |
|
|
wallet.save_seed() |
|
|
wallet.save_seed() |
|
|
|
|
|
|
|
|
elif action == 'watching': |
|
|
elif action == 'watching': |
|
|
# ask for seed and gap. |
|
|
# ask for seed and gap. |
|
|
sg = self.mpk_dialog() |
|
|
mpk = self.mpk_dialog() |
|
|
if not sg: |
|
|
|
|
|
return |
|
|
|
|
|
mpk, gap = sg |
|
|
|
|
|
if not mpk: |
|
|
if not mpk: |
|
|
return |
|
|
return |
|
|
wallet.gap_limit = gap |
|
|
|
|
|
wallet.seed = '' |
|
|
wallet.seed = '' |
|
|
|
|
|
|
|
|
print eval(mpk) |
|
|
print eval(mpk) |
|
|