diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 29f2e1e6..3535a8d7 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -128,17 +128,23 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): self.utxo_tab = self.create_utxo_tab() self.console_tab = self.create_console_tab() self.contacts_tab = self.create_contacts_tab() - tabs.addTab(self.create_history_tab(), _('History') ) - tabs.addTab(self.send_tab, _('Send') ) - tabs.addTab(self.receive_tab, _('Receive') ) - if self.config.get('show_addresses_tab', False): - tabs.addTab(self.addresses_tab, _('Addresses')) - if self.config.get('show_utxo_tab', False): - tabs.addTab(self.utxo_tab, _('Coins')) - if self.config.get('show_contacts_tab', False): - tabs.addTab(self.contacts_tab, _('Contacts') ) - if self.config.get('show_console_tab', False): - tabs.addTab(self.console_tab, _('Console') ) + tabs.addTab(self.create_history_tab(), QIcon(":icons/tab_history.png"), _('History')) + tabs.addTab(self.send_tab, QIcon(":icons/tab_send.png"), _('Send')) + tabs.addTab(self.receive_tab, QIcon(":icons/tab_receive.png"), _('Receive')) + + def add_optional_tab(tabs, tab, icon, description, name): + tab.tab_icon = icon + tab.tab_description = description + tab.tab_pos = len(tabs) + tab.tab_name = name + if self.config.get('show_{}_tab'.format(name), False): + tabs.addTab(tab, icon, description) + + add_optional_tab(tabs, self.addresses_tab, QIcon(":icons/tab_addresses.png"), _("Addresses"), "addresses") + add_optional_tab(tabs, self.utxo_tab, QIcon(":icons/tab_coins.png"), _("Coins"), "utxo") + add_optional_tab(tabs, self.contacts_tab, QIcon(":icons/tab_contacts.png"), _("Contacts"), "contacts") + add_optional_tab(tabs, self.console_tab, QIcon(":icons/tab_console.png"), _("Console"), "console") + tabs.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.setCentralWidget(tabs) @@ -207,9 +213,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): self.history_list.update() def toggle_tab(self, tab): - show = not self.config.get('show_{}_tab'.format(tab.name), False) - self.config.set_key('show_{}_tab'.format(tab.name), show) - item_text = (_("Hide") if show else _("Show")) + " " + tab.description + show = not self.config.get('show_{}_tab'.format(tab.tab_name), False) + self.config.set_key('show_{}_tab'.format(tab.tab_name), show) + item_text = (_("Hide") if show else _("Show")) + " " + tab.tab_description tab.menu_action.setText(item_text) if show: # Find out where to place the tab @@ -221,7 +227,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): break except AttributeError: pass - self.tabs.insertTab(index, tab, tab.description) + self.tabs.insertTab(index, tab, tab.tab_icon, tab.tab_description) else: i = self.tabs.indexOf(tab) self.tabs.removeTab(i) @@ -459,19 +465,16 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): wallet_menu.addSeparator() wallet_menu.addAction(_("Find"), self.toggle_search).setShortcut(QKeySequence("Ctrl+F")) - def add_toggle_action(view_menu, target_tab, tab_description, tab_name, tab_pos): - is_shown = self.config.get('show_{}_tab'.format(tab_name), False) - item_name = (_("Hide") if is_shown else _("Show")) + " " + tab_description - target_tab.name = tab_name - target_tab.description = tab_description - target_tab.tab_pos = tab_pos - target_tab.menu_action = view_menu.addAction(item_name, lambda: self.toggle_tab(target_tab)) + def add_toggle_action(view_menu, tab): + is_shown = self.config.get('show_{}_tab'.format(tab.tab_name), False) + item_name = (_("Hide") if is_shown else _("Show")) + " " + tab.tab_description + tab.menu_action = view_menu.addAction(item_name, lambda: self.toggle_tab(tab)) view_menu = menubar.addMenu(_("&View")) - add_toggle_action(view_menu, self.addresses_tab, "Addresses", "addresses", 1) - add_toggle_action(view_menu, self.utxo_tab, "Coins", "utxo", 2) - add_toggle_action(view_menu, self.contacts_tab, "Contacts", "contacts", 3) - add_toggle_action(view_menu, self.console_tab, "Console", "console", 4) + add_toggle_action(view_menu, self.addresses_tab) + add_toggle_action(view_menu, self.utxo_tab) + add_toggle_action(view_menu, self.contacts_tab) + add_toggle_action(view_menu, self.console_tab) tools_menu = menubar.addMenu(_("&Tools")) @@ -515,7 +518,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): def show_about(self): QMessageBox.about(self, "Electrum", - _("Version")+" %s" % (self.wallet.electrum_version) + "\n\n" + _("Electrum's focus is speed, with low resource usage and simplifying Bitcoin. You do not need to perform regular backups, because your wallet can be recovered from a secret phrase that you can memorize or write on paper. Startup times are instant because it operates in conjunction with high-performance servers that handle the most complicated parts of the Bitcoin system.")) + _("Version")+" %s" % (self.wallet.electrum_version) + "\n\n" + + _("Electrum's focus is speed, with low resource usage and simplifying Bitcoin. You do not need to perform regular backups, because your wallet can be recovered from a secret phrase that you can memorize or write on paper. Startup times are instant because it operates in conjunction with high-performance servers that handle the most complicated parts of the Bitcoin system." + "\n\n" + + _("Uses icons from the Icons8 icon pack (icons8.com)."))) def show_report_bug(self): msg = ' '.join([ diff --git a/icons.qrc b/icons.qrc index 930ce252..b6349b44 100644 --- a/icons.qrc +++ b/icons.qrc @@ -31,6 +31,13 @@ icons/status_waiting.png icons/status_lagging.png icons/seal.png + icons/tab_addresses.png + icons/tab_coins.png + icons/tab_console.png + icons/tab_contacts.png + icons/tab_history.png + icons/tab_receive.png + icons/tab_send.png icons/tor_logo.png icons/speaker.png icons/trezor_unpaired.png diff --git a/icons/tab_addresses.png b/icons/tab_addresses.png new file mode 100644 index 00000000..449b23ba Binary files /dev/null and b/icons/tab_addresses.png differ diff --git a/icons/tab_coins.png b/icons/tab_coins.png new file mode 100644 index 00000000..a6c8265d Binary files /dev/null and b/icons/tab_coins.png differ diff --git a/icons/tab_console.png b/icons/tab_console.png new file mode 100644 index 00000000..4f70e6f6 Binary files /dev/null and b/icons/tab_console.png differ diff --git a/icons/tab_contacts.png b/icons/tab_contacts.png new file mode 100644 index 00000000..d21ae9ed Binary files /dev/null and b/icons/tab_contacts.png differ diff --git a/icons/tab_history.png b/icons/tab_history.png new file mode 100644 index 00000000..ecdc4681 Binary files /dev/null and b/icons/tab_history.png differ diff --git a/icons/tab_receive.png b/icons/tab_receive.png new file mode 100644 index 00000000..ba486694 Binary files /dev/null and b/icons/tab_receive.png differ diff --git a/icons/tab_send.png b/icons/tab_send.png new file mode 100644 index 00000000..7ef90a42 Binary files /dev/null and b/icons/tab_send.png differ