qt wizard: select_storage
This commit is contained in:
@@ -226,10 +226,10 @@ class ElectrumGui(PrintError):
|
|||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
if not wallet:
|
if not wallet:
|
||||||
storage = WalletStorage(path, manual_upgrades=True)
|
wizard = InstallWizard(self.config, self.app, self.plugins, None)
|
||||||
wizard = InstallWizard(self.config, self.app, self.plugins, storage)
|
|
||||||
try:
|
try:
|
||||||
wallet = wizard.run_and_get_wallet(self.daemon.get_wallet)
|
if wizard.select_storage(path, self.daemon.get_wallet):
|
||||||
|
wallet = wizard.run_and_get_wallet()
|
||||||
except UserCancelled:
|
except UserCancelled:
|
||||||
pass
|
pass
|
||||||
except GoBack as e:
|
except GoBack as e:
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
|
|||||||
self.raise_()
|
self.raise_()
|
||||||
self.refresh_gui() # Need for QT on MacOSX. Lame.
|
self.refresh_gui() # Need for QT on MacOSX. Lame.
|
||||||
|
|
||||||
def run_and_get_wallet(self, get_wallet_from_daemon):
|
def select_storage(self, path, get_wallet_from_daemon):
|
||||||
|
|
||||||
vbox = QVBoxLayout()
|
vbox = QVBoxLayout()
|
||||||
hbox = QHBoxLayout()
|
hbox = QHBoxLayout()
|
||||||
@@ -183,6 +183,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
|
|||||||
vbox.addLayout(hbox2)
|
vbox.addLayout(hbox2)
|
||||||
self.set_layout(vbox, title=_('Electrum wallet'))
|
self.set_layout(vbox, title=_('Electrum wallet'))
|
||||||
|
|
||||||
|
self.storage = WalletStorage(path, manual_upgrades=True)
|
||||||
wallet_folder = os.path.dirname(self.storage.path)
|
wallet_folder = os.path.dirname(self.storage.path)
|
||||||
|
|
||||||
def on_choose():
|
def on_choose():
|
||||||
@@ -284,7 +285,9 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
|
|||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
raise Exception('Unexpected encryption version')
|
raise Exception('Unexpected encryption version')
|
||||||
|
return True
|
||||||
|
|
||||||
|
def run_and_get_wallet(self):
|
||||||
path = self.storage.path
|
path = self.storage.path
|
||||||
if self.storage.requires_split():
|
if self.storage.requires_split():
|
||||||
self.hide()
|
self.hide()
|
||||||
|
|||||||
Reference in New Issue
Block a user