electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 1f9598e1c7a06978da5e898d7485b87c83f76a18
parent 3b9f9d5320ff9353cf4f021881817bc8425c292b
Author: ThomasV <thomasv@gitorious>
Date:   Fri, 30 Jan 2015 13:44:05 +0100

show dialog if IOError is raised reading wallet file

Diffstat:
Mgui/qt/main_window.py | 15++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py @@ -259,13 +259,14 @@ class ElectrumWindow(QMainWindow): filename = unicode( QFileDialog.getOpenFileName(self, "Select your wallet file", wallet_folder) ) if not filename: return - - storage = WalletStorage({'wallet_path': filename}) + try: + storage = WalletStorage({'wallet_path': filename}) + except Exception as e: + self.show_message(str(e)) + return if not storage.file_exists: - self.show_message("file not found "+ filename) + self.show_message(_("File not found") + ' ' + filename) return - - # read wizard action try: wallet = Wallet(storage) @@ -273,15 +274,12 @@ class ElectrumWindow(QMainWindow): QMessageBox.warning(None, _('Warning'), str(e), _('OK')) return action = wallet.get_action() - # ask for confirmation if action is not None: if not self.question(_("This file contains an incompletely created wallet.\nDo you want to complete its creation now?")): return - # close current wallet self.close_wallet() - # run wizard if action is not None: import installwizard @@ -296,7 +294,6 @@ class ElectrumWindow(QMainWindow): return else: wallet.start_threads(self.network) - # load new wallet in gui self.load_wallet(wallet)