electrum

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

commit 0e7795f2a77552e21cc98f5d706dd07770297028
parent be75b337aae370ef7b389d0bd93d8fc1561fe03b
Author: ThomasV <thomasv@electrum.org>
Date:   Wed, 25 May 2016 12:22:10 +0200

show/hide addresses tab in Qt GUI

Diffstat:
Mgui/qt/main_window.py | 14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py @@ -135,7 +135,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): tabs.addTab(self.create_history_tab(), _('History') ) tabs.addTab(self.create_send_tab(), _('Send') ) tabs.addTab(self.create_receive_tab(), _('Receive') ) - tabs.addTab(self.create_addresses_tab(), _('Addresses') ) + self.addresses_tab = self.create_addresses_tab() + if self.config.get('show_addresses_tab', False): + tabs.addTab(self.addresses_tab, _('Addresses')) tabs.addTab(self.create_contacts_tab(), _('Contacts') ) tabs.addTab(self.create_console_tab(), _('Console') ) tabs.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) @@ -187,6 +189,15 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): self.load_wallet(wallet) self.connect_slots(gui_object.timer) + def toggle_addresses_tab(self): + show_addr = not self.config.get('show_addresses_tab', False) + self.config.set_key('show_addresses_tab', show_addr) + if show_addr: + self.tabs.insertTab(3, self.addresses_tab, _('Addresses')) + else: + i = self.tabs.indexOf(self.addresses_tab) + self.tabs.removeTab(i) + def push_top_level_window(self, window): '''Used for e.g. tx dialog box to ensure new dialogs are appropriately parented. This used to be done by explicitly providing the parent @@ -431,6 +442,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): self.export_menu = self.private_keys_menu.addAction(_("&Export"), self.export_privkeys_dialog) wallet_menu.addAction(_("&Export History"), self.export_history_dialog) wallet_menu.addAction(_("Search"), self.toggle_search).setShortcut(QKeySequence("Ctrl+S")) + wallet_menu.addAction(_("Addresses"), self.toggle_addresses_tab).setShortcut(QKeySequence("Ctrl+A")) tools_menu = menubar.addMenu(_("&Tools"))