URI: 
       tclose_wallet - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 5b84cbe9fbfb6570a5b5062262a02ccf3a851e6c
   DIR parent 45a55e258f36144a9315db9a6e45145de4f7f80f
  HTML Author: ThomasV <thomasv@gitorious>
       Date:   Fri, 12 Sep 2014 19:58:59 +0200
       
       close_wallet
       
       Diffstat:
         M gui/qt/__init__.py                  |       2 +-
         M gui/qt/main_window.py               |      11 ++++++-----
         M plugins/trezor.py                   |       5 +++++
       
       3 files changed, 12 insertions(+), 6 deletions(-)
       ---
   DIR diff --git a/gui/qt/__init__.py b/gui/qt/__init__.py
       t@@ -220,6 +220,6 @@ class ElectrumGui:
                event = QtCore.QEvent(QtCore.QEvent.Clipboard)
                self.app.sendEvent(self.app.clipboard(), event)
        
       -        wallet.stop_threads()
       +        w.close_wallet()
        
        
   DIR diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
       t@@ -200,10 +200,12 @@ class ElectrumWindow(QMainWindow):
                else:
                    self.account_selector.hide()
        
       +    def close_wallet(self):
       +        self.wallet.stop_threads()
       +        run_hook('close_wallet')
        
            def load_wallet(self, wallet):
                import electrum
       -
                self.wallet = wallet
                self.update_wallet_format()
                # address used to create a dummy transaction and estimate transaction fee
       t@@ -257,12 +259,11 @@ class ElectrumWindow(QMainWindow):
                    self.show_message("file not found "+ filename)
                    return
        
       -        self.wallet.stop_threads()
       -
       -        # create new wallet
       +        # close current wallet
       +        self.close_wallet()
       +        # load new wallet
                wallet = Wallet(storage)
                wallet.start_threads(self.network)
       -
                self.load_wallet(wallet)
        
        
   DIR diff --git a/plugins/trezor.py b/plugins/trezor.py
       t@@ -80,6 +80,11 @@ class Plugin(BasePlugin):
                return BasePlugin.enable(self)
        
            @hook
       +    def close_wallet(self):
       +        print_error("trezor: clear session")
       +        self.wallet.client.clear_session()
       +
       +    @hook
            def load_wallet(self, wallet):
                self.wallet = wallet
                if not self.wallet.check_proper_device():