electrum

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

commit fe5374fe8ea0e95ff6aa63cfef6c6a192fd86b3d
parent e49fc05c49201496aa721eee9dd0beb7d940084d
Author: ThomasV <thomasv@electrum.org>
Date:   Sun,  5 Jun 2016 09:39:37 +0200

require PIN to delete file

Diffstat:
Mgui/kivy/main_window.py | 13+++++++++++++
Mgui/kivy/uix/dialogs/wallets.py | 3+--
2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/gui/kivy/main_window.py b/gui/kivy/main_window.py @@ -779,6 +779,19 @@ class ElectrumWindow(App): else: apply(f, args + (None,)) + def delete_wallet(self, name): + basename = os.path.basename(name) + def f(pw): + if self.wallet.use_encryption: + try: + self.wallet.check_password(old_password) + except: + self.show_error("Invalid PIN") + return + os.unlink, (name,) + self.show_error("File %s removed."%basename) + self.protected(_("Enter your PIN code to delete %s") % basename, f, ()) + def show_seed(self, label): self.protected(_("Enter your PIN code in order to decrypt your seed"), self._show_seed, (label,)) diff --git a/gui/kivy/uix/dialogs/wallets.py b/gui/kivy/uix/dialogs/wallets.py @@ -73,6 +73,5 @@ class WalletDialog(Factory.Popup): def delete_wallet(self, app): from question import Question name = self.ids.wallet_selector.selection[0] - f = lambda: os.unlink(name) - d = Question(_('Delete wallet?') + '\n' + os.path.basename(name), f) + d = Question(_('Delete wallet?') + '\n' + os.path.basename(name), lambda: app.delete_wallet(name)) d.open()