URI: 
       tdisable privkey export menu in trezor wallets - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 1fb8af40c529c8767d6d0807aaa88bea16b380b4
   DIR parent 265d74c5426bbf109fa372197eb5adc9384c6e45
  HTML Author: ThomasV <thomasv@gitorious>
       Date:   Tue,  9 Sep 2014 14:30:57 +0200
       
       disable privkey export menu in trezor wallets
       
       Diffstat:
         M gui/qt/main_window.py               |       6 ++++--
         M lib/wallet.py                       |       3 +++
         M plugins/trezor.py                   |       3 +++
       
       3 files changed, 10 insertions(+), 2 deletions(-)
       ---
   DIR diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
       t@@ -224,6 +224,7 @@ class ElectrumWindow(QMainWindow):
                self.seed_menu.setEnabled(self.wallet.has_seed())
                self.mpk_menu.setEnabled(self.wallet.is_deterministic())
                self.import_menu.setEnabled(self.wallet.can_import())
       +        self.export_menu.setEnabled(self.wallet.can_export())
        
                self.update_lock_icon()
                self.update_buttons_on_seed()
       t@@ -338,7 +339,7 @@ class ElectrumWindow(QMainWindow):
                self.private_keys_menu = wallet_menu.addMenu(_("&Private keys"))
                self.private_keys_menu.addAction(_("&Sweep"), self.sweep_key_dialog)
                self.import_menu = self.private_keys_menu.addAction(_("&Import"), self.do_import_privkey)
       -        self.private_keys_menu.addAction(_("&Export"), self.export_privkeys_dialog)
       +        self.export_menu = self.private_keys_menu.addAction(_("&Export"), self.export_privkeys_dialog)
                wallet_menu.addAction(_("&Export History"), self.export_history_dialog)
        
                tools_menu = menubar.addMenu(_("&Tools"))
       t@@ -1451,8 +1452,9 @@ class ElectrumWindow(QMainWindow):
                    menu.addAction(_("Request payment"), lambda: self.receive_at(addr))
                    menu.addAction(_("Edit label"), lambda: self.edit_label(True))
                    menu.addAction(_("Public keys"), lambda: self.show_public_keys(addr))
       -            if not self.wallet.is_watching_only():
       +            if self.wallet.can_export():
                        menu.addAction(_("Private key"), lambda: self.show_private_key(addr))
       +            if not self.wallet.is_watching_only():
                        menu.addAction(_("Sign/verify message"), lambda: self.sign_verify_message(addr))
                        menu.addAction(_("Encrypt/decrypt message"), lambda: self.encrypt_message(addr))
                    if self.wallet.is_imported(addr):
   DIR diff --git a/lib/wallet.py b/lib/wallet.py
       t@@ -1009,6 +1009,9 @@ class Abstract_Wallet(object):
            def can_import(self):
                return not self.is_watching_only()
        
       +    def can_export(self):
       +        return not self.is_watching_only()
       +
            def is_used(self, address):
                h = self.history.get(address,[])
                c, u = self.get_addr_balance(address)
   DIR diff --git a/plugins/trezor.py b/plugins/trezor.py
       t@@ -154,6 +154,9 @@ class TrezorWallet(NewWallet):
            def can_import(self):
                return False
        
       +    def can_export(self):
       +        return False
       +
            def can_create_accounts(self):
                return True