electrum

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

commit 587ca5dd42e832db277e0a3d754ad98e71cfbefa
parent 0e420e6f9d6bd82786e3b873f14c81a556e8e282
Author: ThomasV <thomasv@electrum.org>
Date:   Tue, 15 Dec 2020 15:51:06 +0100

kivy: initialize app.android_backups from config, and show error message if save_backup raises an exception

Diffstat:
Melectrum/gui/kivy/main_window.py | 8+++++++-
Melectrum/gui/kivy/uix/ui_screens/status.kv | 3++-
2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/electrum/gui/kivy/main_window.py b/electrum/gui/kivy/main_window.py @@ -381,6 +381,7 @@ class ElectrumWindow(App, Logger): self.daemon = self.gui_object.daemon self.fx = self.daemon.fx self.use_rbf = config.get('use_rbf', True) + self.android_backups = config.get('android_backups', False) self.use_unconfirmed = not config.get('confirmed_only', False) # create triggers so as to minimize updating a max of 2 times a sec @@ -1244,7 +1245,12 @@ class ElectrumWindow(App, Logger): request_permissions([Permission.WRITE_EXTERNAL_STORAGE], cb) def _save_backup(self): - new_path = self.wallet.save_backup() + try: + new_path = self.wallet.save_backup() + except Exception as e: + self.logger.exception("Failed to save wallet backup") + self.show_error("Failed to save wallet backup" + '\n' + str(e)) + return if new_path: self.show_info(_("Backup saved:") + f"\n{new_path}") else: diff --git a/electrum/gui/kivy/uix/ui_screens/status.kv b/electrum/gui/kivy/uix/ui_screens/status.kv @@ -81,7 +81,8 @@ Popup: Button: size_hint: 0.5, None height: '48dp' - text: _('Save Backup') + text: _('Export Backup') + disabled: not app.android_backups on_release: root.dismiss() app.save_backup()